]> git.ipfire.org Git - thirdparty/qemu.git/commit
apic: Defer interrupt updates to VCPU thread
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 9 Jul 2012 14:42:32 +0000 (16:42 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 21 Aug 2012 20:36:35 +0000 (15:36 -0500)
commita47343957489b9fafdb438351e8fa9d58d7fd30b
treefcf5b78d3c4b264a2b0190f0eb217a8dafcf6cc6
parent2a93a8940093560686fdcda24776ff265d6bcba7
apic: Defer interrupt updates to VCPU thread

KVM performs TPR raising asynchronously to QEMU, specifically outside
QEMU's global lock. When an interrupt is injected into the APIC and TPR
is checked to decide if this can be delivered, a stale TPR value may be
used, causing spurious interrupts in the end.

Fix this by deferring apic_update_irq to the context of the target VCPU.
We introduce a new interrupt flag for this, CPU_INTERRUPT_POLL. When it
is set, the VCPU calls apic_poll_irq before checking for further pending
interrupts. To avoid special-casing KVM, we also implement this logic
for TCG mode.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
(cherry picked from commit 5d62c43a17edaa7f6a88821c9086e6c8e0e5327d)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
cpu-exec.c
hw/apic.c
hw/apic.h
hw/apic_internal.h
target-i386/cpu.h
target-i386/kvm.c