mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
33e53ae1ce
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>
20 lines
312 B
ArmAsm
20 lines
312 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
#include <abi/entry.h>
|
|
|
|
ENTRY(kretprobe_trampoline)
|
|
SAVE_REGS_FTRACE
|
|
|
|
mov a0, sp /* pt_regs */
|
|
|
|
jbsr trampoline_probe_handler
|
|
|
|
/* use the result as the return-address */
|
|
mov lr, a0
|
|
|
|
RESTORE_REGS_FTRACE
|
|
rts
|
|
ENDPROC(kretprobe_trampoline)
|