Re: [tip: x86/asm] x86/asm: Make ASM_CALL_CONSTRAINT conditional on frame pointers
From: Josh Poimboeuf
Date: Mon Mar 03 2025 - 17:45:59 EST
On Mon, Mar 03, 2025 at 02:31:50PM -0800, H. Peter Anvin wrote:
> >+#ifdef CONFIG_UNWINDER_FRAME_POINTER
> > #define ASM_CALL_CONSTRAINT "r" (__builtin_frame_address(0))
> >+#else
> >+#define ASM_CALL_CONSTRAINT
> >+#endif
> >
> > #endif /* __ASSEMBLY__ */
> >
>
> Wait, why was this changed? I actually tested this form at least once
> and found that it didn't work under all circumstances...
Do you have any more details about where this didn't work? I tested
with several configs and it seems to work fine. Objtool will complain
if it doesn't work.
See here for the justification (the previous version was producing crap
code in Clang):
https://lore.kernel.org/dbea2ae2fb39bece21013f939ddeb15507baa7d3.1740964309.git.jpoimboe@xxxxxxxxxx
--
Josh