x86/startup_64: Defer assignment of 5-level paging global variables
authorArd Biesheuvel <ardb@kernel.org>
Tue, 27 Feb 2024 15:19:10 +0000 (16:19 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 4 Mar 2024 17:12:06 +0000 (18:12 +0100)
commit63bed96604205fa0b23c91d268df5f1f1b26faf6
treef4b4bd2f7a30c419b63c2d8f775876516d3b2680
parentdada8587068c820ba5e5d09b9c32d8bc28c4dbe6
x86/startup_64: Defer assignment of 5-level paging global variables

Assigning the 5-level paging related global variables from the earliest
C code using explicit references that use the 1:1 translation of memory
is unnecessary, as the startup code itself does not rely on them to
create the initial page tables, and this is all it should be doing. So
defer these assignments to the primary C entry code that executes via
the ordinary kernel virtual mapping.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240227151907.387873-13-ardb+git@google.com
arch/x86/include/asm/pgtable_64_types.h
arch/x86/kernel/head64.c