Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbbEGLJF (ORCPT ); Thu, 7 May 2015 07:09:05 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:48106 "EHLO e28smtp08.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbbEGLJD (ORCPT ); Thu, 7 May 2015 07:09:03 -0400 Date: Thu, 7 May 2015 16:38:52 +0530 From: Srikar Dronamraju To: Oleg Nesterov Cc: Ananth N Mavinakayanahalli , Anton Arapov , David Long , Denys Vlasenko , "Frank Ch. Eigler" , Ingo Molnar , Jan Willeke , Jim Keniston , Mark Wielaard , Pratyush Anand , linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/10] uprobes/x86: Introduce arch_uretprobe_is_alive() Message-ID: <20150507110852.GF30396@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20150504124835.GA22462@redhat.com> <20150504124914.GA22512@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20150504124914.GA22512@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050711-0029-0000-0000-000005BA38D5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 41 > > diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h > index f011fd0..60777f3 100644 > --- a/arch/x86/include/asm/uprobes.h > +++ b/arch/x86/include/asm/uprobes.h > @@ -57,6 +57,7 @@ struct arch_uprobe { > }; > > struct arch_uretprobe { > + unsigned long sp; While this looks good, I was wondering if you did think of having the sp in the return_instance structure itself. I mean can we use user_stack_pointer() to populate the ri->sp? In which case the weak function itself should suffice for most archs. Something like this. prepare_uretprobe() we can have ri->sp = user_stack_pointer(regs) and handle_trampoline() would call something like arch_uretprobe_is_alive(next->sp, regs); bool __weak arch_uretprobe_is_alive(unsigned long sp, struct pt_regs *regs) { return user_stack_pointer(regs) <= sp; } Am I missing something? > -- Thanks and Regards Srikar Dronamraju -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/