[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <07b62c4e-d3e7-dcc6-8752-0780faaeec24@linux-m68k.org>
Date: Tue, 6 Jan 2026 08:22:26 +1100 (AEDT)
From: Finn Thain <fthain@...ux-m68k.org>
To: Peter Zijlstra <peterz@...radead.org>
cc: Andrew Morton <akpm@...ux-foundation.org>, Will Deacon <will@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>, Mark Rutland <mark.rutland@....com>,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-m68k@...ts.linux-m68k.org, Sasha Levin <sashal@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org, Ard Biesheuvel <ardb@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, linux-efi@...r.kernel.org
Subject: Re: [PATCH v6 3/4] atomic: Add alignment check to instrumented atomic
operations
On Mon, 5 Jan 2026, Peter Zijlstra wrote:
> On Wed, Dec 31, 2025 at 07:25:42PM +1100, Finn Thain wrote:
> > From: Peter Zijlstra <peterz@...radead.org>
> >
> > Add a Kconfig option for debug builds which logs a warning when an
> > instrumented atomic operation takes place that's misaligned.
> > Some platforms don't trap for this.
> >
> > [fthain: added __DISABLE_BUG_TABLE macro.]
> >
> > Cc: Sasha Levin <sashal@...nel.org>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: Ingo Molnar <mingo@...hat.com>
> > Cc: Borislav Petkov <bp@...en8.de>
> > Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> > Cc: x86@...nel.org
> > Cc: Ard Biesheuvel <ardb@...nel.org>
> > Cc: "H. Peter Anvin" <hpa@...or.com>
> > Link: https://lore.kernel.org/lkml/20250901093600.GF4067720@noisy.programming.kicks-ass.net/
> > Link: https://lore.kernel.org/linux-next/df9fbd22-a648-ada4-fee0-68fe4325ff82@linux-m68k.org/
> > Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
> > ---
> > Checkpatch.pl says...
> > ERROR: Missing Signed-off-by: line by nominal patch author 'Peter Ziljstra <peterz@...radead.org>'
> > ---
> > Changed since v5:
> > - Add new __DISABLE_BUG_TABLE macro to prevent a build failure on those
> > architectures which use atomics in pre-boot code like the EFI stub loader:
> >
> > x86_64-linux-gnu-ld: error: unplaced orphan section `__bug_table' from `arch/x86/boot/compressed/sev-handle-vc.o'
>
> Urgh, so why not simply use __DISABLE_EXPORTS, that's typically (ab)used
> for these things?
>
OK, I'll change it back to __DISABLE_EXPORTS.
> Also, unless __DISABLE_BUG_TABLE goes live inside asm/bug.h and kills
> all __bug_table emissions, its a misnomer.
>
Yes, __DISABLE_BUG_TABLE is certainly a misnomer, since what it actually
does is to elide code that would emit bug table entries. I would argue
that this distinction is splitting hairs but it's moot.
> Furthermore, that SEV thing is broken and needs to be fixed anyway, this
> isn't helping it much. noinstr code should not be using instrumented
> things to begin with.
>
The problem is not confined to x86. I needed something that would work for
loongarch, arm, riscv etc.
Anyway, thanks for your review. I will make the necessary changes.
Powered by blists - more mailing lists