]> git.baikalelectronics.ru Git - kernel.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)
commit25f4e42b3f7ffbb2fe5b5533b3b031e8af7dc367
tree1122c249e13dcfee286d7807f4625a74da19e079
parentd4c5c2933aaf6026c109078a69423d8b0c3cf0f9
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: 5210b1369a62 ("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