diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2024-02-21 12:35:13 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2024-02-26 12:58:35 +0100 |
commit | 533568e06b157b175912a960efe5ebce8710b4f9 (patch) | |
tree | d66813cab204555f84e7eed592f03e9665100f66 /arch/x86/kernel/head_64.S | |
parent | x86/boot/64: Use RIP_REL_REF() to access early page tables (diff) | |
download | linux-533568e06b157b175912a960efe5ebce8710b4f9.tar.xz linux-533568e06b157b175912a960efe5ebce8710b4f9.zip |
x86/boot/64: Use RIP_REL_REF() to access early_top_pgt[]
early_top_pgt[] is assigned from code that executes from a 1:1 mapping
so it cannot use a plain access from C. Replace the use of
fixup_pointer() with RIP_REL_REF(), which is better and simpler.
For legibility and to align with the code that populates the lower page
table levels, statically initialize the root level page table with an
entry pointing to level3_kernel_pgt[], and overwrite it when needed to
enable 5-level paging.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240221113506.2565718-24-ardb+git@google.com
Diffstat (limited to 'arch/x86/kernel/head_64.S')
-rw-r--r-- | arch/x86/kernel/head_64.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index e09cf0b09141..d295bf68bf94 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -624,7 +624,8 @@ SYM_CODE_END(vc_no_ghcb) .balign 4 SYM_DATA_START_PTI_ALIGNED(early_top_pgt) - .fill 512,8,0 + .fill 511,8,0 + .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC .fill PTI_USER_PGD_FILL,8,0 SYM_DATA_END(early_top_pgt) |