]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MIPS: ftrace: fix init functions tracing
authorMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Tue, 23 May 2017 10:56:43 +0000 (12:56 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 8 Jun 2017 12:51:59 +0000 (14:51 +0200)
commit87051ec120bb9abd9e57aecf2569c00d587b6f33
tree1122c249e13dcfee286d7807f4625a74da19e079
parentc56e7a4c3e77f6fbd9b55c06c14eda65aae58958
MIPS: ftrace: fix init functions tracing

Since introduction of tracing for init functions the in_kernel_space()
check is no longer correct, as it ignores the init sections. As a
result, when probes are inserted (and disabled) in the init functions,
a branch instruction is inserted instead of a nop, which is likely to
result in random crashes during boot.

Remove the MIPS-specific in_kernel_space() method and replace it with a
generic core_kernel_text() that also checks for init sections during
system boot stage.

Fixes: 42c269c88dc1 ("ftrace: Allow for function tracing to record init functions on boot up")
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Tested-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16092/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/ftrace.c