aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/coproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kvm/coproc.c')
-rw-r--r--arch/arm/kvm/coproc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
index a629f2c1d0f9..631e6bd0e05f 100644
--- a/arch/arm/kvm/coproc.c
+++ b/arch/arm/kvm/coproc.c
@@ -74,11 +74,13 @@ int kvm_handle_cp14_access(struct kvm_vcpu *vcpu, struct kvm_run *run)
74static void reset_mpidr(struct kvm_vcpu *vcpu, const struct coproc_reg *r) 74static void reset_mpidr(struct kvm_vcpu *vcpu, const struct coproc_reg *r)
75{ 75{
76 /* 76 /*
77 * Compute guest MPIDR. No need to mess around with different clusters 77 * Compute guest MPIDR. We build a virtual cluster out of the
78 * but we read the 'U' bit from the underlying hardware directly. 78 * vcpu_id, but we read the 'U' bit from the underlying
79 * hardware directly.
79 */ 80 */
80 vcpu->arch.cp15[c0_MPIDR] = (read_cpuid_mpidr() & MPIDR_SMP_BITMASK) 81 vcpu->arch.cp15[c0_MPIDR] = ((read_cpuid_mpidr() & MPIDR_SMP_BITMASK) |
81 | vcpu->vcpu_id; 82 ((vcpu->vcpu_id >> 2) << MPIDR_LEVEL_BITS) |
83 (vcpu->vcpu_id & 3));
82} 84}
83 85
84/* TRM entries A7:4.3.31 A15:4.3.28 - RO WI */ 86/* TRM entries A7:4.3.31 A15:4.3.28 - RO WI */