Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

unwind_user/x86: Enable frame pointer unwinding on x86

Use ARCH_INIT_USER_FP_FRAME to describe how frame pointers are unwound
on x86, and enable CONFIG_HAVE_UNWIND_USER_FP accordingly so the
unwind_user interfaces can be used.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20250827193828.347397433@kernel.org

authored by

Josh Poimboeuf and committed by
Peter Zijlstra
49cf34c0 c79dd946

+26
+1
arch/x86/Kconfig
··· 297 297 select HAVE_SYSCALL_TRACEPOINTS 298 298 select HAVE_UACCESS_VALIDATION if HAVE_OBJTOOL 299 299 select HAVE_UNSTABLE_SCHED_CLOCK 300 + select HAVE_UNWIND_USER_FP if X86_64 300 301 select HAVE_USER_RETURN_NOTIFIER 301 302 select HAVE_GENERIC_VDSO 302 303 select VDSO_GETRANDOM if X86_64
+25
arch/x86/include/asm/unwind_user.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _ASM_X86_UNWIND_USER_H 3 + #define _ASM_X86_UNWIND_USER_H 4 + 5 + #include <asm/ptrace.h> 6 + 7 + #define ARCH_INIT_USER_FP_FRAME(ws) \ 8 + .cfa_off = 2*(ws), \ 9 + .ra_off = -1*(ws), \ 10 + .fp_off = -2*(ws), \ 11 + .use_fp = true, 12 + 13 + static inline int unwind_user_word_size(struct pt_regs *regs) 14 + { 15 + /* We can't unwind VM86 stacks */ 16 + if (regs->flags & X86_VM_MASK) 17 + return 0; 18 + #ifdef CONFIG_X86_64 19 + if (!user_64bit_mode(regs)) 20 + return sizeof(int); 21 + #endif 22 + return sizeof(long); 23 + } 24 + 25 + #endif /* _ASM_X86_UNWIND_USER_H */