diff options
author | Pasha Tatashin <pasha.tatashin@soleen.com> | 2021-09-30 16:30:59 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-10-01 14:30:59 +0200 |
commit | 094a3684b9b67758ccedf0e6068d90f22f2942d9 (patch) | |
tree | 4cea391b8e1827b9f6e29cc275f3c816b9855f11 /arch/arm64/kernel/cpu-reset.h | |
parent | Linux 5.15-rc3 (diff) | |
download | linux-094a3684b9b67758ccedf0e6068d90f22f2942d9.tar.xz linux-094a3684b9b67758ccedf0e6068d90f22f2942d9.zip |
arm64: kernel: add helper for booted at EL2 and not VHE
Replace places that contain logic like this:
is_hyp_mode_available() && !is_kernel_in_hyp_mode()
With a dedicated boolean function is_hyp_nvhe(). This will be needed
later in kexec in order to sooner switch back to EL2.
Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210930143113.1502553-2-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/cpu-reset.h')
-rw-r--r-- | arch/arm64/kernel/cpu-reset.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm64/kernel/cpu-reset.h b/arch/arm64/kernel/cpu-reset.h index 9a7b1262ef17..81b3d0fe7a63 100644 --- a/arch/arm64/kernel/cpu-reset.h +++ b/arch/arm64/kernel/cpu-reset.h @@ -20,8 +20,7 @@ static inline void __noreturn __nocfi cpu_soft_restart(unsigned long entry, { typeof(__cpu_soft_restart) *restart; - unsigned long el2_switch = !is_kernel_in_hyp_mode() && - is_hyp_mode_available(); + unsigned long el2_switch = is_hyp_nvhe(); restart = (void *)__pa_symbol(function_nocfi(__cpu_soft_restart)); cpu_install_idmap(); |