From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011Ab1A0JrY (ORCPT ); Thu, 27 Jan 2011 04:47:24 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:59397 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753872Ab1A0JrW (ORCPT ); Thu, 27 Jan 2011 04:47:22 -0500 Date: Thu, 27 Jan 2011 15:10:41 +0530 From: Srikar Dronamraju To: Peter Zijlstra Cc: Ingo Molnar , Steven Rostedt , Arnaldo Carvalho de Melo , Linus Torvalds , Masami Hiramatsu , Christoph Hellwig , Andi Kleen , Oleg Nesterov , Andrew Morton , SystemTap , Jim Keniston , Frederic Weisbecker , Ananth N Mavinakayanahalli , LKML , Roland McGrath , "Paul E. McKenney" Subject: Re: [RFC] [PATCH 2.6.37-rc5-tip 13/20] 13: x86: x86 specific probe handling Message-ID: <20110127094041.GR19725@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20101216095714.23751.52601.sendpatchset@localhost6.localdomain6> <20101216095947.23751.75003.sendpatchset@localhost6.localdomain6> <1295963783.28776.1061.camel@laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1295963783.28776.1061.camel@laptop> User-Agent: Mutt/1.5.20 (2009-06-14) X-Content-Scanned: Fidelis XPS MAILER Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra [2011-01-25 14:56:22]: > On Thu, 2010-12-16 at 15:29 +0530, Srikar Dronamraju wrote: > > > > +void arch_uprobe_enable_sstep(struct pt_regs *regs) > > +{ > > + /* > > + * Enable single-stepping by > > + * - Set TF on stack > > + * - Set TIF_SINGLESTEP: Guarantees that TF is set when > > + * returning to user mode. > > + * - Indicate that TF is set by us. > > + */ > > + regs->flags |= X86_EFLAGS_TF; > > + set_thread_flag(TIF_SINGLESTEP); > > + set_thread_flag(TIF_FORCED_TF); > > +} > > + > > +void arch_uprobe_disable_sstep(struct pt_regs *regs) > > +{ > > + /* Disable single-stepping by clearing what we set */ > > + clear_thread_flag(TIF_SINGLESTEP); > > + clear_thread_flag(TIF_FORCED_TF); > > + regs->flags &= ~X86_EFLAGS_TF; > > +} > > Why not use the code from arch/x86/kernel/step.c? user_enable_single_step and user_disable_single_step that are defined in arch/x86/kernel/step.c cant be called in interrupt context. Initially we were looking at enabling/disabling singlestep in interrupt context. Even now we disable singlestep in post notifier in interrupt context. Though arch/x86/kernel/step.c has a static function enable_single_step which is identical to arch_uprobe_enable_sstep; there is no equivalent function for arch_uprobe_disable_sstep. -- Thanks and Regards Srikar