]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: Fix vgic init race
authorChristoffer Dall <christoffer.dall@arm.com>
Tue, 3 Jul 2018 20:54:14 +0000 (22:54 +0200)
committerMarc Zyngier <marc.zyngier@arm.com>
Sat, 21 Jul 2018 15:02:07 +0000 (16:02 +0100)
commite3d6c6e8ff89d3b871d3ebea80c6464cabee0ad0
tree2595c1920c0bda904e609e1d504afca86f7d2963
parent61618b0dd5c0f3c26fa4b0e4d2b8b781475c28bf
KVM: arm/arm64: Fix vgic init race

The vgic_init function can race with kvm_arch_vcpu_create() which does
not hold kvm_lock() and we therefore have no synchronization primitives
to ensure we're doing the right thing.

As the user is trying to initialize or run the VM while at the same time
creating more VCPUs, we just have to refuse to initialize the VGIC in
this case rather than silently failing with a broken VCPU.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/vgic/vgic-init.c