linux_dsm_epyc7002/arch/s390/kernel
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
..
syscalls
vdso64 s390/vdso: fix getcpu 2019-11-30 10:52:44 +01:00
.gitignore
alternative.c
asm-offsets.c s390/vdso: fix getcpu 2019-11-30 10:52:44 +01:00
audit.c
audit.h
base.S
cache.c
compat_audit.c
compat_linux.c
compat_linux.h
compat_ptrace.h
compat_signal.c
cpcmd.c
crash_dump.c
debug.c
diag.c
dis.c s390/disassembler: don't hide instruction addresses 2019-11-12 11:24:10 +01:00
dumpstack.c s390/unwind: add stack pointer alignment sanity checks 2019-11-30 10:52:48 +01:00
early_printk.c
early.c s390: remove last diag 0x44 caller 2019-12-11 19:53:24 +01:00
ebcdic.c
entry.h
entry.S
fpu.c
ftrace.c
guarded_storage.c
head64.S s390/head64: correct init_task stack setup 2019-11-30 10:52:45 +01:00
idle.c s390/idle: fix cpu idle time calculation 2019-10-31 17:26:48 +01:00
ima_arch.c
ipl_vmparm.c
ipl.c
irq.c
jump_label.c
kdebugfs.c
kexec_elf.c
kexec_image.c
kprobes.c
lgr.c
machine_kexec_file.c
machine_kexec_reloc.c s390/kaslr: add support for R_390_GLOB_DAT relocation type 2019-10-22 17:55:51 +02:00
machine_kexec.c s390/kaslr: store KASLR offset for early dumps 2019-11-30 10:52:45 +01:00
Makefile s390: remove compat vdso code 2019-12-01 12:48:49 +01:00
mcount.S s390/ftrace: save traced function caller 2019-12-18 23:29:26 +01:00
module.c
nmi.c
nospec-branch.c
nospec-sysfs.c
os_info.c
perf_cpum_cf_common.c
perf_cpum_cf_diag.c s390/cpumf: Adjust registration of s390 PMU device drivers 2019-11-20 17:16:01 +01:00
perf_cpum_cf_events.c
perf_cpum_cf.c s390/cpumf: Adjust registration of s390 PMU device drivers 2019-11-20 17:16:01 +01:00
perf_cpum_sf.c s390/cpum_sf: Avoid SBD overflow condition in irq handler 2019-12-11 19:53:24 +01:00
perf_event.c s390: add error handling to perf_callchain_kernel 2019-10-31 17:20:54 +01:00
perf_regs.c
pgm_check.S
process.c s390/process: avoid custom stack unwinding in get_wchan 2019-10-31 17:20:53 +01:00
processor.c
ptrace.c seccomp: simplify secure_computing() 2019-10-10 14:55:24 -07:00
reipl.S
relocate_kernel.S
runtime_instr.c
setup.c s390: avoid misusing CALL_ON_STACK for task stack setup 2019-11-30 10:52:45 +01:00
signal.c
smp.c s390: remove last diag 0x44 caller 2019-12-11 19:53:24 +01:00
stacktrace.c s390/livepatch: Implement reliable stack tracing for the consistency model 2019-11-30 10:52:48 +01:00
sthyi.c
suspend.c
swsusp.S
sys_s390.c
sysinfo.c
time.c s390/time: remove monotonic_clock() 2019-10-31 17:20:52 +01:00
topology.c
trace.c
traps.c
unwind_bc.c s390/unwind: stop gracefully at user mode pt_regs in irq stack 2019-12-18 23:29:26 +01:00
uprobes.c
vdso.c s390: remove compat vdso code 2019-12-01 12:48:49 +01:00
vmlinux.lds.S vmlinux.lds.h: Replace RW_DATA_SECTION with RW_DATA 2019-11-04 15:57:41 +01:00
vtime.c sched/cputime: Rename vtime_account_system() to vtime_account_kernel() 2019-10-09 12:39:25 +02:00