From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] objtool: Support Clang RAX DRAP sequence
Date: Tue, 17 Mar 2026 09:18:25 +0100 [thread overview]
Message-ID: <20260317081825.GC3738010@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <3f33dc720b83dc6d3a2b7094f75a5c90a0b1cbc5.1773708458.git.jpoimboe@kernel.org>
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@arndb.de>
> Closes: https://lore.kernel.org/cefefdd1-7b82-406d-8ff4-e4b167e45ee6@app.fastmail.com
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
> 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?
---
diff --git a/arch/x86/include/asm/orc_types.h b/arch/x86/include/asm/orc_types.h
index e0125afa53fb..5df398761c70 100644
--- a/arch/x86/include/asm/orc_types.h
+++ b/arch/x86/include/asm/orc_types.h
@@ -28,15 +28,19 @@
* and GCC realigned stacks.
*/
#define ORC_REG_UNDEFINED 0
-#define ORC_REG_PREV_SP 1
+
+#define ORC_REG_AX 1
#define ORC_REG_DX 2
-#define ORC_REG_DI 3
+#define ORC_REG_SP 3
#define ORC_REG_BP 4
-#define ORC_REG_SP 5
+#define ORC_REG_DI 5
#define ORC_REG_R10 6
#define ORC_REG_R13 7
-#define ORC_REG_BP_INDIRECT 8
+
+#define ORC_REG_PREV_SP 8
#define ORC_REG_SP_INDIRECT 9
+#define ORC_REG_BP_INDIRECT 10
+
#define ORC_REG_MAX 15
#define ORC_TYPE_UNDEFINED 0
next prev parent reply other threads:[~2026-03-17 8:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 0:47 [PATCH] objtool: Support Clang RAX DRAP sequence Josh Poimboeuf
2026-03-17 8:18 ` Peter Zijlstra [this message]
2026-03-17 15:30 ` Josh Poimboeuf
2026-03-17 20:35 ` Peter Zijlstra
2026-03-17 22:44 ` Josh Poimboeuf
2026-03-18 8:28 ` Peter Zijlstra
2026-03-18 8:41 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260317081825.GC3738010@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=arnd@arndb.de \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox