arm64: Initialise as nVHE before switching to VHE
authorMarc Zyngier <maz@kernel.org>
Mon, 8 Feb 2021 09:57:14 +0000 (09:57 +0000)
committerWill Deacon <will@kernel.org>
Tue, 9 Feb 2021 13:47:07 +0000 (13:47 +0000)
commit0c93df9622d4d921bcd0dc83f71fed9e98f5119f
tree73019ad94842d05353ba18096698a48be9e38631
parentf359182291c757cdf77bcd014c025d1ed6b87662
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>
arch/arm64/kernel/head.S
arch/arm64/kernel/hyp-stub.S
arch/arm64/kernel/sleep.S