arm64: head: Move all finalise_el2 calls to after __enable_mmu
authorArd Biesheuvel <ardb@kernel.org>
Wed, 11 Jan 2023 10:22:31 +0000 (11:22 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 24 Jan 2023 11:51:07 +0000 (11:51 +0000)
commit82e4958800c01daa7662362ee9543065bd14c852
treee92e68da8b1b562746e500817cde0ff5aa3b2b08
parentb7bfaa761d760e72a969d116517eaa12e404c262
arm64: head: Move all finalise_el2 calls to after __enable_mmu

In the primary boot path, finalise_el2() is called much later than on
the secondary boot or resume-from-suspend paths, and this does not
appear to be intentional.

Since we aim to do as little as possible before enabling the MMU and
caches, align secondary and resume with primary boot, and defer the call
to after the MMU is turned on. This also removes the need to clean
finalise_el2() to the PoC once we enable support for booting with the
MMU on.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20230111102236.1430401-2-ardb@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/head.S
arch/arm64/kernel/sleep.S