public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [tip: x86/asm] x86/asm: Make ASM_CALL_CONSTRAINT conditional on frame pointers
@ 2025-03-03 11:02 tip-bot2 for Josh Poimboeuf
  2025-03-03 18:28 ` Linus Torvalds
  2025-03-03 22:31 ` H. Peter Anvin
  0 siblings, 2 replies; 39+ messages in thread
From: tip-bot2 for Josh Poimboeuf @ 2025-03-03 11:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Josh Poimboeuf, Ingo Molnar, Peter Zijlstra (Intel),
	Linus Torvalds, Brian Gerst, H. Peter Anvin, linux-kernel, x86

The following commit has been merged into the x86/asm branch of tip:

Commit-ID:     e5ff90b179d45df71373cf79f99d20c9abe229cb
Gitweb:        https://git.kernel.org/tip/e5ff90b179d45df71373cf79f99d20c9abe229cb
Author:        Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate:    Sun, 02 Mar 2025 17:21:03 -08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 03 Mar 2025 11:39:54 +01:00

x86/asm: Make ASM_CALL_CONSTRAINT conditional on frame pointers

With frame pointers enabled, ASM_CALL_CONSTRAINT is used in an inline
asm statement with a call instruction to force the compiler to set up
the frame pointer before doing the call.

Without frame pointers, no such constraint is needed.  Make it
conditional on frame pointers.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
---
 arch/x86/include/asm/asm.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 0d268e6..f1db9e8 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -232,7 +232,11 @@ register unsigned long current_stack_pointer asm(_ASM_SP);
  * gets set up by the containing function.  If you forget to do this, objtool
  * may print a "call without frame pointer save/setup" warning.
  */
+#ifdef CONFIG_UNWINDER_FRAME_POINTER
 #define ASM_CALL_CONSTRAINT "r" (__builtin_frame_address(0))
+#else
+#define ASM_CALL_CONSTRAINT
+#endif
 
 #endif /* __ASSEMBLY__ */
 

^ permalink raw reply related	[flat|nested] 39+ messages in thread
* [tip: x86/asm] x86/asm: Make ASM_CALL_CONSTRAINT conditional on frame pointers
@ 2025-03-04 10:36 tip-bot2 for Josh Poimboeuf
  2025-03-07 22:04 ` H. Peter Anvin
  0 siblings, 1 reply; 39+ messages in thread
From: tip-bot2 for Josh Poimboeuf @ 2025-03-04 10:36 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Josh Poimboeuf, Ingo Molnar, Peter Zijlstra (Intel),
	Linus Torvalds, Brian Gerst, H. Peter Anvin, linux-kernel, x86

The following commit has been merged into the x86/asm branch of tip:

Commit-ID:     05844663b4fcf22bb3a1494615ae3f25852c9abc
Gitweb:        https://git.kernel.org/tip/05844663b4fcf22bb3a1494615ae3f25852c9abc
Author:        Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate:    Sun, 02 Mar 2025 17:21:03 -08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 04 Mar 2025 11:21:40 +01:00

x86/asm: Make ASM_CALL_CONSTRAINT conditional on frame pointers

With frame pointers enabled, ASM_CALL_CONSTRAINT is used in an inline
asm statement with a call instruction to force the compiler to set up
the frame pointer before doing the call.

Without frame pointers, no such constraint is needed.  Make it
conditional on frame pointers.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
---
 arch/x86/include/asm/asm.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 0d268e6..f1db9e8 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -232,7 +232,11 @@ register unsigned long current_stack_pointer asm(_ASM_SP);
  * gets set up by the containing function.  If you forget to do this, objtool
  * may print a "call without frame pointer save/setup" warning.
  */
+#ifdef CONFIG_UNWINDER_FRAME_POINTER
 #define ASM_CALL_CONSTRAINT "r" (__builtin_frame_address(0))
+#else
+#define ASM_CALL_CONSTRAINT
+#endif
 
 #endif /* __ASSEMBLY__ */
 

^ permalink raw reply related	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2025-03-13 23:33 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 11:02 [tip: x86/asm] x86/asm: Make ASM_CALL_CONSTRAINT conditional on frame pointers tip-bot2 for Josh Poimboeuf
2025-03-03 18:28 ` Linus Torvalds
2025-03-03 22:37   ` Josh Poimboeuf
2025-03-04  8:33   ` Ingo Molnar
2025-03-04 17:51     ` Linus Torvalds
2025-03-04 18:01       ` Linus Torvalds
2025-03-04 18:21         ` Josh Poimboeuf
2025-03-04 18:48           ` Linus Torvalds
2025-03-04 18:57             ` Linus Torvalds
2025-03-04 19:56               ` Josh Poimboeuf
2025-03-04 20:09                 ` Josh Poimboeuf
2025-03-04 20:13                 ` Linus Torvalds
2025-03-04 20:25                   ` Linus Torvalds
2025-03-04 20:41                   ` Linus Torvalds
2025-03-04 22:45                     ` Josh Poimboeuf
2025-03-04 19:47             ` Josh Poimboeuf
2025-03-04 20:00               ` Josh Poimboeuf
2025-03-04 19:15           ` Ingo Molnar
2025-03-03 22:31 ` H. Peter Anvin
2025-03-03 22:45   ` Josh Poimboeuf
2025-03-03 22:47     ` Josh Poimboeuf
2025-03-04  0:35       ` H. Peter Anvin
2025-03-04  0:57         ` Andrew Cooper
2025-03-04  2:05           ` H. Peter Anvin
2025-03-04 17:45             ` Josh Poimboeuf
2025-03-04 15:35         ` Uros Bizjak
2025-03-04 22:08           ` H. Peter Anvin
2025-03-03 23:59     ` H. Peter Anvin
2025-03-04 15:28       ` Uros Bizjak
  -- strict thread matches above, loose matches on Subject: below --
2025-03-04 10:36 tip-bot2 for Josh Poimboeuf
2025-03-07 22:04 ` H. Peter Anvin
2025-03-07 23:05   ` Ingo Molnar
2025-03-07 23:21     ` Josh Poimboeuf
2025-03-07 23:29       ` H. Peter Anvin
2025-03-08  1:38         ` Josh Poimboeuf
2025-03-08  8:15           ` David Laight
2025-03-08 17:06             ` Josh Poimboeuf
2025-03-10 14:49           ` H. Peter Anvin
2025-03-13 23:33             ` Josh Poimboeuf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox