[<prev] [next>] [day] [month] [year] [list]
Message-ID: <175207623080.406.17185038526436313265.tip-bot2@tip-bot2>
Date: Wed, 09 Jul 2025 15:50:30 -0000
From: "tip-bot2 for Jann Horn" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Vitaly Chikunov <vt@...linux.org>, Dave Hansen <dave.hansen@...el.com>,
Jann Horn <jannh@...gle.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
Oscar Salvador <osalvador@...e.de>, David Hildenbrand <david@...hat.com>,
stable@...r.kernel.org, x86@...nel.org, linux-kernel@...r.kernel.org
Subject:
[tip: x86/urgent] x86/mm: Disable hugetlb page table sharing on 32-bit
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 76303ee8d54bff6d9a6d55997acd88a6c2ba63cf
Gitweb: https://git.kernel.org/tip/76303ee8d54bff6d9a6d55997acd88a6c2ba63cf
Author: Jann Horn <jannh@...gle.com>
AuthorDate: Wed, 02 Jul 2025 10:32:04 +02:00
Committer: Dave Hansen <dave.hansen@...ux.intel.com>
CommitterDate: Wed, 09 Jul 2025 07:46:36 -07:00
x86/mm: Disable hugetlb page table sharing on 32-bit
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: cfe28c5d63d8 ("x86: mm: Remove x86 version of huge_pmd_share.")
Reported-by: Vitaly Chikunov <vt@...linux.org>
Suggested-by: Dave Hansen <dave.hansen@...el.com>
Signed-off-by: Jann Horn <jannh@...gle.com>
Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
Acked-by: Oscar Salvador <osalvador@...e.de>
Acked-by: David Hildenbrand <david@...hat.com>
Tested-by: Vitaly Chikunov <vt@...linux.org>
Cc:stable@...r.kernel.org
Link: https://lore.kernel.org/all/20250702-x86-2level-hugetlb-v2-1-1a98096edf92%40google.com
---
arch/x86/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 71019b3..4e0fe68 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -147,7 +147,7 @@ config X86
select ARCH_WANTS_DYNAMIC_TASK_STRUCT
select ARCH_WANTS_NO_INSTR
select ARCH_WANT_GENERAL_HUGETLB
- select ARCH_WANT_HUGE_PMD_SHARE
+ select ARCH_WANT_HUGE_PMD_SHARE if X86_64
select ARCH_WANT_LD_ORPHAN_WARN
select ARCH_WANT_OPTIMIZE_DAX_VMEMMAP if X86_64
select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP if X86_64
Powered by blists - more mailing lists