summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/sleep.S
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-02-08 09:57:14 +0000
committerWill Deacon <will@kernel.org>2021-02-09 13:47:07 +0000
commit0c93df9622d4d921bcd0dc83f71fed9e98f5119f (patch)
tree73019ad94842d05353ba18096698a48be9e38631 /arch/arm64/kernel/sleep.S
parentf359182291c757cdf77bcd014c025d1ed6b87662 (diff)
downloadlinux-0c93df9622d4d921bcd0dc83f71fed9e98f5119f.tar.gz
linux-0c93df9622d4d921bcd0dc83f71fed9e98f5119f.tar.bz2
linux-0c93df9622d4d921bcd0dc83f71fed9e98f5119f.zip
arm64: Initialise as nVHE before switching to VHE
As we are aiming to be able to control whether we enable VHE or not, let's always drop down to EL1 first, and only then upgrade to VHE if at all possible. This means that if the kernel is booted at EL2, we always start with a nVHE init, drop to EL1 to initialise the the kernel, and only then upgrade the kernel EL to EL2 if possible (the process is obviously shortened for secondary CPUs). The resume path is handled similarly to a secondary CPU boot. Signed-off-by: Marc Zyngier <maz@kernel.org> Acked-by: David Brazdil <dbrazdil@google.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20210208095732.3267263-6-maz@kernel.org [will: Avoid calling switch_to_vhe twice on kaslr path] Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/sleep.S')
-rw-r--r--arch/arm64/kernel/sleep.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
index 6bdef7362c0e..5bfd9b87f85d 100644
--- a/arch/arm64/kernel/sleep.S
+++ b/arch/arm64/kernel/sleep.S
@@ -100,6 +100,7 @@ SYM_FUNC_END(__cpu_suspend_enter)
.pushsection ".idmap.text", "awx"
SYM_CODE_START(cpu_resume)
bl init_kernel_el
+ bl switch_to_vhe
bl __cpu_setup
/* enable the MMU early - so we can access sleep_save_stash by va */
adrp x1, swapper_pg_dir