public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Finn Thain <fthain@linux-m68k•org>
To: Sasha Levin <sashal@kernel•org>
Cc: Peter Zijlstra <peterz@infradead•org>,
	Ard Biesheuvel <ardb@kernel•org>,
	 Andrew Morton <akpm@linux-foundation•org>,
	Will Deacon <will@kernel•org>,  Arnd Bergmann <arnd@arndb•de>,
	Stephen Rothwell <sfr@canb•auug.org.au>,
	 x86@kernel•org,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	 Linux Next Mailing List <linux-next@vger•kernel.org>
Subject: Re: linux-next: build failure after merge of the mm-nonmm-unstable tree
Date: Thu, 1 Jan 2026 20:21:46 +1100 (AEDT)	[thread overview]
Message-ID: <4a3455a6-a0dc-f7fb-8b68-da471bb312c7@linux-m68k.org> (raw)
In-Reply-To: <df9fbd22-a648-ada4-fee0-68fe4325ff82@linux-m68k.org>


On Mon, 29 Dec 2025, Finn Thain wrote:

> On Fri, 26 Dec 2025, Sasha Levin wrote:
> 
> > On Sun, Dec 21, 2025 at 01:58:17PM +1100, Finn Thain wrote:
> > >
> > >On Thu, 18 Dec 2025, Stephen Rothwell wrote:
> > >
> > >> After merging the mm-nonmm-unstable tree, today's linux-next build 
> > >> (x86_64 allmodconfig) failed like this:
> > >>
> > >> x86_64-linux-gnu-ld: error: unplaced orphan section `__bug_table' from
> > >> `arch/x86/boot/compressed/sev-handle-vc.o'
> > >>
> > >
> > >I found that I could reproduce the same build failure after applying 
> > >Peter's patch to v6.19-rc1. So it's not confined to linux-next. I 
> > >used allnoconfig with CONFIG_LD_ORPHAN_WARN_LEVEL=error and 
> > >CONFIG_AMD_MEM_ENCRYPT=y because allmodconfig takes forever to build.
> > >
> > >The patch in question is this one: 
> > >https://lore.kernel.org/lkml/0c18fd08ef19497768070783da28086e01d11a00.1765866665.git.fthain@linux-m68k.org/
> > >
> > >I may have found a solution for the problem, but I don't understand 
> > >this code, so I've Cc'd Ard et al. I don't know whether the 
> > >__bug_table section is relevant to sev-handle-vc.c. If that section 
> > >is not desired, I propose to make this change to Peter's patch --
> > 
> > I think that the issue here is that we're trying to use WARN in the 
> > early boot context. We should probably add CONFIG_DEBUG_ATOMIC to the 
> > list of configs we disable for that:
> > 
> > diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
> > index 4f86c5903e03..bb36dcef7d08 100644
> > --- a/arch/x86/boot/compressed/misc.h
> > +++ b/arch/x86/boot/compressed/misc.h
> > @@ -14,6 +14,7 @@
> >  #undef CONFIG_ARCH_HAS_LAZY_MMU_MODE
> >  #undef CONFIG_KASAN
> >  #undef CONFIG_KASAN_GENERIC
> > +#undef CONFIG_DEBUG_ATOMIC
> > 
> 
> Thanks for sending that suggestion. It does fix the problem on x86_64. 
> However, the problem also affects arm, arm64, riscv, riscv64 and 
> loongarch. The fix I proposed (i.e. test __DISABLE_EXPORTS) works on all 
> of the affected architectures because 
> drivers/firmware/efi/libstub/Makefile puts -D__DISABLE_EXPORTS in 
> CFLAGS, just as arch/x86/boot/compressed/Makefile does.
> 
> AFAICT, when I put -UCONFIG_DEBUG_ATOMIC in CFLAGS, it doesn't override 
> that macro definition autoconf.h. And there is no equivalent of 
> arch/x86/boot/compressed/misc.h in drivers/firmware/efi/libstub so I 
> can't simply add #undef CONFIG_DEBUG_ATOMIC there.
> 

I'd better correct myself. That header does actually exist:
drivers/firmware/efi/libstub/efistub.h
I overlooked it somehow.

> If __DISABLE_EXPORTS is not the appropriate macro for this purpose, then 
> we need a new macro (e.g. __DISABLE_BUG_TABLE) or else we need a new 
> header, to be included by some unknown set of .c files (that might 
> accidentally #include bug.h) so that this new header could do #undef 
> CONFIG_DEBUG_ATOMIC. My inclination is to implement 
> -D__DISABLE_BUG_TABLE but I'm open to suggestions.
> 

After I sent patches using -D__DISABLE_BUG_TABLE, I figured out that your 
#undef suggestion has some appeal: by confining the preprocessor tricks to 
drivers/firmware/efi/libstub/, we might avoid spreading them across 
include/linux/ which has a certain tidyness to it.

The only problem is fragility. The ordering of #include and #undef 
directives is critical and complicated. I can't seem to get it right.
The following patch produces a build failure.

diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
index fd855e32c9b9..8442eebaada1 100644
--- a/arch/x86/boot/compressed/misc.h
+++ b/arch/x86/boot/compressed/misc.h
@@ -8,6 +8,7 @@
  * we just keep it from happening. (This list needs to be extended when new
  * paravirt and debugging variants are added.)
  */
+#include <generated/autoconf.h>
 #undef CONFIG_PARAVIRT
 #undef CONFIG_PARAVIRT_XXL
 #undef CONFIG_PARAVIRT_SPINLOCKS


Problem is, you can't do #undef unless you know that #define has already 
taken place, and you can't #define again if #undef has already taken 
place...

Anyway, that's just BTW: I don't feel any need to revise the patches I 
sent.

  reply	other threads:[~2026-01-01  9:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18  4:30 linux-next: build failure after merge of the mm-nonmm-unstable tree Stephen Rothwell
2025-12-21  2:58 ` Finn Thain
2025-12-26 16:45   ` Sasha Levin
2025-12-29  8:56     ` Finn Thain
2026-01-01  9:21       ` Finn Thain [this message]
2026-01-01 17:01         ` Randy Dunlap
2026-01-01 23:15           ` Finn Thain
2026-01-02  7:29     ` Ard Biesheuvel
2026-01-02 22:09       ` Finn Thain
  -- strict thread matches above, loose matches on Subject: below --
2026-04-29  9:10 Thierry Reding
2026-03-17 14:32 Mark Brown
2026-03-17 15:06 ` Mathieu Desnoyers
2026-03-17 15:07   ` David CARLIER
2026-02-16 13:58 Mark Brown
2025-11-16 23:23 Stephen Rothwell
2025-11-19 23:14 ` Stephen Rothwell
2025-11-19 23:48   ` Andrew Morton
2025-11-20  8:55     ` Miguel Ojeda
2025-11-20 10:01     ` Alice Ryhl
2025-11-16 22:36 Stephen Rothwell
2025-10-17 13:25 Mark Brown
2025-10-17 21:34 ` Andrew Morton
2025-09-01  1:17 Stephen Rothwell
2025-07-11  0:58 Stephen Rothwell

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=4a3455a6-a0dc-f7fb-8b68-da471bb312c7@linux-m68k.org \
    --to=fthain@linux-m68k$(echo .)org \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=ardb@kernel$(echo .)org \
    --cc=arnd@arndb$(echo .)de \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=peterz@infradead$(echo .)org \
    --cc=sashal@kernel$(echo .)org \
    --cc=sfr@canb$(echo .)auug.org.au \
    --cc=will@kernel$(echo .)org \
    --cc=x86@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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