kernel/extable.c: mark core_kernel_text notrace
authorMarcin Nowakowski <[email protected]>
Thu, 6 Jul 2017 22:35:31 +0000 (15:35 -0700)
committerLinus Torvalds <[email protected]>
Thu, 6 Jul 2017 23:24:29 +0000 (16:24 -0700)
core_kernel_text is used by MIPS in its function graph trace processing,
so having this method traced leads to an infinite set of recursive calls
such as:

  Call Trace:
     ftrace_return_to_handler+0x50/0x128
     core_kernel_text+0x10/0x1b8
     prepare_ftrace_return+0x6c/0x114
     ftrace_graph_caller+0x20/0x44
     return_to_handler+0x10/0x30
     return_to_handler+0x0/0x30
     return_to_handler+0x0/0x30
     ftrace_ops_no_ops+0x114/0x1bc
     core_kernel_text+0x10/0x1b8
     core_kernel_text+0x10/0x1b8
     core_kernel_text+0x10/0x1b8
     ftrace_ops_no_ops+0x114/0x1bc
     core_kernel_text+0x10/0x1b8
     prepare_ftrace_return+0x6c/0x114
     ftrace_graph_caller+0x20/0x44
     (...)

Mark the function notrace to avoid it being traced.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Marcin Nowakowski <[email protected]>
Reviewed-by: Masami Hiramatsu <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Meyer <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/extable.c

index 0fbdd8582f0879c7c72d18e681a0d7eb59fcc809..223df4a328a49873e0c4754246f4756d1d16188b 100644 (file)
@@ -69,7 +69,7 @@ static inline int init_kernel_text(unsigned long addr)
        return 0;
 }
 
-int core_kernel_text(unsigned long addr)
+int notrace core_kernel_text(unsigned long addr)
 {
        if (addr >= (unsigned long)_stext &&
            addr < (unsigned long)_etext)