[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiwhHKvxZoaCPs2Zs4gaMAfCyZ=arBvXdP_kvNKOH5sKA@mail.gmail.com>
Date: Tue, 4 Mar 2025 10:41:08 -1000
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
linux-tip-commits@...r.kernel.org,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, Brian Gerst <brgerst@...il.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org
Subject: Re: [tip: x86/asm] x86/asm: Make ASM_CALL_CONSTRAINT conditional on
frame pointers
On Tue, 4 Mar 2025 at 10:13, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> Does clang even need it?
Bah. Yes it does. I may not have clang sources to try to look at, but
I can do a test-build.
Anyway, I do think it would be better to make this compiler-specific,
and keep gcc using the old tested case that works well regardless of
whether frame pointers are enabled or not, since it doesn't _care_.
And I think there's a better way to deal with the whole "generate
better code when not needed" too, if clang really has to have that
disgusting __builtin_frame_pointer() thing that then has problems when
frame pointers aren't enabled.
IOW, you could do something pointless like
extern int unused_variable;
#define ASM_CALL_CONSTRAINT "+m" (unused_variable)
which generates a dependency that doesn't matter, and then doesn't
then require preprocessor hacks for when it is empty.
So I *think* the patch could be something like
- move the define to <asm/compiler-xyzzy,.h>
- for gcc, use the old tested code
- for clang, use the "either __builtin_frame_pointer(0) or dummy
dependency" thing
- have big comments about it, because our historical changelogs
clearly are not accurate wrt this all.
Linus
Powered by blists - more mailing lists