]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/mm: Always allocate a whole page for PAE PGDs
authorDave Hansen <dave.hansen@linux.intel.com>
Mon, 14 Apr 2025 17:32:34 +0000 (10:32 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Thu, 17 Apr 2025 17:39:24 +0000 (10:39 -0700)
commit780f97e309302fdee05b31c91a4dc81ded4c3702
tree4811e308b4c500083768270ac1e7cc18417cadd8
parent35c3151a98a6e6f56552cff8dc7d59e8ef7aca50
x86/mm: Always allocate a whole page for PAE PGDs

A hardware PAE PGD is only 32 bytes. A PGD is PAGE_SIZE in the other
paging modes. But for reasons*, the kernel _sometimes_ allocates a
whole page even though it only ever uses 32 bytes.

Make PAE less weird. Just allocate a page like the other paging modes.
This was already being done for PTI (and Xen in the past) and nobody
screamed that loudly about it so it can't be that bad.

 * The original reason for PAGE_SIZE allocations for the PAE PGDs was
   Xen's need to detect page table writes. But 32-bit PTI forced it too
   for reasons I'm unclear about.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20250414173234.D34F0C3E%40davehans-spike.ostc.intel.com
arch/x86/mm/pgtable.c