[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



>>> On 06.02.18 at 02:07, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 05/02/2018 19:23, Konrad Rzeszutek Wilk wrote:
>> On Mon, Feb 05, 2018 at 07:10:33PM +0000, Andrew Cooper wrote:
>>> -    apply_alternatives(__alt_instructions, __alt_instructions_end);
>>> +    /* Send ourselves an NMI to trigger the callback. */
>>> +    self_nmi();
>>> +
>>> +    /*
>>> +     * Sending ourself an NMI isn't architecturally guaranteed to result in
>>> +     * the synchronous delivery (although in practice, it appears to be).
>>> +     * Poll alt_done for up to 1 second.
>>> +     */
>>> +    for ( i = 0; !ACCESS_ONCE(alt_done) && i < 1000; ++i )
>> Perhaps an #define for this?
> 
> I don't really see the point.  I'm fairly sure that no 64bit CPU will
> enter this loop, but the APIC spec doesn't guarantee that delivery is
> synchronous.

I agree. If anything, the subsequent check could be changed
from "i >= 1000" to "!ACCESS_ONCE(alt_done)", eliminating the
double use of the same plain number.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.