android_kernel_motorola_sm6375/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jann Horn b2fdd7f1b6 x86/mm: Disable hugetlb page table sharing on 32-bit
commit 76303ee8d54bff6d9a6d55997acd88a6c2ba63cf 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
59d9094df3d7 ("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:25:06 +02:00
..
alpha alpha: replace hardcoded stack offsets with autogenerated ones 2025-03-13 12:43:18 +01:00
arc ARC: build: Try to guess GCC variant of cross compiler 2025-01-09 13:23:36 +01:00
arm ARM: dts: am335x-bone-common: Increase MDIO reset deassert delay to 50ms 2025-06-27 11:02:57 +01:00
arm64 arm64: Restrict pagetable teardown to avoid false warning 2025-07-17 18:24:55 +02:00
c6x
csky
h8300
hexagon hexagon: Fix unbalanced spinlock in die() 2025-03-13 12:43:01 +01:00
ia64
m68k m68k: mac: Fix macintosh_config for Mac II 2025-06-27 11:02:45 +01:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-11-08 16:20:25 +01:00
mips mips: Add -std= flag specified in KBUILD_CFLAGS to vdso CFLAGS 2025-06-27 11:02:52 +01:00
nds32
nios2 nios2: force update_mmu_cache on spurious tlb-permission--related pagefaults 2025-06-27 11:02:54 +01:00
openrisc openrisc: Call setup_memory() earlier in the init sequence 2024-09-04 13:14:57 +02:00
parisc parisc: fix building with gcc-15 2025-06-27 11:02:51 +01:00
powerpc powerpc: Fix struct termio related ioctl macros 2025-07-17 18:24:57 +02:00
riscv riscv: Avoid fortify warning in syscall_get_arguments() 2025-05-02 07:39:20 +02:00
s390 s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS 2025-07-17 18:24:55 +02:00
sh sh: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2024-12-14 19:44:37 +01:00
sparc sparc/mm: disable preemption in lazy mmu mode 2025-05-02 07:39:16 +02:00
um um: ubd: Add missing error check in start_io_thread() 2025-07-17 18:24:53 +02:00
unicore32
x86 x86/mm: Disable hugetlb page table sharing on 32-bit 2025-07-17 18:25:06 +02:00
xtensa
.gitignore
Kconfig