mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 00:43:12 +00:00
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: Ananth N Mavinakayanahalli <[email protected]> Signed-off-by: Naveen N. Rao <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
This commit is contained in:
committed by
Michael Ellerman
parent
1cabd2f8f7
commit
22d8b3dec2
@@ -277,6 +277,14 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
|
||||
kprobes_inc_nmissed_count(p);
|
||||
prepare_singlestep(p, regs);
|
||||
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;
|
||||
} else {
|
||||
if (*addr != BREAKPOINT_INSTRUCTION) {
|
||||
|
||||
Reference in New Issue
Block a user