summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/mcount64.S
diff options
context:
space:
mode:
authorHeiko Carstens2013-05-13 14:48:52 +0200
committerMartin Schwidefsky2013-05-15 13:09:09 +0200
commitaca91209775514b5a335e7ef11f1d636618590c7 (patch)
treed2bc7248e2a4451e0a68c1680106770ad64874eb /arch/s390/kernel/mcount64.S
parents390: fix gmap_ipte_notifier vs. software dirty pages (diff)
downloadkernel-qcow2-linux-aca91209775514b5a335e7ef11f1d636618590c7.tar.gz
kernel-qcow2-linux-aca91209775514b5a335e7ef11f1d636618590c7.tar.xz
kernel-qcow2-linux-aca91209775514b5a335e7ef11f1d636618590c7.zip
s390/ftrace: fix mcount adjustment
Tony Jones reported that the ftrace self tests on s390 do not work: <6>Testing dynamic ftrace ops #1: (0 0 0 0 0) FAILED! <6>Testing tracer irqsoff: <3>failed to start irqsoff tracer <4>.. no entries found ..FAILED! <6>Testing tracer wakeup: <3>failed to start wakeup tracer <4>.. no entries found ..FAILED! <6>Testing tracer function_graph: <4>Failed to init function_graph tracer, init returned -19 <4>FAILED! This happens because we forgot to adjust the instruction pointer that gets passed to the ftrace trace function by MCOUNT_INSN_SIZE. In addition change MCOUNT_INSN_SIZE to the correct value on 31 bit. It only worked so far because the to be patched instruction was identical. Reported-by: Tony Jones <tonyj@suse.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/mcount64.S')
-rw-r--r--arch/s390/kernel/mcount64.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/kernel/mcount64.S b/arch/s390/kernel/mcount64.S
index 11332193db30..1c52eae3396a 100644
--- a/arch/s390/kernel/mcount64.S
+++ b/arch/s390/kernel/mcount64.S
@@ -7,6 +7,7 @@
#include <linux/linkage.h>
#include <asm/asm-offsets.h>
+#include <asm/ftrace.h>
.section .kprobes.text, "ax"
@@ -29,6 +30,7 @@ ENTRY(ftrace_caller)
stg %r1,__SF_BACKCHAIN(%r15)
lgr %r2,%r14
lg %r3,168(%r15)
+ aghi %r2,-MCOUNT_INSN_SIZE
larl %r14,ftrace_trace_function
lg %r14,0(%r14)
basr %r14,%r14