arm64: kexec: Move the relocation to EL1
We want to start the new kexec kernel at the same exception level that
we originally booted at, but that might not be where the kernel normally
runs from.
Today cpu_soft_restart() enters the idmap and disables the MMU for
EL1, before realising it should be at EL2 and calls the hyp-stub.
This forces its prototype to be the same as the hyp-stub, which
isn't obvious.
Kexec's relocation code sets SCTLR_EL2 again, but the hyp-stub already
has the MMU disabled, so this isn't necessary.
As a pre-requisite for doing the relocation work with the MMU enabled,
move the work to EL1. Remove the HVC call from cpu_soft_restart(),
and instead make the relocation code use the hyp-stub API to start
its payload once its done the relocation.
Signed-off-by:
James Morse <james.morse@arm.com>
Loading
Please register or sign in to comment