summaryrefslogtreecommitdiff
path: root/arch/loongarch/kernel/kprobes.c
diff options
context:
space:
mode:
authorHaoran Jiang <jianghaoran@kylinos.cn>2023-06-29 20:58:44 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-06-29 20:58:44 +0800
commit7b0a096436c2dac6de77d132e751a8a3328798d5 (patch)
tree2cfddd47c9438bc1ba0241836a22033f4473b627 /arch/loongarch/kernel/kprobes.c
parentf02644e32c9e4bd1a9b286dc0b84f9cbe294f4e2 (diff)
LoongArch: Replace kretprobe with rethook
This is an adaptation of commit f3a112c0c40d ("x86,rethook,kprobes: Replace kretprobe with rethook on x86") and commit b57c2f124098 ("riscv: add riscv rethook implementation") to LoongArch. Mainly refer to commit b57c2f124098 ("riscv: add riscv rethook implementation"). Replaces the kretprobe code with rethook on LoongArch. With this patch, kretprobe on LoongArch uses the rethook instead of kretprobe specific trampoline code. Signed-off-by: Haoran Jiang <jianghaoran@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/kprobes.c')
-rw-r--r--arch/loongarch/kernel/kprobes.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/arch/loongarch/kernel/kprobes.c b/arch/loongarch/kernel/kprobes.c
index 56c8c4b09a42..83467232ca3c 100644
--- a/arch/loongarch/kernel/kprobes.c
+++ b/arch/loongarch/kernel/kprobes.c
@@ -378,27 +378,6 @@ int __init arch_init_kprobes(void)
return 0;
}
-/* ASM function that handles the kretprobes must not be probed */
-NOKPROBE_SYMBOL(__kretprobe_trampoline);
-
-/* Called from __kretprobe_trampoline */
-void __used *trampoline_probe_handler(struct pt_regs *regs)
-{
- return (void *)kretprobe_trampoline_handler(regs, NULL);
-}
-NOKPROBE_SYMBOL(trampoline_probe_handler);
-
-void arch_prepare_kretprobe(struct kretprobe_instance *ri,
- struct pt_regs *regs)
-{
- ri->ret_addr = (kprobe_opcode_t *)regs->regs[1];
- ri->fp = NULL;
-
- /* Replace the return addr with trampoline addr */
- regs->regs[1] = (unsigned long)&__kretprobe_trampoline;
-}
-NOKPROBE_SYMBOL(arch_prepare_kretprobe);
-
int arch_trampoline_kprobe(struct kprobe *p)
{
return 0;