[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZfrMcyZXCBQD/sE8@gmail.com>
Date: Wed, 20 Mar 2024 12:45:55 +0100
From: Ingo Molnar <mingo@...nel.org>
To: linux-kernel@...r.kernel.org, Uros Bizjak <ubizjak@...il.com>
Cc: linux-tip-commits@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org,
Nathan Chancellor <nathan@...nel.org>,
Kees Cook <keescook@...omium.org>,
Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [tip: x86/percpu] x86/percpu: Convert this_percpu_xchg_op() from
asm() to C code, to generate better code
* tip-bot2 for Uros Bizjak <tip-bot2@...utronix.de> wrote:
> The following commit has been merged into the x86/percpu branch of tip:
>
> Commit-ID: 0539084639f3835c8d0b798e6659ec14a266b4f1
> Gitweb: https://git.kernel.org/tip/0539084639f3835c8d0b798e6659ec14a266b4f1
> Author: Uros Bizjak <ubizjak@...il.com>
> AuthorDate: Wed, 20 Mar 2024 09:30:40 +01:00
> Committer: Ingo Molnar <mingo@...nel.org>
> CommitterDate: Wed, 20 Mar 2024 12:29:02 +01:00
>
> x86/percpu: Convert this_percpu_xchg_op() from asm() to C code, to generate better code
>
> Rewrite percpu_xchg_op() using generic percpu primitives instead
> of using asm. The new implementation is similar to local_xchg() and
> allows the compiler to perform various optimizations: e.g. the
> compiler is able to create fast path through the loop, according
> to likely/unlikely annotations in percpu_try_cmpxchg_op().
So, while at it, there's two other x86 percpu code generation details I was
wondering about:
1)
Right now it's GCC-only:
config CC_HAS_NAMED_AS
def_bool CC_IS_GCC && GCC_VERSION >= 120100
Because we wanted to create a stable core of known-working functionality.
I suppose we have already established that with the current merge window,
so it might be time to expand it.
Clang claims to be compatible:
https://releases.llvm.org/9.0.0/tools/clang/docs/LanguageExtensions.html
"You can also use the GCC compatibility macros __seg_fs and __seg_gs for the
same purpose. The preprocessor symbols __SEG_FS and __SEG_GS indicate their
support."
I haven't tried it yet though.
2)
Also, is the GCC_VERSION cutoff accurate - are previous GCC versions
known-buggy, or was it primarily a risk-reduction cutoff?
Thanks,
Ingo
Powered by blists - more mailing lists