KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 30 Nov 2017 17:00:30 +0000 (17:00 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 1 Dec 2017 07:54:41 +0000 (08:54 +0100)
commit7465894e90e5a47e0e52aa5f1f708653fc40020f
tree8b4068aa37c5e3d8f2f1daac1be42f122c2a5bf3
parent58d0d19a204604ca0da26058828a53558b265da3
KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner

vgic_set_owner acquires the irq lock without disabling interrupts,
resulting in a lockdep splat (an interrupt could fire and result
in the same lock being taken if the same virtual irq is to be
injected).

In practice, it is almost impossible to trigger this bug, but
better safe than sorry. Convert the lock acquisition to a
spin_lock_irqsave() and keep lockdep happy.

Reported-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/vgic/vgic.c