linux-yocto/arch/x86
Jann Horn 3c0994a3fd x86/mm: Disable hugetlb page table sharing on 32-bit
commit 76303ee8d5 upstream.

Only select ARCH_WANT_HUGE_PMD_SHARE on 64-bit x86.
Page table sharing requires at least three levels because it involves
shared references to PMD tables; 32-bit x86 has either two-level paging
(without PAE) or three-level paging (with PAE), but even with
three-level paging, having a dedicated PGD entry for hugetlb is only
barely possible (because the PGD only has four entries), and it seems
unlikely anyone's actually using PMD sharing on 32-bit.

Having ARCH_WANT_HUGE_PMD_SHARE enabled on non-PAE 32-bit X86 (which
has 2-level paging) became particularly problematic after commit
59d9094df3 ("mm: hugetlb: independent PMD page table shared count"),
since that changes `struct ptdesc` such that the `pt_mm` (for PGDs) and
the `pt_share_count` (for PMDs) share the same union storage - and with
2-level paging, PMDs are PGDs.

(For comparison, arm64 also gates ARCH_WANT_HUGE_PMD_SHARE on the
configuration of page tables such that it is never enabled with 2-level
paging.)

Closes: https://lore.kernel.org/r/srhpjxlqfna67blvma5frmy3aa@altlinux.org
Fixes: cfe28c5d63 ("x86: mm: Remove x86 version of huge_pmd_share.")
Reported-by: Vitaly Chikunov <vt@altlinux.org>
Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
Acked-by: David Hildenbrand <david@redhat.com>
Tested-by: Vitaly Chikunov <vt@altlinux.org>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250702-x86-2level-hugetlb-v2-1-1a98096edf92%40google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-17 18:35:15 +02:00
..
boot x86/build: Fix broken copy command in genimage.sh when making isoimage 2025-06-04 14:42:05 +02:00
coco x86/tdx: Fix arch_safe_halt() execution for TDX VMs 2025-04-25 10:45:55 +02:00
configs
crypto crypto: x86/aegis128 - access 32-bit arguments as 32-bit 2024-12-09 10:32:43 +01:00
entry x86/bugs: Rename MDS machinery to something more generic 2025-07-10 16:03:21 +02:00
events perf/amd/ibs: Fix ->config to sample period calculation for OP PMU 2025-06-04 14:42:14 +02:00
hyperv x86/hyperv: Fix check of return value from snp_set_vmsa() 2025-04-10 14:37:41 +02:00
ia32
include x86/rdrand: Disable RDSEED on AMD Cyan Skillfish 2025-07-17 18:35:15 +02:00
kernel x86/rdrand: Disable RDSEED on AMD Cyan Skillfish 2025-07-17 18:35:15 +02:00
kvm KVM: SVM: Reject SEV{-ES} intra host migration if vCPU creation is in-flight 2025-07-17 18:35:12 +02:00
lib x86/its: Add support for ITS-safe return thunk 2025-05-18 08:24:11 +02:00
math-emu
mm x86/mm/init: Handle the special case of device private pages in add_pages(), to not increase max_pfn and trigger dma_addressing_limited() bounce buffers bounce buffers 2025-06-04 14:42:21 +02:00
net x86/its: FineIBT-paranoid vs ITS 2025-05-18 08:24:12 +02:00
pci PCI: Avoid putting some root ports into D3 on TUXEDO Sirius Gen1 2025-02-17 09:40:26 +01:00
platform x86/pvh: Call C code via the kernel virtual mapping 2025-05-02 07:51:02 +02:00
power
purgatory
ras
realmode
tools x86/tools: Drop duplicate unlikely() definition in insn_decoder_test.c 2025-07-06 11:00:16 +02:00
um um: Add cmpxchg8b_emu and checksum functions to asm-prototypes.h 2025-07-06 11:00:07 +02:00
video
virt/vmx/tdx x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure 2024-12-09 10:32:19 +01:00
xen x86/xen: fix memblock_reserve() usage on PVH 2025-04-25 10:45:55 +02:00
.gitignore
Kbuild
Kconfig x86/mm: Disable hugetlb page table sharing on 32-bit 2025-07-17 18:35:15 +02:00
Kconfig.assembler x86/kconfig: Add as-instr64 macro to properly evaluate AS_WRUSS 2024-08-03 08:53:21 +02:00
Kconfig.cpu
Kconfig.debug
Makefile x86/boot: Compile boot code with -std=gnu11 too 2025-06-04 14:42:21 +02:00
Makefile_32.cpu
Makefile.postlink
Makefile.um