OSDN Git Service

MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation
authorTiezhu Yang <yangtiezhu@loongson.cn>
Fri, 6 May 2022 11:02:03 +0000 (19:02 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Thu, 12 May 2022 16:00:51 +0000 (18:00 +0200)
commitf5e2d8186d5eafc809704fa1b25b5b753f50617c
treec8982a34789af2f348368801e36ea8fa2210b4a4
parenteab691b1a6841813e84abfc8cef392b67efdaede
MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation

If define CONFIG_KPROBES, __kprobes annotation forces the whole function
into the ".kprobes.text" section, NOKPROBE_SYMBOL() only stores the given
function address in the "_kprobe_blacklist" section which is introduced
to maintain kprobes blacklist.

Modify the related code to use NOKPROBE_SYMBOL() to protect functions from
kprobes instead of __kprobes annotation under arch/mips.

No obvious functional change in this patch, some more work needs to be done
to fix the kernel panic when execute the following testcase on mips:

  # cd tools/testing/selftests/ftrace
  # ./ftracetest test.d/kprobe/multiple_kprobes.tc

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/kprobes.c
arch/mips/mm/fault.c