[ Upstream commit 1d47191de7e15900f8fbfe7cccd7c6e1c2d7c31a ]
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 <firstname.lastname@example.org>
Signed-off-by: Christoffer Dall <email@example.com>
Signed-off-by: Marc Zyngier <firstname.lastname@example.org>
Signed-off-by: Sasha Levin <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>