Skip to content
Commit 240cc75e authored by James Morse's avatar James Morse
Browse files

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's avatarJames Morse <james.morse@arm.com>
parent c308812a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment