diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2013-11-05 09:12:15 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2013-11-07 14:09:08 -0500 |
commit | ce94fe93d566bf381c6ecbd45010d36c5f04d692 (patch) | |
tree | 964abbc8b5f43d94543a053cfaa2c7e1b3fc71f5 /arch/arm64 | |
parent | 6d89d2d9b5bac9dbe40ee106ceda9307b6265234 (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/arm64')
-rw-r--r-- | arch/arm64/include/asm/kvm_emulate.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index b016577e37a4..db805092698c 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h | |||
@@ -177,6 +177,14 @@ static inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu) | |||
177 | return kvm_vcpu_get_hsr(vcpu) & ESR_EL2_FSC_TYPE; | 177 | return kvm_vcpu_get_hsr(vcpu) & ESR_EL2_FSC_TYPE; |
178 | } | 178 | } |
179 | 179 | ||
180 | static inline void kvm_vcpu_set_be(struct kvm_vcpu *vcpu) | ||
181 | { | ||
182 | if (vcpu_mode_is_32bit(vcpu)) | ||
183 | *vcpu_cpsr(vcpu) |= COMPAT_PSR_E_BIT; | ||
184 | else | ||
185 | vcpu_sys_reg(vcpu, SCTLR_EL1) |= (1 << 25); | ||
186 | } | ||
187 | |||
180 | static inline bool kvm_vcpu_is_be(struct kvm_vcpu *vcpu) | 188 | static inline bool kvm_vcpu_is_be(struct kvm_vcpu *vcpu) |
181 | { | 189 | { |
182 | if (vcpu_mode_is_32bit(vcpu)) | 190 | if (vcpu_mode_is_32bit(vcpu)) |