|
@@ -25,36 +25,6 @@
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
-static nokprobe_inline
|
|
|
-void __skip_singlestep(struct kprobe *p, struct pt_regs *regs,
|
|
|
- struct kprobe_ctlblk *kcb, unsigned long orig_ip)
|
|
|
-{
|
|
|
- /*
|
|
|
- * Emulate singlestep (and also recover regs->ip)
|
|
|
- * as if there is a 5byte nop
|
|
|
- */
|
|
|
- regs->ip = (unsigned long)p->addr + MCOUNT_INSN_SIZE;
|
|
|
- if (unlikely(p->post_handler)) {
|
|
|
- kcb->kprobe_status = KPROBE_HIT_SSDONE;
|
|
|
- p->post_handler(p, regs, 0);
|
|
|
- }
|
|
|
- __this_cpu_write(current_kprobe, NULL);
|
|
|
- if (orig_ip)
|
|
|
- regs->ip = orig_ip;
|
|
|
-}
|
|
|
-
|
|
|
-int skip_singlestep(struct kprobe *p, struct pt_regs *regs,
|
|
|
- struct kprobe_ctlblk *kcb)
|
|
|
-{
|
|
|
- if (kprobe_ftrace(p)) {
|
|
|
- __skip_singlestep(p, regs, kcb, 0);
|
|
|
- preempt_enable_no_resched();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-NOKPROBE_SYMBOL(skip_singlestep);
|
|
|
-
|
|
|
/* Ftrace callback handler for kprobes -- called under preepmt disabed */
|
|
|
void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
|
|
|
struct ftrace_ops *ops, struct pt_regs *regs)
|
|
@@ -80,7 +50,17 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
|
|
|
__this_cpu_write(current_kprobe, p);
|
|
|
kcb->kprobe_status = KPROBE_HIT_ACTIVE;
|
|
|
if (!p->pre_handler || !p->pre_handler(p, regs)) {
|
|
|
- __skip_singlestep(p, regs, kcb, orig_ip);
|
|
|
+ /*
|
|
|
+ * Emulate singlestep (and also recover regs->ip)
|
|
|
+ * as if there is a 5byte nop
|
|
|
+ */
|
|
|
+ regs->ip = (unsigned long)p->addr + MCOUNT_INSN_SIZE;
|
|
|
+ if (unlikely(p->post_handler)) {
|
|
|
+ kcb->kprobe_status = KPROBE_HIT_SSDONE;
|
|
|
+ p->post_handler(p, regs, 0);
|
|
|
+ }
|
|
|
+ regs->ip = orig_ip;
|
|
|
+ __this_cpu_write(current_kprobe, NULL);
|
|
|
preempt_enable_no_resched();
|
|
|
}
|
|
|
/*
|