From: Oscar Salvador <osalvador@suse.de>
To: Jann Horn <jannh@google.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Muchun Song <muchun.song@linux.dev>,
Vitaly Chikunov <vt@altlinux.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Dave Hansen <dave.hansen@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v2] x86/mm: Disable hugetlb page table sharing on 32-bit
Date: Wed, 2 Jul 2025 10:50:24 +0200 [thread overview]
Message-ID: <aGTy0GPyc5o_uDgq@localhost.localdomain> (raw)
In-Reply-To: <20250702-x86-2level-hugetlb-v2-1-1a98096edf92@google.com>
On Wed, Jul 02, 2025 at 10:32:04AM +0200, Jann Horn wrote:
> 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.)
>
> Reported-by: Vitaly Chikunov <vt@altlinux.org>
> Closes: https://lore.kernel.org/r/srhpjxlqfna67blvma5frmy3aa@altlinux.org
> Suggested-by: Dave Hansen <dave.hansen@intel.com>
> Tested-by: Vitaly Chikunov <vt@altlinux.org>
> Fixes: cfe28c5d63d8 ("x86: mm: Remove x86 version of huge_pmd_share.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jann Horn <jannh@google.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
Thanks!
--
Oscar Salvador
SUSE Labs
next prev parent reply other threads:[~2025-07-02 8:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 8:32 Jann Horn
2025-07-02 8:50 ` Oscar Salvador [this message]
2025-07-04 14:20 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aGTy0GPyc5o_uDgq@localhost.localdomain \
--to=osalvador@suse.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=muchun.song@linux.dev \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=vt@altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox