diff options
author | Sven Schnelle <svens@linux.ibm.com> | 2024-04-26 12:02:15 +0200 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2024-04-29 17:33:30 +0200 |
commit | cae74ba8c295bc41bda749ef27a8f2b3ee957a41 (patch) | |
tree | f0a40f42f5d33e824881c623708f8ad9ad76da56 /arch/s390/include | |
parent | s390/pci: Drop unneeded reference to CONFIG_DMI (diff) | |
download | linux-cae74ba8c295bc41bda749ef27a8f2b3ee957a41.tar.xz linux-cae74ba8c295bc41bda749ef27a8f2b3ee957a41.zip |
s390/ftrace: Use unwinder instead of __builtin_return_address()
Using __builtin_return_address(n) might return undefined values
when used with values of n outside of the stack. This was noticed
when __builtin_return_address() was called in ftrace on top level
functions like the interrupt handlers.
As this behaviour cannot be fixed, use the s390 stack unwinder and
remove the ftrace compilation flags for unwind_bc.c and stacktrace.c
to prevent the unwinding function polluting function traces.
Another advantage is that this also works with clang.
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/ftrace.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h index 621f23d5ae30..77e479d44f1e 100644 --- a/arch/s390/include/asm/ftrace.h +++ b/arch/s390/include/asm/ftrace.h @@ -8,12 +8,8 @@ #ifndef __ASSEMBLY__ -#ifdef CONFIG_CC_IS_CLANG -/* https://llvm.org/pr41424 */ -#define ftrace_return_address(n) 0UL -#else -#define ftrace_return_address(n) __builtin_return_address(n) -#endif +unsigned long return_address(unsigned int n); +#define ftrace_return_address(n) return_address(n) void ftrace_caller(void); |