From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751289AbZH0RWM (ORCPT ); Thu, 27 Aug 2009 13:22:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751234AbZH0RWK (ORCPT ); Thu, 27 Aug 2009 13:22:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30620 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbZH0RWH (ORCPT ); Thu, 27 Aug 2009 13:22:07 -0400 From: Masami Hiramatsu Subject: [PATCH -tip tracing/kprobes 2/6] kprobes/x86-64: Allow to reenter probe on post_handler To: Frederic Weisbecker , Ingo Molnar , lkml Cc: systemtap , DLE , Masami Hiramatsu , Frederic Weisbecker , Ananth N Mavinakayanahalli , Ingo Molnar Date: Thu, 27 Aug 2009 13:23:04 -0400 Message-ID: <20090827172304.8246.4822.stgit@localhost.localdomain> In-Reply-To: <20090827152539.GE6058@nowhere> References: <20090827152539.GE6058@nowhere> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow to reenter probe on the post_handler of another probe on x86-64, because x86-64 already allows reentering int3. In that case, reentered probe just increases kp.nmissed and returns. Signed-off-by: Masami Hiramatsu Cc: Frederic Weisbecker Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index e0fb615..c5f1f11 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c @@ -463,17 +463,6 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs, { switch (kcb->kprobe_status) { case KPROBE_HIT_SSDONE: -#ifdef CONFIG_X86_64 - /* TODO: Provide re-entrancy from post_kprobes_handler() and - * avoid exception stack corruption while single-stepping on - * the instruction of the new probe. - */ - arch_disarm_kprobe(p); - regs->ip = (unsigned long)p->addr; - reset_current_kprobe(); - preempt_enable_no_resched(); - break; -#endif case KPROBE_HIT_ACTIVE: save_previous_kprobe(kcb); set_current_kprobe(p, regs, kcb); -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com