]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Add trampoline code for kretprobes
authorWilliam Cohen <wcohen@redhat.com>
Fri, 8 Jul 2016 16:35:52 +0000 (12:35 -0400)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 19 Jul 2016 14:03:22 +0000 (15:03 +0100)
commit955a7ae4415fa6d12a4ca953c9dfd37f6c056736
tree725a7b6d7c2b67a7b90e2270f04a0303232a9cc3
parent54944263c23229355eb9484524acd15883a10455
arm64: Add trampoline code for kretprobes

The trampoline code is used by kretprobes to capture a return from a probed
function.  This is done by saving the registers, calling the handler, and
restoring the registers. The code then returns to the original saved caller
return address. It is necessary to do this directly instead of using a
software breakpoint because the code used in processing that breakpoint
could itself be kprobe'd and cause a problematic reentry into the debug
exception handler.

Signed-off-by: William Cohen <wcohen@redhat.com>
Signed-off-by: David A. Long <dave.long@linaro.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
[catalin.marinas@arm.com: removed unnecessary masking of the PSTATE bits]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/kprobes.h
arch/arm64/kernel/asm-offsets.c
arch/arm64/kernel/probes/Makefile
arch/arm64/kernel/probes/kprobes.c
arch/arm64/kernel/probes/kprobes_trampoline.S [new file with mode: 0644]