linux/arch/x86/mm
Juergen Gross 4ce385f564 x86/mm: Fix _pgd_alloc() for Xen PV mode
Recently _pgd_alloc() was switched from using __get_free_pages() to
pagetable_alloc_noprof(), which might return a compound page in case
the allocation order is larger than 0.

On x86 this will be the case if CONFIG_MITIGATION_PAGE_TABLE_ISOLATION
is set, even if PTI has been disabled at runtime.

When running as a Xen PV guest (this will always disable PTI), using
a compound page for a PGD will result in VM_BUG_ON_PGFLAGS being
triggered when the Xen code tries to pin the PGD.

Fix the Xen issue together with the not needed 8k allocation for a
PGD with PTI disabled by replacing PGD_ALLOCATION_ORDER with an
inline helper returning the needed order for PGD allocations.

Fixes: a9b3c355c2 ("asm-generic: pgalloc: provide generic __pgd_{alloc,free}")
Reported-by: Petr Vaněk <arkamar@atlas.cz>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Tested-by: Petr Vaněk <arkamar@atlas.cz>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250422131717.25724-1-jgross%40suse.com
2025-04-23 07:49:14 -07:00
..
pat cxl for v6.15 2025-04-02 20:04:43 -07:00
Makefile arch, mm: streamline HIGHMEM freeing 2025-03-17 22:06:53 -07:00
amdtopology.c mm: introduce numa_memblks 2024-09-03 21:15:30 -07:00
cpu_entry_area.c x86/cpu_entry_area: Annotate percpu_setup_exception_stacks() as __init 2024-08-25 14:29:38 +02:00
debug_pagetables.c x86/bugs: Rename CONFIG_PAGE_TABLE_ISOLATION => CONFIG_MITIGATION_PAGE_TABLE_ISOLATION 2024-01-10 10:52:28 +01:00
dump_pagetables.c - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
extable.c x86/extable: Remove unused fixup type EX_TYPE_COPY 2024-04-04 17:01:40 +02:00
fault.c x86/mm changes for v6.14: 2025-01-31 10:39:07 -08:00
hugetlbpage.c mm: drop hugetlb_get_unmapped_area{_*} functions 2024-11-06 20:11:10 -08:00
ident_map.c x86/mm/ident_map: Fix theoretical virtual address overflow to zero 2025-03-19 11:12:29 +01:00
init.c x86/mm: Check return value from memblock_phys_alloc_range() 2025-03-19 11:05:22 +01:00
init_32.c - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
init_64.c Miscellaneous x86 fixes: 2025-04-04 07:12:26 -07:00
iomap_32.c
ioremap.c - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
kasan_init_64.c tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
kaslr.c x86/kaslr: Reduce KASLR entropy on most x86 systems 2025-02-22 12:25:57 +01:00
kmmio.c x86/mm/kmmio: Remove redundant preempt_disable() 2022-12-12 10:54:48 -05:00
kmsan_shadow.c x86: kmsan: handle CPU entry area 2022-10-03 14:03:26 -07:00
maccess.c x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 2024-02-15 19:21:39 -08:00
mem_encrypt.c x86/sev: Add Secure TSC support for SNP guests 2025-01-07 20:27:23 +01:00
mem_encrypt_amd.c tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
mem_encrypt_boot.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
mem_encrypt_identity.c x86/sev updates for v6.15: 2025-03-24 22:51:23 -07:00
mm_internal.h
mmap.c x86/mm: Replace open-coded gap bounding with clamp() 2025-02-21 15:33:57 +01:00
mmio-mod.c
numa.c mm: make range-to-target_node lookup facility a part of numa_memblks 2024-09-03 21:15:32 -07:00
numa_32.c x86/mm: restore early initialization of high_memory for 32-bits 2025-03-21 22:03:17 -07:00
numa_64.c
numa_internal.h mm: introduce numa_emulation 2024-09-03 21:15:31 -07:00
pf_in.c
pf_in.h
pgprot.c
pgtable.c x86/mm: Fix _pgd_alloc() for Xen PV mode 2025-04-23 07:49:14 -07:00
pgtable_32.c
physaddr.c
physaddr.h
pkeys.c
pti.c x86/mm: Add _PAGE_NOPTISHADOW bit to avoid updating userspace page tables 2024-12-05 13:04:00 +01:00
srat.c x86/mm: Don't print out SRAT table information 2024-08-08 17:23:40 +02:00
testmmiotrace.c x86/mm: add testmmiotrace MODULE_DESCRIPTION() 2024-09-01 20:43:31 -07:00
tlb.c x86/bugs: Don't fill RSB on context switch with eIBRS 2025-04-09 12:42:09 +02:00