summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/kprobes-ftrace.c
diff options
context:
space:
mode:
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>2017-10-23 22:07:39 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2017-11-12 23:51:41 +1100
commitf72180cc93a2c64d4efe0129fa2396ad78be80e3 (patch)
tree5bcb7d2e763cbd45bcedf15f99bf44ecdf0e1a7d /arch/powerpc/kernel/kprobes-ftrace.c
parent8a2d71a3f2737e2448aa68de2b6052cb570d3d2a (diff)
downloadlwn-f72180cc93a2c64d4efe0129fa2396ad78be80e3.tar.gz
lwn-f72180cc93a2c64d4efe0129fa2396ad78be80e3.zip
powerpc/kprobes: Do not disable interrupts for optprobes and kprobes_on_ftrace
Per Documentation/kprobes.txt, we don't necessarily need to disable interrupts before invoking the kprobe handlers. Masami submitted similar changes for x86 via commit a19b2e3d783964 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes"). Do the same for powerpc. 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/kprobes-ftrace.c')
-rw-r--r--arch/powerpc/kernel/kprobes-ftrace.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/kprobes-ftrace.c b/arch/powerpc/kernel/kprobes-ftrace.c
index 4b1f34f685b1..7a1f99f1b47f 100644
--- a/arch/powerpc/kernel/kprobes-ftrace.c
+++ b/arch/powerpc/kernel/kprobes-ftrace.c
@@ -75,11 +75,7 @@ void kprobe_ftrace_handler(unsigned long nip, unsigned long parent_nip,
{
struct kprobe *p;
struct kprobe_ctlblk *kcb;
- unsigned long flags;
- /* Disable irq for emulating a breakpoint and avoiding preempt */
- local_irq_save(flags);
- hard_irq_disable();
preempt_disable();
p = get_kprobe((kprobe_opcode_t *)nip);
@@ -105,16 +101,14 @@ void kprobe_ftrace_handler(unsigned long nip, unsigned long parent_nip,
else {
/*
* If pre_handler returns !0, it sets regs->nip and
- * resets current kprobe. In this case, we still need
- * to restore irq, but not preemption.
+ * resets current kprobe. In this case, we should not
+ * re-enable preemption.
*/
- local_irq_restore(flags);
return;
}
}
end:
preempt_enable_no_resched();
- local_irq_restore(flags);
}
NOKPROBE_SYMBOL(kprobe_ftrace_handler);