aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorJonathan Austin <jonathan.austin@arm.com>2013-09-26 11:49:27 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2013-10-12 20:44:39 -0400
commit1158fca401e09665c440a9fe4fd4f131ee85c13b (patch)
tree85f1e2c1147fde717ddae7823174dfa92ce9baae /arch/arm/kvm
parent740edfc0a35dd688c97ae8907c4377df49219bf3 (diff)
KVM: ARM: Fix calculation of virtual CPU ID
KVM does not have a notion of multiple clusters for CPUs, just a linear array of CPUs. When using a system with cores in more than one cluster, the current method for calculating the virtual MPIDR will leak the (physical) cluster information into the virtual MPIDR. One effect of this is that Linux under KVM fails to boot multiple CPUs that aren't in the 0th cluster. This patch does away with exposing the real MPIDR fields in favour of simply using the virtual CPU number (but preserving the U bit, as before). Signed-off-by: Jonathan Austin <jonathan.austin@arm.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/coproc_a15.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/arm/kvm/coproc_a15.c b/arch/arm/kvm/coproc_a15.c
index cf93472b9dd6..bbd4b888dbf3 100644
--- a/arch/arm/kvm/coproc_a15.c
+++ b/arch/arm/kvm/coproc_a15.c
@@ -27,14 +27,11 @@
27static void reset_mpidr(struct kvm_vcpu *vcpu, const struct coproc_reg *r) 27static void reset_mpidr(struct kvm_vcpu *vcpu, const struct coproc_reg *r)
28{ 28{
29 /* 29 /*
30 * Compute guest MPIDR: 30 * Compute guest MPIDR. No need to mess around with different clusters
31 * (Even if we present only one VCPU to the guest on an SMP 31 * but we read the 'U' bit from the underlying hardware directly.
32 * host we don't set the U bit in the MPIDR, or vice versa, as
33 * revealing the underlying hardware properties is likely to
34 * be the best choice).
35 */ 32 */
36 vcpu->arch.cp15[c0_MPIDR] = (read_cpuid_mpidr() & ~MPIDR_LEVEL_MASK) 33 vcpu->arch.cp15[c0_MPIDR] = (read_cpuid_mpidr() & MPIDR_SMP_BITMASK)
37 | (vcpu->vcpu_id & MPIDR_LEVEL_MASK); 34 | vcpu->vcpu_id;
38} 35}
39 36
40#include "coproc.h" 37#include "coproc.h"