aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2013-11-05 09:12:15 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2013-11-07 14:09:08 -0500
commitce94fe93d566bf381c6ecbd45010d36c5f04d692 (patch)
tree964abbc8b5f43d94543a053cfaa2c7e1b3fc71f5 /arch/arm/kvm
parent6d89d2d9b5bac9dbe40ee106ceda9307b6265234 (diff)
arm/arm64: KVM: PSCI: propagate caller endianness to the incoming vcpu
When booting a vcpu using PSCI, make sure we start it with the endianness of the caller. Otherwise, secondaries can be pretty unhappy to execute a BE kernel in LE mode... This conforms to PSCI spec Rev B, 5.13.3. Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/psci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c
index 86a693a02ba3..ae0e06b6a492 100644
--- a/arch/arm/kvm/psci.c
+++ b/arch/arm/kvm/psci.c
@@ -62,6 +62,10 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu)
62 vcpu_set_thumb(vcpu); 62 vcpu_set_thumb(vcpu);
63 } 63 }
64 64
65 /* Propagate caller endianness */
66 if (kvm_vcpu_is_be(source_vcpu))
67 kvm_vcpu_set_be(vcpu);
68
65 *vcpu_pc(vcpu) = target_pc; 69 *vcpu_pc(vcpu) = target_pc;
66 vcpu->arch.pause = false; 70 vcpu->arch.pause = false;
67 smp_mb(); /* Make sure the above is visible */ 71 smp_mb(); /* Make sure the above is visible */