arm64: head: record CPU boot mode after enabling the MMU
authorArd Biesheuvel <ardb@kernel.org>
Fri, 24 Jun 2022 15:06:48 +0000 (17:06 +0200)
committerWill Deacon <will@kernel.org>
Fri, 24 Jun 2022 16:18:10 +0000 (17:18 +0100)
commit005e12676af09a308f18cb94aa593bb30dee031e
treeba48f41b9eb2ea64d31a5efcda994ce05df5e44b
parent6495b9ba62711b581680fbdd90d0bfc48cf5c91b
arm64: head: record CPU boot mode after enabling the MMU

In order to avoid having to touch memory with the MMU and caches
disabled, and therefore having to invalidate it from the caches
explicitly, just defer storing the value until after the MMU has been
turned on, unless we are giving up with an error.

While at it, move the associated variable definitions into C code.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220624150651.1358849-19-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/head.S
arch/arm64/kernel/hyp-stub.S
arch/arm64/mm/mmu.c