Re: [tip: core/urgent] compiler.h: Avoid the usage of __typeof_unqual__() when __GENKSYMS__ is defined
From: Uros Bizjak
Date: Sun Apr 13 2025 - 15:15:11 EST
On Sun, Apr 13, 2025 at 8:56 PM Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
>
> * Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
>
> > On Sun, Apr 13, 2025 at 10:55 AM Ingo Molnar <mingo@xxxxxxxxxx> wrote:
> > >
> > >
> > > * Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
> > >
> > > > > Yeah, agreed, I've removed this workaround from tip:core/urgent for
> > > > > the time being - it's not like genksyms is some magic external
> > > > > entity we have to work around, it's an in-kernel tool that can be
> > > > > fixed/enhanced in scripts/genksyms/.
> > > >
> > > > Please note that you will disable a check that is finally able to
> > > > fail the build for a whole class of very subtle percpu bugs.
> > >
> > > I simply zapped a commit that was applied two days ago and asked akpm
> > > to resolve a regression that was introduced upstream via his tree
> > > through this commit, in this merge window:
> > >
> > > ac053946f5c4 ("compiler.h: introduce TYPEOF_UNQUAL() macro")
> > >
> > > What 'disabled checks' are you talking about?
> >
> > Percpu checks require TYPEOF_UNQUAL() macro, so removing
> > USE_TYPEOF_UNQUAL definition
>
> I did nothing to remove the USE_TYPEOF_UNQUAL definition, did I?
So ... let's slow the ball down a bit. The patch I'm worried about is [1]:
-#if CC_HAS_TYPEOF_UNQUAL && !defined(__CHECKER__)
-# define USE_TYPEOF_UNQUAL 1
-#endif
+#undef USE_TYPEOF_UNQUAL
[1] https://lore.kernel.org/lkml/20250411210815.GAZ_mEv8riLWzvERYY@renoirsky.local/
and in [2] my proposed patch is commented as:
--q--
> So mingo is right - this is not really a fix but a brown-paper bag of
> sorts.
Yeah, agreed, I've removed this workaround from tip:core/urgent for the
time being - it's not like genksyms is some magic external entity we
have to work around, it's an in-kernel tool that can be fixed/enhanced
in scripts/genksyms/.
Maybe akpm can merge this or some other fix and sort it out? AFAICS the
bug came in via the -mm tree in January, via:
ac053946f5c4 ("compiler.h: introduce TYPEOF_UNQUAL() macro")
--/q--
[2] https://lore.kernel.org/lkml/Z_oqalk92C4G6Rqt@xxxxxxxxx/
> > [...] will skip the definition of __percpu_qual in
> > arch/x86/include/asm/percpu.h (please see
> > 6a367577153acd9b432a5340fb10891eeb7e10f1), and consequently __percpu
> > macro won't be defined with __seg_gs (please see
> > 6cea5ae714ba47ea4807d15903baca9857a450e6).
> >
> > If this commit is removed, [...]
>
> I did not remove commit ac053946f5c4, it's already upstream. Nor did I
> advocate for it to be reverted - I'd like it to be fixed. So you are
> barking up the wrong tree.
If the intention is to pass my proposed workaround via Andrew's tree,
then I'm happy to bark up the wrong tree, but from the referred
message trail, I didn't get the clear decision about the patch, and
neither am sure which patch "brown paper bag bug" refers to.
Thanks,
Uros.