diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2022-06-24 17:06:48 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-06-24 17:18:10 +0100 |
commit | 005e12676af09a308f18cb94aa593bb30dee031e (patch) | |
tree | ba48f41b9eb2ea64d31a5efcda994ce05df5e44b /arch/arm64/kernel/hyp-stub.S | |
parent | 6495b9ba62711b581680fbdd90d0bfc48cf5c91b (diff) | |
download | linux-005e12676af09a308f18cb94aa593bb30dee031e.tar.bz2 |
arm64: head: record CPU boot mode after enabling the MMU
In order to avoid having to touch memory with the MMU and caches
disabled, and therefore having to invalidate it from the caches
explicitly, just defer storing the value until after the MMU has been
turned on, unless we are giving up with an error.
While at it, move the associated variable definitions into C code.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220624150651.1358849-19-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/hyp-stub.S')
-rw-r--r-- | arch/arm64/kernel/hyp-stub.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S index 43d212618834..5bafb53fafb4 100644 --- a/arch/arm64/kernel/hyp-stub.S +++ b/arch/arm64/kernel/hyp-stub.S @@ -223,11 +223,11 @@ SYM_FUNC_END(__hyp_reset_vectors) /* * Entry point to switch to VHE if deemed capable + * + * w0: boot mode, as returned by init_kernel_el() */ SYM_FUNC_START(switch_to_vhe) // Need to have booted at EL2 - adr_l x1, __boot_cpu_mode - ldr w0, [x1] cmp w0, #BOOT_CPU_MODE_EL2 b.ne 1f |