arm64: head: Run feature override detection before mapping the kernel

To permit the feature overrides to be taken into account before the
KASLR init code runs and the kernel mapping is created, move the
detection code to an earlier stage in the boot.

In a subsequent patch, this will be taken advantage of by merging the
preliminary and permanent mappings of the kernel text and data into a
single one that gets created and relocated before start_kernel() is
called.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240214122845.2033971-53-ardb+git@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
Ard Biesheuvel
2024-02-14 13:28:54 +01:00
committed by Catalin Marinas
parent 30687dec5e
commit dcfe969a64
2 changed files with 10 additions and 11 deletions

View File

@@ -320,10 +320,8 @@ SECTIONS
init_pg_end = .;
/* end of zero-init region */
#ifdef CONFIG_RELOCATABLE
. += SZ_4K; /* stack for the early relocation code */
. += SZ_4K; /* stack for the early C runtime */
early_init_stack = .;
#endif
. = ALIGN(SEGMENT_ALIGN);
__pecoff_data_size = ABSOLUTE(. - __initdata_begin);