summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/Makefile
diff options
context:
space:
mode:
authorAnju T <anju@linux.vnet.ibm.com>2017-02-08 15:20:51 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2017-02-10 13:28:04 +1100
commit51c9c0843993528bffc920c54c2121d9e6f8b090 (patch)
tree1ffd280d9ca0ce51faaa957d23c1e217ee0e2e20 /arch/powerpc/kernel/Makefile
parent30176466e36aadba01e1a630cf42397a3438efa4 (diff)
downloadlinux-51c9c0843993528bffc920c54c2121d9e6f8b090.tar.gz
linux-51c9c0843993528bffc920c54c2121d9e6f8b090.tar.bz2
linux-51c9c0843993528bffc920c54c2121d9e6f8b090.zip
powerpc/kprobes: Implement Optprobes
Current infrastructure of kprobe uses the unconditional trap instruction to probe a running kernel. Optprobe allows kprobe to replace the trap with a branch instruction to a detour buffer. Detour buffer contains instructions to create an in memory pt_regs. Detour buffer also has a call to optimized_callback() which in turn call the pre_handler(). After the execution of the pre-handler, a call is made for instruction emulation. The NIP is determined in advanced through dummy instruction emulation and a branch instruction is created to the NIP at the end of the trampoline. To address the limitation of branch instruction in POWER architecture, detour buffer slot is allocated from a reserved area. For the time being, 64KB is reserved in memory for this purpose. Instructions which can be emulated using analyse_instr() are the candidates for optimization. Before optimization ensure that the address range between the detour buffer allocated and the instruction being probed is within +/- 32MB. Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/Makefile')
-rw-r--r--arch/powerpc/kernel/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index f4898e6ad18d..a048b37b9b27 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -100,6 +100,7 @@ obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_BOOTX_TEXT) += btext.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_KPROBES) += kprobes.o
+obj-$(CONFIG_OPTPROBES) += optprobes.o optprobes_head.o
obj-$(CONFIG_UPROBES) += uprobes.o
obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o