mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Sasha Levin" <sashal@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>
Cc: "kernel test robot" <yi1.lai@intel.com>,
	oe-lkp@lists.linux.dev, "kernel test robot" <lkp@intel.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David Hildenbrand (Red Hat)" <david@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	"Kirill A. Shutemov" <kas@kernel.org>,
	"Finn Thain" <fthain@linux-m68k.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Dinh Nguyen" <dinguyen@kernel.org>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Gary Guo" <gary@garyguo.net>, guoren <guoren@kernel.org>,
	"Hao Luo" <haoluo@google.com>, "Jiri Olsa" <jolsa@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
	"Jonas Bonn" <jonas@southpole.se>,
	"KP Singh" <kpsingh@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Rich Felker" <dalias@libc.org>, "Song Liu" <song@kernel.org>,
	"Stafford Horne" <shorne@gmail.com>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Stefan Kristiansson" <stefan.kristiansson@saunalahti.fi>,
	"Will Deacon" <will@kernel.org>,
	"Yonghong Song" <yonghong.song@linux.dev>,
	"Yoshinori Sato" <ysato@users.sourceforge.jp>
Subject: Re: [linus:master] [atomic] 80047d84ee: WARNING:at_include/linux/instrumented.h:#__split_huge_pmd_locked
Date: Tue, 03 Nov 2026 14:41:32 +0100	[thread overview]
Message-ID: <846703eb-111c-4376-a0ba-36bd3e13f632@app.fastmail.com> (raw)
In-Reply-To: <e69e6690-cfc0-4ea8-83e1-5ad2d98b84d5@app.fastmail.com>

On Tue, Nov 3, 2026, at 14:13, Arnd Bergmann wrote:
> On Tue, Nov 3, 2026, at 13:35, Sasha Levin wrote:
>>
>> I tried the typedef change. It works, but gcc ends up realigning the
>> stack in a lot of pte/pmd code (126 more functions with Arnd's version
>> in a small config, 204 with yours), including handle_mm_fault(). Just
>> aligning the two locals seems simpler:
>
> The question is how many of the other functions may be affected by the
> same bug. I see a variation of the same code in vmemmap_split_pmd(),
> and aligning the types is clearly the safer option here, especially
> given that most 32-bit architectures already align u64 all the time
> the same way that 64-bit ones do.

FWIW, I checked the other architectures that may be affected:

- 32-bit arm has transparent hugepages and a 64-bit pmd_t with lpae,
  but that type has natural alignment, and pmd_populate is a
  simple assignment.

- arc has transparent hugepages and a 32-bit pmd_t but a 64-bit
  pte_t that is not naturally aligned. It probably should be
  aligned, even though I don't see any actual bugs

- sh has a 64-bit pmd_t on sh4a CPUs that is not naturally
  aligned and probably should be, but there are no transparent
  hugepages.

All other 32-bit targets don't use transparent hugepages
or 64-bit pmd_t. 

We probably only need to align p?d_t though, not p?dval_t.
How about the version below?

    Arnd

diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
index 9720fe6b2c24..af5303459d56 100644
--- a/arch/arc/include/asm/page.h
+++ b/arch/arc/include/asm/page.h
@@ -65,7 +65,7 @@ typedef struct {
 
 typedef struct {
 #ifdef CONFIG_ARC_HAS_PAE40
-	unsigned long long pte;
+	unsigned long long pte __aligned(8);
 #else
 	unsigned long pte;
 #endif
diff --git a/arch/sh/include/asm/pgtable-3level.h b/arch/sh/include/asm/pgtable-3level.h
index d1ce73f3bd85..6d5e2e3248f2 100644
--- a/arch/sh/include/asm/pgtable-3level.h
+++ b/arch/sh/include/asm/pgtable-3level.h
@@ -33,7 +33,7 @@ typedef union {
 		unsigned long pmd_low;
 		unsigned long pmd_high;
 	};
-	unsigned long long pmd;
+	unsigned long long pmd __aligned(8);
 } pmd_t;
 #define pmd_val(x)	((x).pmd)
 #define __pmd(x)	((pmd_t) { .pmd = (x) } )
diff --git a/arch/x86/include/asm/pgtable-3level_types.h b/arch/x86/include/asm/pgtable-3level_types.h
index 580b09bf6a45..061283293341 100644
--- a/arch/x86/include/asm/pgtable-3level_types.h
+++ b/arch/x86/include/asm/pgtable-3level_types.h
@@ -16,14 +16,14 @@ typedef union {
 	struct {
 		unsigned long pte_low, pte_high;
 	};
-	pteval_t pte;
+	pteval_t pte __aligned(8);
 } pte_t;
 
 typedef union {
 	struct {
 		unsigned long pmd_low, pmd_high;
 	};
-	pmdval_t pmd;
+	pmdval_t pmd __aligned(8);
 } pmd_t;
 #endif	/* !__ASSEMBLER__ */
 
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 2ec250ba467e..5c028b3f59c4 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -292,7 +292,7 @@ enum page_cache_mode {
 
 typedef struct pgprot { pgprotval_t pgprot; } pgprot_t;
 
-typedef struct { pgdval_t pgd; } pgd_t;
+typedef struct { pgdval_t pgd __aligned(sizeof(pgdval_t)); } pgd_t;
 
 static inline pgprot_t pgprot_nx(pgprot_t prot)
 {

  reply	other threads:[~2026-11-03 13:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  0:58 kernel test robot
2026-11-03  9:46 ` Finn Thain
2026-11-03 12:18 ` Arnd Bergmann
2026-11-03 12:26 ` Peter Zijlstra
2026-11-03 12:35   ` Sasha Levin
2026-11-03 12:56     ` Peter Zijlstra
2026-11-03 13:13     ` Arnd Bergmann
2026-11-03 13:41       ` Arnd Bergmann [this message]
2026-11-03 14:52         ` Peter Zijlstra
2026-11-03 15:43   ` Andrew Morton
2026-11-03 15:58     ` David Hildenbrand (Arm)
2026-11-03 16:29     ` Dave Hansen
2026-11-03 16:51       ` Arnd Bergmann

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=846703eb-111c-4376-a0ba-36bd3e13f632@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=ardb@kernel.org \
    --cc=ast@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=bp@alien8.de \
    --cc=dalias@libc.org \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=fthain@linux-m68k.org \
    --cc=gary@garyguo.net \
    --cc=geert@linux-m68k.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=guoren@kernel.org \
    --cc=haoluo@google.com \
    --cc=hpa@zytor.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jonas@southpole.se \
    --cc=kas@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=martin.lau@linux.dev \
    --cc=mingo@redhat.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=sashal@kernel.org \
    --cc=sdf@fomichev.me \
    --cc=shorne@gmail.com \
    --cc=song@kernel.org \
    --cc=stefan.kristiansson@saunalahti.fi \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=yi1.lai@intel.com \
    --cc=yonghong.song@linux.dev \
    --cc=ysato@users.sourceforge.jp \
    /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

all inboxes | Powered by JetHome®