projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1cabd2f
)
powerpc/kprobes: Emulate instructions on kprobe handler re-entry
author
Naveen N. Rao
<
[email protected]
>
Wed, 19 Apr 2017 12:51:05 +0000
(18:21 +0530)
committer
Michael Ellerman
<
[email protected]
>
Thu, 20 Apr 2017 13:18:56 +0000
(23:18 +1000)
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]
>
arch/powerpc/kernel/kprobes.c
patch
|
blob
|
history
diff --git
a/arch/powerpc/kernel/kprobes.c
b/arch/powerpc/kernel/kprobes.c
index ed5a917c2edd6d535414842a193a733990c57dc4..b71922618ed25f1d9e6fc8b257cb6554de84e2b1 100644
(file)
--- a/
arch/powerpc/kernel/kprobes.c
+++ b/
arch/powerpc/kernel/kprobes.c
@@
-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) {