]> git.baikalelectronics.ru Git - kernel.git/commit
csky: Add kprobes supported
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 1 Apr 2020 01:17:02 +0000 (09:17 +0800)
committerGuo Ren <guoren@linux.alibaba.com>
Fri, 3 Apr 2020 03:14:17 +0000 (11:14 +0800)
commit23f2eee78479d455d0849f0eddb52568c9fe6313
treedd6ddbf5a1707f1d0351143cedc00147a465abf4
parent422cbca3474ccb6dbc6a29d167d921ca653567ca
csky: Add kprobes supported

This patch enable kprobes, kretprobes, ftrace interface. It utilized
software breakpoint and single step debug exceptions, instructions
simulation on csky.

We use USR_BKPT replace origin instruction, and the kprobe handler
prepares an excutable memory slot for out-of-line execution with a
copy of the original instruction being probed. Most of instructions
could be executed by single-step, but some instructions need origin
pc value to execute and we need software simulate these instructions.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
16 files changed:
arch/csky/Kconfig
arch/csky/include/asm/Kbuild
arch/csky/include/asm/kprobes.h [new file with mode: 0644]
arch/csky/include/asm/probes.h [new file with mode: 0644]
arch/csky/include/asm/ptrace.h
arch/csky/kernel/Makefile
arch/csky/kernel/probes/Makefile [new file with mode: 0644]
arch/csky/kernel/probes/decode-insn.c [new file with mode: 0644]
arch/csky/kernel/probes/decode-insn.h [new file with mode: 0644]
arch/csky/kernel/probes/ftrace.c [new file with mode: 0644]
arch/csky/kernel/probes/kprobes.c [new file with mode: 0644]
arch/csky/kernel/probes/kprobes_trampoline.S [new file with mode: 0644]
arch/csky/kernel/probes/simulate-insn.c [new file with mode: 0644]
arch/csky/kernel/probes/simulate-insn.h [new file with mode: 0644]
arch/csky/kernel/traps.c
arch/csky/mm/fault.c