Re: [PATCH] objtool: Support Clang RAX DRAP sequence
From: Peter Zijlstra
Date: Tue Mar 17 2026 - 16:35:40 EST
On Tue, Mar 17, 2026 at 08:30:59AM -0700, Josh Poimboeuf wrote:
> On Tue, Mar 17, 2026 at 09:18:25AM +0100, Peter Zijlstra wrote:
> > On Mon, Mar 16, 2026 at 05:47:56PM -0700, Josh Poimboeuf wrote:
> > > Recent Clang can use RAX as a temporary register for the DRAP stack
> > > alignment sequence. Add support for that.
> > >
> > > Fixes the following warning:
> > >
> > > vmlinux.o: error: objtool: vmw_host_printf+0xd: unknown CFA base reg 0
> > >
> > > Reported-by: Arnd Bergmann <arnd@xxxxxxxx>
> > > Closes: https://lore.kernel.org/cefefdd1-7b82-406d-8ff4-e4b167e45ee6@xxxxxxxxxxxxxxxx
> > > Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> > > ---
> > > arch/x86/include/asm/orc_types.h | 1 +
> > > arch/x86/kernel/unwind_orc.c | 8 ++++++++
> > > tools/arch/x86/include/asm/orc_types.h | 1 +
> > > tools/objtool/arch/x86/decode.c | 3 +++
> > > tools/objtool/arch/x86/orc.c | 5 +++++
> > > 5 files changed, 18 insertions(+)
> > >
> > > diff --git a/arch/x86/include/asm/orc_types.h b/arch/x86/include/asm/orc_types.h
> > > index e0125afa53fb..b3cc7970fa54 100644
> > > --- a/arch/x86/include/asm/orc_types.h
> > > +++ b/arch/x86/include/asm/orc_types.h
> > > @@ -37,6 +37,7 @@
> > > #define ORC_REG_R13 7
> > > #define ORC_REG_BP_INDIRECT 8
> > > #define ORC_REG_SP_INDIRECT 9
> > > +#define ORC_REG_AX 10
> > > #define ORC_REG_MAX 15
> >
> > I'm 'annoyed' at the placement of that register. I know its not
> > important, but I can't silence my OCD saying that AX should come before
> > DX.
> >
> > Also, SP comes before BP and both before DI.
> >
> > Something like so perhaps?
>
> That bothered me too, but I was trying to keep the diffstat down. But
> sure, why not...
>
> What about the switch statements? Should we reorder them too while at
> it? If so, starting to feel like a separate patch.
Agreed, switch statement order should match the definition order. And
yes separate patch is fine.