]> 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)
commitdf482c9b604ddc18f2f9e281bd8625a087c60678
tree1122c249e13dcfee286d7807f4625a74da19e079
parent75a4dd86a3438369bec6a6a1737ca6d0ed6e9bb7
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: 8783ca12b8e6 ("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