lkml.org 
[lkml]   [2011]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 8/X] uprobes: kill sstep_complete()
Kill sstep_complete(), change uprobe_notify_resume() to use post_xol()
unconditionally.

As we already discussed, it is wrong to assume that regs->ip always
changes after the step. rep or jmp/call to self for example. We know
that this task has already done the step, we can rely on DIE_DEBUG
notification.
---
kernel/uprobes.c | 37 +++++++++----------------------------
1 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/kernel/uprobes.c b/kernel/uprobes.c
index a323e0a..135b9a2 100644
--- a/kernel/uprobes.c
+++ b/kernel/uprobes.c
@@ -1321,24 +1321,6 @@ static int pre_ssout(struct uprobe *uprobe, struct pt_regs *regs,
}

/*
- * Verify from Instruction Pointer if singlestep has indeed occurred.
- * If Singlestep has occurred, then do post singlestep fix-ups.
- */
-static bool sstep_complete(struct uprobe *uprobe, struct pt_regs *regs)
-{
- unsigned long vaddr = instruction_pointer(regs);
-
- /*
- * If we have executed out of line, Instruction pointer
- * cannot be same as virtual address of XOL slot.
- */
- if (vaddr == current->utask->xol_vaddr)
- return false;
- post_xol(uprobe, regs);
- return true;
-}
-
-/*
* uprobe_notify_resume gets called in task context just before returning
* to userspace.
*
@@ -1374,7 +1356,7 @@ void uprobe_notify_resume(struct pt_regs *regs)
if (!utask)
goto cleanup_ret;
}
- /* TODO Start queueing signals. */
+
utask->active_uprobe = u;
handler_chain(u, regs);
utask->state = UTASK_SSTEP;
@@ -1385,15 +1367,14 @@ void uprobe_notify_resume(struct pt_regs *regs)
goto cleanup_ret;
} else if (utask->state == UTASK_SSTEP) {
u = utask->active_uprobe;
- if (sstep_complete(u, regs)) {
- put_uprobe(u);
- utask->active_uprobe = NULL;
- utask->state = UTASK_RUNNING;
- user_disable_single_step(current);
- xol_free_insn_slot(current);
-
- /* TODO Stop queueing signals. */
- }
+
+ post_xol(u, regs); /* TODO: check result? */
+
+ put_uprobe(u);
+ utask->active_uprobe = NULL;
+ utask->state = UTASK_RUNNING;
+ user_disable_single_step(current);
+ xol_free_insn_slot(current);
}
return;

--
1.5.5.1



\
 
 \ /
  Last update: 2011-10-19 23:59    [W:0.186 / U:2.912 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site