]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/boot: Disregard __supported_pte_mask in __startup_64()
authorArd Biesheuvel <ardb@kernel.org>
Sun, 4 May 2025 09:52:32 +0000 (11:52 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 4 May 2025 13:27:23 +0000 (15:27 +0200)
__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 <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Dionna Amalie Glaze <dionnaglaze@google.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kevin Loughlin <kevinloughlin@google.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-efi@vger.kernel.org
Link: https://lore.kernel.org/r/20250504095230.2932860-27-ardb+git@google.com
arch/x86/boot/startup/map_kernel.c

index 0eac3f17dbd3f93c724277c487b0d57e5b482b31..099ae25593361aa2c5fd4550aff34f8f65520276 100644 (file)
@@ -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;