linux_dsm_epyc7002/arch/s390
Vasily Gorbik b4adfe5591 s390/ftrace: save traced function caller
A typical backtrace acquired from ftraced function currently looks like
the following (e.g. for "path_openat"):

arch_stack_walk+0x15c/0x2d8
stack_trace_save+0x50/0x68
stack_trace_call+0x15a/0x3b8
ftrace_graph_caller+0x0/0x1c
0x3e0007e3c98 <- ftraced function caller (should be do_filp_open+0x7c/0xe8)
do_open_execat+0x70/0x1b8
__do_execve_file.isra.0+0x7d8/0x860
__s390x_sys_execve+0x56/0x68
system_call+0xdc/0x2d8

Note random "0x3e0007e3c98" stack value as ftraced function caller. This
value causes either imprecise unwinder result or unwinding failure.
That "0x3e0007e3c98" comes from r14 of ftraced function stack frame, which
it haven't had a chance to initialize since the very first instruction
calls ftrace code ("ftrace_caller"). (ftraced function might never
save r14 as well). Nevertheless according to s390 ABI any function
is called with stack frame allocated for it and r14 contains return
address. "ftrace_caller" itself is called with "brasl %r0,ftrace_caller".
So, to fix this issue simply always save traced function caller onto
ftraced function stack frame.

Reported-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2019-12-18 23:29:26 +01:00
..
appldata proc/sysctl: add shared variables for range check 2019-07-18 17:08:07 -07:00
boot s390/kaslr: store KASLR offset for early dumps 2019-11-30 10:52:45 +01:00
configs locking/refcount: Consolidate implementations of refcount_t 2019-11-25 09:15:32 +01:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-11-25 19:49:58 -08:00
hypfs Merge branch 'work.mount3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-09-24 12:33:34 -07:00
include s390/ftrace: fix endless recursion in function_graph tracer 2019-12-18 23:29:26 +01:00
kernel s390/ftrace: save traced function caller 2019-12-18 23:29:26 +01:00
kvm KVM: s390: small fixes and enhancements 2019-11-18 13:16:46 +01:00
lib s390/test_unwind: fix spelling mistake "reqister" -> "register" 2019-12-11 19:53:23 +01:00
mm s390/kasan: add KASAN_VMALLOC support 2019-12-11 19:56:59 +01:00
net s390/bpf: Remove JITed image size limitations 2019-11-18 19:51:16 -08:00
numa s390/numa: correct early_param handling 2019-08-26 12:51:17 +02:00
oprofile s390/unwind: introduce stack unwind API 2019-05-02 13:54:11 +02:00
pci pci-v5.5-changes 2019-12-03 13:58:22 -08:00
purgatory s390/purgatory: do not build purgatory with kcov, kasan and friends 2019-12-18 23:29:26 +01:00
scripts s390/build: use size command to perform empty .bss check 2019-08-08 14:36:53 +02:00
tools s390: add support for IBM z15 machines 2019-09-13 12:19:14 +02:00
Kbuild s390/kexec_file: Add purgatory 2018-04-16 09:10:22 +02:00
Kconfig s390/kasan: add KASAN_VMALLOC support 2019-12-11 19:56:59 +01:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile s390: remove compat vdso code 2019-12-01 12:48:49 +01:00