arm64: kernel: add helper for booted at EL2 and not VHE
authorPasha Tatashin <pasha.tatashin@soleen.com>
Thu, 30 Sep 2021 14:30:59 +0000 (14:30 +0000)
committerWill Deacon <will@kernel.org>
Fri, 1 Oct 2021 12:30:59 +0000 (13:30 +0100)
commit094a3684b9b67758ccedf0e6068d90f22f2942d9
tree4cea391b8e1827b9f6e29cc275f3c816b9855f11
parent5816b3e6577eaa676ceb00a848f0fd65fe2adc29
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>
arch/arm64/include/asm/virt.h
arch/arm64/kernel/cpu-reset.h
arch/arm64/kernel/hibernate.c
arch/arm64/kernel/sdei.c