Thread (67 messages) flat view 67 messages, 3 authors, 2026-08-21
COLD34d

[RFC PATCH v1 23/25] s390/ptrace: Provide frame_pointer()

From: Jens Remus <hidden>
Date: 2026-08-18 14:50:29
Also in: linux-s390, lkml
Subsystem: ptrace support, s390 architecture, the rest · Maintainers: Oleg Nesterov, Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Linus Torvalds

On s390 64-bit the s390x ELF ABI [1] designates register 11 as the
"preferred" frame pointer (FP) register in user space.

[1]: s390x ELF ABI, https://github.com/IBM/s390x-abi/releases

Signed-off-by: Jens Remus <redacted>
---

Notes (jremus):
    Cherry-picked from "[PATCH v4 00/12] s390: SFrame user space unwinding"
    series and adjusted to .eh_frame:
    https://lore.kernel.org/all/20260127151926.2805123-9-jremus@linux.ibm.com/ (local)

 arch/s390/include/asm/ptrace.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index 495e310c3d6d..85765979a595 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -255,6 +255,12 @@ static __always_inline unsigned long user_stack_pointer(const struct pt_regs *re
 	return regs->gprs[15];
 }
 
+static __always_inline unsigned long frame_pointer(const struct pt_regs *regs)
+{
+	/* Return ABI-designated "preferred" frame-pointer register value. */
+	return regs->gprs[11];
+}
+
 static __always_inline unsigned long regs_get_register(const struct pt_regs *regs,
 						       unsigned int offset)
 {
-- 
2.53.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help