On November 6, 2024 8:31:53 AM PST, Uros Bizjak <ubiz...@gmail.com> wrote: >On Wed, Nov 6, 2024 at 5:23 PM Jakub Jelinek <ja...@redhat.com> wrote: >> >> On Wed, Nov 06, 2024 at 05:05:54PM +0100, Uros Bizjak wrote: >> > Please see [1]: >> > >> > /* >> > * This output constraint should be used for any inline asm which has a >> > "call" >> > * instruction. Otherwise the asm may be inserted before the frame pointer >> > * gets set up by the containing function. If you forget to do this, >> > objtool >> > * may print a "call without frame pointer save/setup" warning. >> > */ >> > register unsigned long current_stack_pointer asm(_ASM_SP); >> > #define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer) >> > >> > Perhaps HPA can say some more? >> >> So workaround about issues in some kernel tool? >> Not sure if gcc needs to provide workaround for that. >> Just do the call in a separate .subsection or add some magic labels around >> it that the tool can check and disable the warning. Perhaps just a label >> at the start of the call insn with some special prefix followed by %= >> that the tool can use to find out calls coming from inline asm vs. calls >> from C code. > >Maybe even prefix the call with "cs;" prefix. > >Uros. >
The issue is that we want the frame pointer chain to be maintained, even across alternatives. This isn't to quiet a spurious warning, rather objtool is throwing a legitimate warning that a level environment invariant is being violated.