kernel-ark/virt/kvm
Michael S. Tsirkin 1a577b7247 KVM: fix race with level interrupts
When more than 1 source id is in use for the same GSI, we have the
following race related to handling irq_states race:

CPU 0 clears bit 0. CPU 0 read irq_state as 0. CPU 1 sets level to 1.
CPU 1 calls kvm_ioapic_set_irq(1). CPU 0 calls kvm_ioapic_set_irq(0).
Now ioapic thinks the level is 0 but irq_state is not 0.

Fix by performing all irq_states bitmap handling under pic/ioapic lock.
This also removes the need for atomics with irq_states handling.

Reported-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-07-20 16:12:00 -03:00
..
assigned-dev.c KVM: Convert intx_mask_lock to spin lock 2012-03-20 12:41:24 +02:00
async_pf.c KVM: fix the race while wakeup all pv guest 2011-01-12 11:29:03 +02:00
async_pf.h KVM: Halt vcpu if page it tries to access is swapped out 2011-01-12 11:21:39 +02:00
coalesced_mmio.c KVM: make checks stricter in coalesced_mmio_in_range() 2011-12-27 11:17:07 +02:00
coalesced_mmio.h KVM: Make coalesced mmio use a device per zone 2011-09-25 19:17:57 +03:00
eventfd.c KVM: Intelligent device lookup on I/O bus 2011-09-25 19:17:59 +03:00
ioapic.c KVM: fix race with level interrupts 2012-07-20 16:12:00 -03:00
ioapic.h KVM: fix race with level interrupts 2012-07-20 16:12:00 -03:00
iodev.h KVM: remove in_range from io devices 2009-09-10 08:33:05 +03:00
iommu.c KVM: lock slots_lock around device assignment 2012-04-19 00:04:18 -03:00
irq_comm.c KVM: fix race with level interrupts 2012-07-20 16:12:00 -03:00
Kconfig KVM: Introduce direct MSI message injection for in-kernel irqchips 2012-04-24 15:59:47 +03:00
kvm_main.c KVM: handle last_boosted_vcpu = 0 case 2012-07-06 14:11:18 -03:00