aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/kprobes.h
diff options
context:
space:
mode:
authorTobias Huschle <huschle@linux.ibm.com>2022-02-21 12:55:52 +0100
committerVasily Gorbik <gor@linux.ibm.com>2022-03-10 15:58:17 +0100
commit63bf38ff5bc3d8cee6c6a089657876d0b669cae1 (patch)
tree7551b4e8820713493acbf93a348fecd33535504a /arch/s390/include/asm/kprobes.h
parents390: convert ".insn" encoding to instruction names (diff)
downloadlinux-dev-63bf38ff5bc3d8cee6c6a089657876d0b669cae1.tar.xz
linux-dev-63bf38ff5bc3d8cee6c6a089657876d0b669cae1.zip
s390/kprobes: Avoid additional kprobe in kretprobe handling
So far, s390 registered a krobe on __kretprobe_trampoline which is called everytime a kretprobe fires. This kprobe would then determine the correct return address and adjust the psw accordingly, such that the kretprobe would branch to the appropriate address after completion. Some other archs handle kretprobes without such an additional kprobe. This approach is adopted to s390 with this patch. Furthermore, the __kretprobe_trampoline now uses an assembler function to correctly gather the register and psw content to be passed to the registered kretprobe handler as struct pt_regs. After completion, the register content and the psw are set based on the contents of said pt_regs struct. Note that a change to the psw address in struct pt_regs will not have an impact, as the probe will still return to the original return address of the probed function. The return address is now recovered by using the appropriate function arch_kretprobe_fixup_return. The no longer needed kprobe is removed. Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Tobias Huschle <huschle@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/kprobes.h')
-rw-r--r--arch/s390/include/asm/kprobes.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/s390/include/asm/kprobes.h b/arch/s390/include/asm/kprobes.h
index 5eb722c984e4..598095f4b924 100644
--- a/arch/s390/include/asm/kprobes.h
+++ b/arch/s390/include/asm/kprobes.h
@@ -71,6 +71,7 @@ struct kprobe_ctlblk {
void arch_remove_kprobe(struct kprobe *p);
void __kretprobe_trampoline(void);
+void trampoline_probe_handler(struct pt_regs *regs);
int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
int kprobe_exceptions_notify(struct notifier_block *self,