[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wh3qPK8u8WCgw_ueCkQDP1AtE7AgQxafGR4DKKamuaBkA@mail.gmail.com>
Date: Sun, 21 Dec 2025 15:20:43 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
Uros Bizjak <ubizjak@...il.com>, x86@...nel.org,
linux-kernel <linux-kernel@...r.kernel.org>, Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH 2/2] x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl()
On Sun, 21 Dec 2025 at 13:47, Eric Dumazet <edumazet@...gle.com> wrote:
>
> Unfortunately I was told it was not better, some clang versions had
> bugs with it.
The whole "builtin is worse than inline asm" is actually a thing even
when not actively buggy. We've had things like that a few times
before.
It's why we have out own variable_ffs() implementation, for example,
and do things like
#define ffs(x) (__builtin_constant_p(x) ? __builtin_ffs(x) : variable_ffs(x))
because __builtin_ffs() generates pointlessly silly code on at least
some compiler versions:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106471
So then just using inline asm gets us at least reliable results, and
we can - and do - tweak it for specific known configs.
Linus
Powered by blists - more mailing lists