From: Ard Biesheuvel Date: Sun, 4 May 2025 09:52:32 +0000 (+0200) Subject: x86/boot: Disregard __supported_pte_mask in __startup_64() X-Git-Tag: v6.16-rc1~195^2~30^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3464a36f7f2499d517e8334e07ddd6eefcd67c1;p=thirdparty%2Fkernel%2Flinux.git x86/boot: Disregard __supported_pte_mask in __startup_64() __supported_pte_mask is statically initialized to U64_MAX and never assigned until long after the startup code executes that creates the initial page tables. So applying the mask is unnecessary, and can be avoided. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: Arnd Bergmann Cc: David Woodhouse Cc: Dionna Amalie Glaze Cc: H. Peter Anvin Cc: Kees Cook Cc: Kevin Loughlin Cc: Len Brown Cc: Linus Torvalds Cc: Rafael J. Wysocki Cc: Tom Lendacky Cc: linux-efi@vger.kernel.org Link: https://lore.kernel.org/r/20250504095230.2932860-27-ardb+git@google.com --- diff --git a/arch/x86/boot/startup/map_kernel.c b/arch/x86/boot/startup/map_kernel.c index 0eac3f17dbd3f..099ae25593361 100644 --- a/arch/x86/boot/startup/map_kernel.c +++ b/arch/x86/boot/startup/map_kernel.c @@ -179,8 +179,6 @@ unsigned long __head __startup_64(unsigned long p2v_offset, pud[(i + 1) % PTRS_PER_PUD] = (pudval_t)pmd + pgtable_flags; pmd_entry = __PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL; - /* Filter out unsupported __PAGE_KERNEL_* bits: */ - pmd_entry &= __supported_pte_mask; pmd_entry += sme_get_me_mask(); pmd_entry += physaddr;