Skip to content

Commit

Permalink
arm64: KVM: initialize HYP mode following the kernel endianness
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Zyngier authored and Catalin Marinas committed Nov 6, 2013
1 parent aa62c20 commit 18ea3db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/arm64/kvm/hyp-init.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ __do_hyp_init:
msr mair_el2, x4
isb

mov x4, #SCTLR_EL2_FLAGS
mrs x4, sctlr_el2
and x4, x4, #SCTLR_EL2_EE // preserve endianness of EL2
ldr x5, =SCTLR_EL2_FLAGS
orr x4, x4, x5
msr sctlr_el2, x4
isb

Expand Down

0 comments on commit 18ea3db

Please sign in to comment.