[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a0ab7bfd7a64f1051cd7719327fa1f111082b29.1746821544.git.jpoimboe@kernel.org>
Date: Fri, 9 May 2025 13:17:12 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: x86@...nel.org
Cc: linux-kernel@...r.kernel.org,
Petr Mladek <pmladek@...e.com>,
Miroslav Benes <mbenes@...e.cz>,
Joe Lawrence <joe.lawrence@...hat.com>,
live-patching@...r.kernel.org,
Song Liu <song@...nel.org>,
laokz <laokz@...mail.com>,
Jiri Kosina <jikos@...nel.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>,
Weinan Liu <wnliu@...gle.com>,
Fazla Mehrab <a.mehrab@...edance.com>,
Chen Zhongjin <chenzhongjin@...wei.com>,
Puranjay Mohan <puranjay@...nel.org>
Subject: [PATCH v2 48/62] objtool: Make STACK_FRAME_NON_STANDARD consistent
The C version of STACK_FRAME_NON_STANDARD differs from its asm
counterpart in that it creates eight-byte entries (vs four) and creates
a superfluous temporary variable.
Make the entry sizes consistent by converting the C version to four byte
entries.
Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
---
include/linux/objtool.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index 483dd3131826..d4137a46ee70 100644
--- a/include/linux/objtool.h
+++ b/include/linux/objtool.h
@@ -33,9 +33,10 @@
*
* For more information, see tools/objtool/Documentation/objtool.txt.
*/
-#define STACK_FRAME_NON_STANDARD(func) \
- static void __used __section(".discard.func_stack_frame_non_standard") \
- *__func_stack_frame_non_standard_##func = func
+#define STACK_FRAME_NON_STANDARD(func) \
+ asm(".pushsection .discard.func_stack_frame_non_standard, \"aw\"\n\t" \
+ ".long " __stringify(func) " - .\n\t" \
+ ".popsection")
/*
* STACK_FRAME_NON_STANDARD_FP() is a frame-pointer-specific function ignore
--
2.49.0
Powered by blists - more mailing lists