Il 30/05/2013 14:34, Gleb Natapov ha scritto:
>>> > >
>>> > > Ah, we check kvm_apic_has_events() in runnable. Then yes, we will not
>>> > > lose the event.
>> > 
>> > Ok, then I'd prefer to have the cmpxchg directly in the if, as in
>> > http://article.gmane.org/gmane.comp.emulators.kvm.devel/110505
>> > 
> I still do not. Both of them are tricky, mine does not coalesce events
> needlessly.

Agreed that both are tricky, but I don't think my patch is coalescing
events.  If you have

    INIT    SIPI     INIT     SIPI
                  ^                           ^
                  INIT bit cleared here       SIPI bit checked here

my patch KVM sees apic_events = INIT | SIPI and deduces that the SIPI
bit was set by the second SIPI, not by the first.  In fact the first
SIPI was cancelled by the second INIT, and thus should not be processed
at all.

Instead, with your patch KVM will service all four events; strictly
speaking it is wrong to service the first SIPI, which is why I prefer
having the cmpxchg in the beginning.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to