Re: [Xen-devel] [PATCH v2] x86/boot: Make alternative patching NMI-safe

2018-02-06 Thread Jan Beulich
>>> On 06.02.18 at 02:07, wrote: > On 05/02/2018 19:23, Konrad Rzeszutek Wilk wrote: >> On Mon, Feb 05, 2018 at 07:10:33PM +, Andrew Cooper wrote: >>> -apply_alternatives(__alt_instructions, __alt_instructions_end); >>> +/* Send ourselves an NMI to trigger the callback. */ >>> +sel

Re: [Xen-devel] [PATCH v2] x86/boot: Make alternative patching NMI-safe

2018-02-05 Thread Andrew Cooper
On 05/02/2018 19:23, Konrad Rzeszutek Wilk wrote: > On Mon, Feb 05, 2018 at 07:10:33PM +, Andrew Cooper wrote: >> -apply_alternatives(__alt_instructions, __alt_instructions_end); >> +/* Send ourselves an NMI to trigger the callback. */ >> +self_nmi(); >> + >> +/* >> + * Send

Re: [Xen-devel] [PATCH v2] x86/boot: Make alternative patching NMI-safe

2018-02-05 Thread Konrad Rzeszutek Wilk
On Mon, Feb 05, 2018 at 07:10:33PM +, Andrew Cooper wrote: > During patching, there is a very slim risk that an NMI or MCE interrupt in the > middle of altering the code in the NMI/MCE paths, in which case bad things > will happen. > > The NMI risk can be eliminated by running the patching loo

[Xen-devel] [PATCH v2] x86/boot: Make alternative patching NMI-safe

2018-02-05 Thread Andrew Cooper
During patching, there is a very slim risk that an NMI or MCE interrupt in the middle of altering the code in the NMI/MCE paths, in which case bad things will happen. The NMI risk can be eliminated by running the patching loop in NMI context, at which point the CPU will defer further NMIs until pa