Andrew Jones cbaeca8251 KVM: arm/arm64: fix races in kvm_psci_vcpu_on
commit 6c7a5dce22b3f3cc44be098e2837fa6797edb8b8 upstream.

Fix potential races in kvm_psci_vcpu_on() by taking the kvm->lock
mutex.  In general, it's a bad idea to allow more than one PSCI_CPU_ON
to process the same target VCPU at the same time.  One such problem
that may arise is that one PSCI_CPU_ON could be resetting the target
vcpu, which fills the entire sys_regs array with a temporary value
including the MPIDR register, while another looks up the VCPU based
on the MPIDR value, resulting in no target VCPU found.  Resolves both
races found with the kvm-unit-tests/arm/psci unit test.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Reported-by: Levente Kurusa <lkurusa@redhat.com>
Suggested-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-20 14:27:00 +02:00
..
2016-09-24 10:07:45 +02:00
2016-09-30 10:18:37 +02:00
2016-09-24 10:07:44 +02:00
2016-09-24 10:07:43 +02:00
2016-12-15 08:49:23 -08:00
2017-04-12 12:38:34 +02:00
2017-04-27 09:09:32 +02:00
2016-09-24 10:07:44 +02:00
2016-09-07 08:32:38 +02:00
2015-11-11 09:16:10 -08:00