diff options
author | Marc Zyngier <Marc.Zyngier@arm.com> | 2013-11-05 13:29:45 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-11-06 05:10:01 -0500 |
commit | 18ea3dbc9e5c8a53a361b17c4a5676ea6f4bcb72 (patch) | |
tree | e810b44dc26c718fd52d4e8ad4f5a6d4aafe9b36 /arch/arm64/kvm/hyp-init.S | |
parent | aa62c2091129af81a172350b718eb35d5448cebc (diff) |
arm64: KVM: initialize HYP mode following the kernel endianness
Force SCTLR_EL2.EE to 1 if the kernel is compiled as BE.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kvm/hyp-init.S')
-rw-r--r-- | arch/arm64/kvm/hyp-init.S | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-init.S index ba84e6705e20..2b0244d65c16 100644 --- a/arch/arm64/kvm/hyp-init.S +++ b/arch/arm64/kvm/hyp-init.S | |||
@@ -74,7 +74,10 @@ __do_hyp_init: | |||
74 | msr mair_el2, x4 | 74 | msr mair_el2, x4 |
75 | isb | 75 | isb |
76 | 76 | ||
77 | mov x4, #SCTLR_EL2_FLAGS | 77 | mrs x4, sctlr_el2 |
78 | and x4, x4, #SCTLR_EL2_EE // preserve endianness of EL2 | ||
79 | ldr x5, =SCTLR_EL2_FLAGS | ||
80 | orr x4, x4, x5 | ||
78 | msr sctlr_el2, x4 | 81 | msr sctlr_el2, x4 |
79 | isb | 82 | isb |
80 | 83 | ||