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.

x86/unwind_user: Guard unwind_user_word_size() by UNWIND_USER

The unwind user framework in general requires an architecture-specific
implementation of unwind_user_word_size() to be present for any unwind
method, whether that is fp or a future other method, such as potentially
sframe.

Guard unwind_user_word_size() by the availability of the UNWIND_USER
framework instead of the specific HAVE_UNWIND_USER_FP method.

This facilitates to selectively disable HAVE_UNWIND_USER_FP on x86
(e.g. for test purposes) once a new unwind method is added to unwind
user.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251208160352.1363040-4-jremus@linux.ibm.com

authored by

Jens Remus and committed by
Peter Zijlstra
aa6047ef 2652f9a4

+17 -13
+17 -13
arch/x86/include/asm/unwind_user.h
··· 2 2 #ifndef _ASM_X86_UNWIND_USER_H 3 3 #define _ASM_X86_UNWIND_USER_H 4 4 5 - #ifdef CONFIG_HAVE_UNWIND_USER_FP 5 + #ifdef CONFIG_UNWIND_USER 6 6 7 7 #include <asm/ptrace.h> 8 8 #include <asm/uprobes.h> 9 - 10 - #define ARCH_INIT_USER_FP_FRAME(ws) \ 11 - .cfa_off = 2*(ws), \ 12 - .ra_off = -1*(ws), \ 13 - .fp_off = -2*(ws), \ 14 - .use_fp = true, 15 - 16 - #define ARCH_INIT_USER_FP_ENTRY_FRAME(ws) \ 17 - .cfa_off = 1*(ws), \ 18 - .ra_off = -1*(ws), \ 19 - .fp_off = 0, \ 20 - .use_fp = false, 21 9 22 10 static inline int unwind_user_word_size(struct pt_regs *regs) 23 11 { ··· 18 30 #endif 19 31 return sizeof(long); 20 32 } 33 + 34 + #endif /* CONFIG_UNWIND_USER */ 35 + 36 + #ifdef CONFIG_HAVE_UNWIND_USER_FP 37 + 38 + #define ARCH_INIT_USER_FP_FRAME(ws) \ 39 + .cfa_off = 2*(ws), \ 40 + .ra_off = -1*(ws), \ 41 + .fp_off = -2*(ws), \ 42 + .use_fp = true, 43 + 44 + #define ARCH_INIT_USER_FP_ENTRY_FRAME(ws) \ 45 + .cfa_off = 1*(ws), \ 46 + .ra_off = -1*(ws), \ 47 + .fp_off = 0, \ 48 + .use_fp = false, 21 49 22 50 static inline bool unwind_user_at_function_start(struct pt_regs *regs) 23 51 {