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>
This commit is contained in:
Sven Schnelle
2024-04-26 12:02:15 +02:00
committed by Alexander Gordeev
parent 9679fec2ca
commit cae74ba8c2
3 changed files with 23 additions and 6 deletions

View File

@@ -11,6 +11,8 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
# Do not trace early setup code
CFLAGS_REMOVE_early.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_rethook.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_stacktrace.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_unwind_bc.o = $(CC_FLAGS_FTRACE)
endif