Re: [RFC PATCH v1 06/16] unwind_user: Enable archs that define CFA = SP_callsite + offset

From
Josh Poimboeuf <jpoimboe@kernel.org>
Date
2025-07-16 21:32:24
Also in
bpf, lkml
Reply to
Jens Remus, 2025-07-10
On Thu, Jul 10, 2025 at 06:35:12PM +0200, Jens Remus wrote:
Most architectures define their CFA as the value of the stack pointer
(SP) at the call site in the previous frame, as suggested by the DWARF
standard:

  CFA = <SP at call site>

Enable unwinding of user space for architectures, such as s390, which
define their CFA as the value of the SP at the call site in the previous
frame with an offset:

  CFA = <SP at call site> + offset
This is a bit confusing, as the comment and code define it as

    SP = CFA + offset

Should the commit log be updated to match that?
quoted hunk ↗ jump to hunk
+++ b/arch/x86/include/asm/unwind_user.h
@@ -8,6 +8,7 @@
 	.cfa_off	= (s32)sizeof(long) *  2,				\
 	.ra_off		= (s32)sizeof(long) * -1,				\
 	.fp_off		= (s32)sizeof(long) * -2,				\
+	.sp_val_off	= (s32)0,						\
IIUC, this is similar to ra_off and fp_off in that its an offset from
the CFA.  Can we call it "sp_off"?

-- 
Josh
Thread (42 messages) 42 messages, 4 authors, last reply 2025-08-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help