]> www.infradead.org Git - users/jedix/linux-maple.git/commit
powerpc: Replace kretprobe code with rethook on powerpc
authorAbhishek Dubey <adubey@linux.ibm.com>
Fri, 30 Aug 2024 11:31:31 +0000 (07:31 -0400)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 5 Sep 2024 12:25:36 +0000 (22:25 +1000)
commit19f1bc3fb55452739dd3d56cfd06c29ecdbe3e9f
treef10906e3149bc2337ca8001710986338eabfa383
parent6f2683274d0d0b51a986f73c2afb9058156f1641
powerpc: Replace kretprobe code with rethook on powerpc

This is an adaptation of commit f3a112c0c40d ("x86,rethook,kprobes:
Replace kretprobe with rethook on x86") to powerpc.

Rethook follows the existing kretprobe implementation, but separates
it from kprobes so that it can be used by fprobe (ftrace-based
function entry/exit probes). As such, this patch also enables fprobe
to work on powerpc. The only other change compared to the existing
kretprobe implementation is doing the return address fixup in
arch_rethook_fixup_return().

Reference to other archs:
commit b57c2f124098 ("riscv: add riscv rethook implementation")
commit 7b0a096436c2 ("LoongArch: Replace kretprobe with rethook")

Note:
=====

In future, rethook will be only for kretprobe, and kretprobe
will be replaced by fprobe.

https://lore.kernel.org/all/172000134410.63468.13742222887213469474.stgit@devnote2/

We will adapt the above implementation for powerpc once its upstream.
Until then, we can have this implementation of rethook to serve
current kretprobe usecases.

Reviewed-by: Naveen Rao <naveen@kernel.org>
Signed-off-by: Abhishek Dubey <adubey@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240830113131.7597-1-adubey@linux.ibm.com
arch/powerpc/Kconfig
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/kprobes.c
arch/powerpc/kernel/optprobes.c
arch/powerpc/kernel/rethook.c [new file with mode: 0644]
arch/powerpc/kernel/stacktrace.c