diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2022-06-24 17:06:48 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-06-24 18:18:10 +0200 |
commit | 005e12676af09a308f18cb94aa593bb30dee031e (patch) | |
tree | ba48f41b9eb2ea64d31a5efcda994ce05df5e44b /arch/arm64/mm | |
parent | arm64: head: populate kernel page tables with MMU and caches on (diff) | |
download | linux-005e12676af09a308f18cb94aa593bb30dee031e.tar.xz linux-005e12676af09a308f18cb94aa593bb30dee031e.zip |
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>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r-- | arch/arm64/mm/mmu.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index fd558cfcf3ad..05d77f2342a9 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -56,6 +56,14 @@ EXPORT_SYMBOL(kimage_vaddr); u64 kimage_voffset __ro_after_init; EXPORT_SYMBOL(kimage_voffset); +u32 __boot_cpu_mode[] = { BOOT_CPU_MODE_EL2, BOOT_CPU_MODE_EL1 }; + +/* + * The booting CPU updates the failed status @__early_cpu_boot_status, + * with MMU turned off. + */ +long __section(".mmuoff.data.write") __early_cpu_boot_status; + /* * Empty_zero_page is a special page that is used for zero-initialized data * and COW. |