[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-6a5022a56ac37da7bffece043331a101ed0040b1@git.kernel.org>
Date: Thu, 24 Apr 2014 03:57:47 -0700
From: tip-bot for Masami Hiramatsu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
jkosina@...e.cz, masami.hiramatsu.pt@...achi.com,
rostedt@...dmis.org, jlebon@...hat.com, tglx@...utronix.de
Subject: [tip:perf/kprobes] kprobes/x86:
Allow to handle reentered kprobe on single-stepping
Commit-ID: 6a5022a56ac37da7bffece043331a101ed0040b1
Gitweb: http://git.kernel.org/tip/6a5022a56ac37da7bffece043331a101ed0040b1
Author: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
AuthorDate: Thu, 17 Apr 2014 17:16:51 +0900
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 24 Apr 2014 10:02:55 +0200
kprobes/x86: Allow to handle reentered kprobe on single-stepping
Since the NMI handlers(e.g. perf) can interrupt in the
single stepping (or preparing the single stepping, do_debug
etc.), we should consider a kprobe is hit in the NMI
handler. Even in that case, the kprobe is allowed to be
reentered as same as the kprobes hit in kprobe handlers
(KPROBE_HIT_ACTIVE or KPROBE_HIT_SSDONE).
The real issue will happen when a kprobe hit while another
reentered kprobe is processing (KPROBE_REENTER), because
we already consumed a saved-area for the previous kprobe.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Reviewed-by: Steven Rostedt <rostedt@...dmis.org>
Cc: Jiri Kosina <jkosina@...e.cz>
Cc: Jonathan Lebon <jlebon@...hat.com>
Link: http://lkml.kernel.org/r/20140417081651.26341.10593.stgit@ltc230.yrl.intra.hitachi.co.jp
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/kernel/kprobes/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 61b17dc..da7bdaa 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -531,10 +531,11 @@ reenter_kprobe(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb
switch (kcb->kprobe_status) {
case KPROBE_HIT_SSDONE:
case KPROBE_HIT_ACTIVE:
+ case KPROBE_HIT_SS:
kprobes_inc_nmissed_count(p);
setup_singlestep(p, regs, kcb, 1);
break;
- case KPROBE_HIT_SS:
+ case KPROBE_REENTER:
/* A probe has been hit in the codepath leading up to, or just
* after, single-stepping of a probed instruction. This entire
* codepath should strictly reside in .kprobes.text section.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists