diff options
author | Prasanna S Panchamukhi <prasanna@in.ibm.com> | 2005-06-23 03:09:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-23 12:45:24 -0400 |
commit | ea32c65cc2d2294c04e9f81d0578a6f51febfdbf (patch) | |
tree | b301766bcc903f982b0ae85b5edffe9477a65408 /kernel | |
parent | 89cb14c0dd0e4a7d0315d19f449389c4d49237ee (diff) |
[PATCH] kprobes: Temporary disarming of reentrant probe
In situations where a kprobes handler calls a routine which has a probe on it,
then kprobes_handler() disarms the new probe forever. This patch removes the
above limitation by temporarily disarming the new probe. When the another
probe hits while handling the old probe, the kprobes_handler() saves previous
kprobes state and handles the new probe without calling the new kprobes
registered handlers. kprobe_post_handler() restores back the previous kprobes
state and the normal execution continues.
However on x86_64 architecture, re-rentrancy is provided only through
pre_handler(). If a routine having probe is referenced through
post_handler(), then the probes on that routine are disarmed forever, since
the exception stack is gets changed after the processor single steps the
instruction of the new probe.
This patch includes generic changes to support temporary disarming on
reentrancy of probes.
Signed-of-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kprobes.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index dd42e717dd3..456ecedff2d 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -335,6 +335,7 @@ int register_kprobe(struct kprobe *p) | |||
335 | } | 335 | } |
336 | spin_lock_irqsave(&kprobe_lock, flags); | 336 | spin_lock_irqsave(&kprobe_lock, flags); |
337 | old_p = get_kprobe(p->addr); | 337 | old_p = get_kprobe(p->addr); |
338 | p->nmissed = 0; | ||
338 | if (old_p) { | 339 | if (old_p) { |
339 | ret = register_aggr_kprobe(old_p, p); | 340 | ret = register_aggr_kprobe(old_p, p); |
340 | goto out; | 341 | goto out; |