Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350089
b: refs/heads/master
c: 74e59df
h: refs/heads/master
i:
  350087: fdc4f80
v: v3
  • Loading branch information
Oleg Nesterov committed Feb 8, 2013
1 parent ddbb299 commit e9d0283
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf31ec3f7fece93f3fce3ee5964e27857141ea47
refs/heads/master: 74e59dfc6b19e3472a7c16ad57bc831e6e647895
1 change: 0 additions & 1 deletion trunk/arch/x86/kernel/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ static bool __skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
continue;

if (auprobe->insn[i] == 0x90) {
regs->ip = uprobe_get_swbp_addr(regs);
regs->ip += i + 1;
return true;
}
Expand Down
15 changes: 7 additions & 8 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,21 +1504,25 @@ static void handle_swbp(struct pt_regs *regs)
}
return;
}

/* change it in advance for ->handler() and restart */
instruction_pointer_set(regs, bp_vaddr);

/*
* TODO: move copy_insn/etc into _register and remove this hack.
* After we hit the bp, _unregister + _register can install the
* new and not-yet-analyzed uprobe at the same address, restart.
*/
smp_rmb(); /* pairs with wmb() in install_breakpoint() */
if (unlikely(!test_bit(UPROBE_COPY_INSN, &uprobe->flags)))
goto restart;
goto out;

utask = current->utask;
if (!utask) {
utask = add_utask();
/* Cannot allocate; re-execute the instruction. */
if (!utask)
goto restart;
goto out;
}

handler_chain(uprobe, regs);
Expand All @@ -1531,12 +1535,7 @@ static void handle_swbp(struct pt_regs *regs)
return;
}

restart:
/*
* cannot singlestep; cannot skip instruction;
* re-execute the instruction.
*/
instruction_pointer_set(regs, bp_vaddr);
/* can_skip_sstep() succeeded, or restart if can't singlestep */
out:
put_uprobe(uprobe);
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/trace/trace_uprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static void uprobe_trace_func(struct trace_uprobe *tu, struct pt_regs *regs)
return;

entry = ring_buffer_event_data(event);
entry->ip = uprobe_get_swbp_addr(task_pt_regs(current));
entry->ip = instruction_pointer(task_pt_regs(current));
data = (u8 *)&entry[1];
for (i = 0; i < tu->nr_args; i++)
call_fetch(&tu->args[i].fetch, regs, data + tu->args[i].offset);
Expand Down Expand Up @@ -667,7 +667,7 @@ static void uprobe_perf_func(struct trace_uprobe *tu, struct pt_regs *regs)
if (!entry)
goto out;

entry->ip = uprobe_get_swbp_addr(task_pt_regs(current));
entry->ip = instruction_pointer(task_pt_regs(current));
data = (u8 *)&entry[1];
for (i = 0; i < tu->nr_args; i++)
call_fetch(&tu->args[i].fetch, regs, data + tu->args[i].offset);
Expand Down

0 comments on commit e9d0283

Please sign in to comment.