]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: Simplify active_change_prepare and plug race
authorChristoffer Dall <cdall@linaro.org>
Sat, 6 May 2017 18:01:24 +0000 (20:01 +0200)
committerChristoffer Dall <cdall@linaro.org>
Tue, 23 May 2017 10:48:22 +0000 (12:48 +0200)
commit1a2b9b8b4292e38c344461fe58cc26b32a86c84d
treee50cebd5e9f2e9386da1b39e7bfbc6138cd72b4b
parent90725e19219964609967c633a1f39078934a02d1
KVM: arm/arm64: Simplify active_change_prepare and plug race

We don't need to stop a specific VCPU when changing the active state,
because private IRQs can only be modified by a running VCPU for the
VCPU itself and it is therefore already stopped.

However, it is also possible for two VCPUs to be modifying the active
state of SPIs at the same time, which can cause the thread being stuck
in the loop that checks other VCPU threads for a potentially very long
time, or to modify the active state of a running VCPU.  Fix this by
serializing all accesses to setting and clearing the active state of
interrupts using the KVM mutex.

Reported-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_host.h
virt/kvm/arm/arm.c
virt/kvm/arm/vgic/vgic-mmio.c
virt/kvm/arm/vgic/vgic.c