]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Fix race in apic->pending_events processing
authorGleb Natapov <gleb@redhat.com>
Mon, 3 Jun 2013 08:30:02 +0000 (11:30 +0300)
committerGleb Natapov <gleb@redhat.com>
Mon, 3 Jun 2013 08:32:39 +0000 (11:32 +0300)
commit9c2b270c9a60d40193e3243ee6ead46cfa9b2ac0
tree75c178b1c2767697e2bef132aea84a8c04c1b156
parenta757daa8f6cc393761390f4eb52efd7a868f8203
KVM: Fix race in apic->pending_events processing

apic->pending_events processing has a race that may cause INIT and
SIPI
processing to be reordered:

vpu0:                            vcpu1:
set INIT
                               test_and_clear_bit(KVM_APIC_INIT)
                                  process INIT
set INIT
set SIPI
                               test_and_clear_bit(KVM_APIC_SIPI)
                                  process SIPI

At the end INIT is left pending in pending_events. The following patch
fixes this by latching pending event before processing them.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/lapic.c