Zong Li
b3757ec3d9
clocksource: riscv: add notrace to riscv_sched_clock
commit 9d05c18e8d upstream.
When enabling ftrace graph tracer, it gets the tracing clock in
ftrace_push_return_trace(). Eventually, it invokes riscv_sched_clock()
to get the clock value. If riscv_sched_clock() isn't marked with
'notrace', it will call ftrace_push_return_trace() and cause infinite
loop.
The result of failure as follow:
command: echo function_graph >current_tracer
[ 46.176787] Unable to handle kernel paging request at virtual address ffffffe04fb38c48
[ 46.177309] Oops [#1]
[ 46.177478] Modules linked in:
[ 46.177770] CPU: 0 PID: 256 Comm: $d Not tainted 5.5.0-rc1 #47
[ 46.177981] epc: ffffffe00035e59a ra : ffffffe00035e57e sp : ffffffe03a7569b0
[ 46.178216] gp : ffffffe000d29b90 tp : ffffffe03a756180 t0 : ffffffe03a756968
[ 46.178430] t1 : ffffffe00087f408 t2 : ffffffe03a7569a0 s0 : ffffffe03a7569f0
[ 46.178643] s1 : ffffffe00087f408 a0 : 0000000ac054cda4 a1 : 000000000087f411
[ 46.178856] a2 : 0000000ac054cda4 a3 : 0000000000373ca0 a4 : ffffffe04fb38c48
[ 46.179099] a5 : 00000000153e22a8 a6 : 00000000005522ff a7 : 0000000000000005
[ 46.179338] s2 : ffffffe03a756a90 s3 : ffffffe00032811c s4 : ffffffe03a756a58
[ 46.179570] s5 : ffffffe000d29fe0 s6 : 0000000000000001 s7 : 0000000000000003
[ 46.179809] s8 : 0000000000000003 s9 : 0000000000000002 s10: 0000000000000004
[ 46.180053] s11: 0000000000000000 t3 : 0000003fc815749c t4 : 00000000000efc90
[ 46.180293] t5 : ffffffe000d29658 t6 : 0000000000040000
[ 46.180482] status: 0000000000000100 badaddr: ffffffe04fb38c48 cause: 000000000000000f
Signed-off-by: Zong Li <zong.li@sifive.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
[paul.walmsley@sifive.com: cleaned up patch description]
Fixes: 92e0d143fd ("clocksource/drivers/riscv_timer: Provide the sched_clock")
Cc: stable@vger.kernel.org
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-09 10:19:59 +01:00
..
2019-12-31 16:44:26 +01:00
2020-01-09 10:19:59 +01:00
2019-12-31 16:45:39 +01:00
2020-01-09 10:19:51 +01:00
2019-12-31 16:44:08 +01:00
2020-01-04 19:18:25 +01:00
2019-12-31 16:45:52 +01:00
2020-01-04 19:18:11 +01:00
2020-01-09 10:19:59 +01:00
2019-12-31 16:45:26 +01:00
2019-12-31 16:45:45 +01:00
2020-01-09 10:19:43 +01:00
2020-01-09 10:19:58 +01:00
2019-12-31 16:45:16 +01:00
2019-12-31 16:44:04 +01:00
2019-12-31 16:46:06 +01:00
2019-12-31 16:45:09 +01:00
2020-01-09 10:19:59 +01:00
2020-01-09 10:19:56 +01:00
2020-01-04 19:18:13 +01:00
2020-01-04 19:18:21 +01:00
2019-12-31 16:46:09 +01:00
2020-01-04 19:17:27 +01:00
2020-01-09 10:19:43 +01:00
2020-01-09 10:19:50 +01:00
2020-01-04 19:17:34 +01:00
2020-01-04 19:17:25 +01:00
2020-01-04 19:17:22 +01:00
2020-01-04 19:17:05 +01:00
2020-01-04 19:18:30 +01:00
2020-01-09 10:19:48 +01:00
2020-01-09 10:19:56 +01:00
2020-01-04 19:18:18 +01:00
2020-01-04 19:19:19 +01:00
2020-01-04 19:19:17 +01:00
2019-12-31 16:41:49 +01:00
2020-01-04 19:18:12 +01:00
2020-01-09 10:19:43 +01:00
2019-12-31 16:44:42 +01:00
2020-01-04 19:18:25 +01:00
2019-12-31 16:45:25 +01:00
2020-01-09 10:19:52 +01:00
2019-12-31 16:44:29 +01:00
2019-12-31 16:46:12 +01:00
2020-01-04 19:18:19 +01:00
2019-12-31 16:44:12 +01:00
2020-01-04 19:18:48 +01:00
2019-12-31 16:45:32 +01:00
2020-01-04 19:18:27 +01:00
2020-01-09 10:19:46 +01:00
2019-12-31 16:45:11 +01:00
2019-12-31 16:46:06 +01:00
2020-01-09 10:19:46 +01:00
2020-01-04 19:18:17 +01:00
2019-12-31 16:46:11 +01:00
2020-01-09 10:19:47 +01:00
2020-01-04 19:19:18 +01:00
2020-01-04 19:18:14 +01:00
2020-01-09 10:19:51 +01:00