Commit 22d8b3de authored by Naveen N. Rao's avatar Naveen N. Rao Committed by Michael Ellerman

powerpc/kprobes: Emulate instructions on kprobe handler re-entry

On kprobe handler re-entry, try to emulate the instruction rather than single
stepping always.
Acked-by: default avatarAnanth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 1cabd2f8
...@@ -277,6 +277,14 @@ int __kprobes kprobe_handler(struct pt_regs *regs) ...@@ -277,6 +277,14 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
kprobes_inc_nmissed_count(p); kprobes_inc_nmissed_count(p);
prepare_singlestep(p, regs); prepare_singlestep(p, regs);
kcb->kprobe_status = KPROBE_REENTER; kcb->kprobe_status = KPROBE_REENTER;
if (p->ainsn.boostable >= 0) {
ret = try_to_emulate(p, regs);
if (ret > 0) {
restore_previous_kprobe(kcb);
return 1;
}
}
return 1; return 1;
} else { } else {
if (*addr != BREAKPOINT_INSTRUCTION) { if (*addr != BREAKPOINT_INSTRUCTION) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment