]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: Add locking to virtual i8259 interrupt controller
authorAvi Kivity <avi@qumranet.com>
Sun, 21 Dec 2008 20:48:32 +0000 (22:48 +0200)
committerAvi Kivity <avi@redhat.com>
Mon, 22 Dec 2008 18:58:37 +0000 (20:58 +0200)
commitd5ecfdd25c412df9c0ecf3ab8e066461fd4f69df
tree6b639eb443555c06d4396bbec9fdb0cb2ba506e6
parentc7735e1385a8cf109d6ea3eb2d5d2bbd760f19e7
KVM: Add locking to virtual i8259 interrupt controller

While most accesses to the i8259 are with the kvm mutex taken, the call
to kvm_pic_read_irq() is not.  We can't easily take the kvm mutex there
since the function is called with interrupts disabled.

Fix by adding a spinlock to the virtual interrupt controller.  Since we
can't send an IPI under the spinlock (we also take the same spinlock in
an irq disabled context), we defer the IPI until the spinlock is released.
Similarly, we defer irq ack notifications until after spinlock release to
avoid lock recursion.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/i8259.c
arch/x86/kvm/irq.h