[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQJFc9AnH_9CW+bSRotkKvOmkO9jq-RF6dmyPYOpq691Yg@mail.gmail.com>
Date: Fri, 19 Aug 2022 11:31:53 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Peter Zijlstra <peterz@...radead.org>, X86 ML <x86@...nel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-um@...ts.infradead.org, kvm@...r.kernel.org,
clang-built-linux <llvm@...ts.linux.dev>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Alexei Starovoitov <ast@...nel.org>
Subject: Re: [PATCH] Kconfig: eradicate CC_HAS_ASM_GOTO
On Fri, Aug 19, 2022 at 10:42 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> On Sat, Aug 20, 2022 at 2:28 AM Nick Desaulniers
> <ndesaulniers@...gle.com> wrote:
> >
> > On Fri, Aug 19, 2022 at 10:16 AM Alexandre Belloni
> > <alexandre.belloni@...tlin.com> wrote:
> > >
> > > On 19/08/2022 10:00:53-0700, Nick Desaulniers wrote:
> > > > GCC has supported asm goto since 4.5, and Clang has since version 9.0.0.
> > > > The minimum supported versions of these tools for the build according to
> > > > Documentation/process/changes.rst are 5.1 and 11.0.0 respectively.
> > > >
> > > > Remove the feature detection script, Kconfig option, and clean up some
> > > > fallback code that is no longer supported.
> > > >
> > > > The removed script was also testing for a GCC specific bug that was
> > > > fixed in the 4.7 release.
> > > >
> > > > The script was also not portable; users of Dash shell reported errors
> > > > when it was invoked.
> > > >
> > >
> > > To be clear, the script was portable, what is not working with dash is
> > > the current detection of CC_HAS_ASM_GOTO_TIED_OUTPUT. I'll try the other
> > > suggestion from Masahiro.
> >
> > Ah, that was his point about echo; that makes more sense.
> >
> > Unless a v2 is required, perhaps Masahiro would be kind enough to drop
> > this sentence from the commit message when applying?
>
> I can if there is nothing else to fix.
>
>
> And, Alexandre's Reported-by is irrelevant.
>
> As for the subject prefix "Kconfig:",
> I prefer something else, for example,
> "asm goto:" or "jump label:".
>
> I want to reserve "Kconfig:" for changes in scripts/kconfig/.
>
>
> >
> > >
> > > > --- a/arch/x86/include/asm/cpufeature.h
> > > > +++ b/arch/x86/include/asm/cpufeature.h
> > > > @@ -155,11 +155,11 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit);
> > > >
> > > > #define setup_force_cpu_bug(bit) setup_force_cpu_cap(bit)
> > > >
> > > > -#if defined(__clang__) && !defined(CONFIG_CC_HAS_ASM_GOTO)
> > > > +#if defined(__clang__) && __clang_major__ < 9
> > >
> > > Shouldn't we simply mandates clang >= 9 and drop the whole section? This
> > > is what you do later on.
> >
> > I considered it, but I don't think it would be safe to do so in this
> > header. If you look at the comment block below it, it mentions that
> > these kernel headers are being sucked into UAPI headers that are used
> > outside of the kernel builds, such as when building eBPF programs. So
> > we don't know what userspace tools might be consuming these headers.
> > The original intent of the guard was to not break eBPF compilation
> > with older clang releases, so I've retained. that functionality.
> >
> > + Alexei to review
> > (author of
> > commit b1ae32dbab50 ("x86/cpufeature: Guard asm_volatile_goto usage
> > for BPF compilation")
>
>
> I am not sure at this point.
> Wait for the input from Alexei.
It's probably best to remove this old workaround.
bpftrace still has code that does:
cflags.push_back("-D__BPF_TRACING__");
and bpftrace sort-of works with llvm 6+,
but they need to move to a newer clang for tons of other reasons
including lots of fixes in the clang bpf backend that were
added over the years.
So just nuke this old hack.
Powered by blists - more mailing lists