3
0
Fork 0
forked from mirrors/linux
kernel/arch/x86/platform/efi
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
..
efi.c x86/efistub: Drop long obsolete UGA support 2025-01-14 08:34:24 +01:00
efi_32.c efi/x86: Move EFI runtime call setup/teardown helpers out of line 2023-09-11 06:37:50 +00:00
efi_64.c x86/mm: Fix _pgd_alloc() for Xen PV mode 2025-04-23 07:49:14 -07:00
efi_stub_32.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
efi_stub_64.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
efi_thunk_64.S efi/x86-mixed: move unmitigated RET into .rodata 2022-08-16 09:28:05 +02:00
Makefile x86/efi: Drop support for fake EFI memory maps 2024-07-02 00:26:24 +02:00
memmap.c x86/efi: Drop support for fake EFI memory maps 2024-07-02 00:26:24 +02:00
quirks.c x86/efi: skip memattr table on kexec boot 2025-01-23 09:58:43 +01:00
runtime-map.c efi: x86: make kobj_type structure constant 2023-05-10 19:00:40 +02:00