Skip to content
Commit 3f353858 authored by Avi Kivity's avatar Avi Kivity Committed by Avi Kivity
Browse files

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: default avatarAvi Kivity <avi@redhat.com>
parent 25e23432
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment