From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbaEHGQR (ORCPT ); Thu, 8 May 2014 02:16:17 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:46126 "EHLO e9.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbaEHGQP (ORCPT ); Thu, 8 May 2014 02:16:15 -0400 Date: Thu, 8 May 2014 11:46:58 +0530 From: Ananth N Mavinakayanahalli To: Masami Hiramatsu Cc: Benjamin Herrenschmidt , Paul Mackerras , Tony Luck , Jeremy Fitzhardinge , linux-ia64@vger.kernel.org, sparse@chrisli.org, "H. Peter Anvin" , Thomas Gleixner , linux-tip-commits@vger.kernel.org, anil.s.keshavamurthy@intel.com, Ingo Molnar , Fenghua Yu , Arnd Bergmann , Rusty Russell , Chris Wright , yrl.pp-manager.tt@hitachi.com, akataria@vmware.com, Tony Luck , Kevin Hao , linuxppc-dev@lists.ozlabs.org, rdunlap@infradead.org, Linux Kernel Mailing List , dl9pf@gmx.de, Andrew Morton , Linus Torvalds , "David S. Miller" Subject: Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64 Message-ID: <20140508061658.GA2384@in.ibm.com> Reply-To: ananth@in.ibm.com References: <536A16A6.5040709@hitachi.com> <20140507115551.22259.70581.stgit@ltc230.yrl.intra.hitachi.co.jp> <20140508044753.GA13413@in.ibm.com> <536B18B0.9060209@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <536B18B0.9060209@hitachi.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14050806-7182-0000-0000-00000A87F819 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 08, 2014 at 02:40:00PM +0900, Masami Hiramatsu wrote: > (2014/05/08 13:47), Ananth N Mavinakayanahalli wrote: > > On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote: > > > > ... > > > >> +#if defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF == 1) > >> +/* > >> + * On PPC64 ABIv1 the function pointer actually points to the > >> + * function's descriptor. The first entry in the descriptor is the > >> + * address of the function text. > >> + */ > >> +#define constant_function_entry(fn) (((func_descr_t *)(fn))->entry) > >> +#else > >> +#define constant_function_entry(fn) ((unsigned long)(fn)) > >> +#endif > >> + > >> #endif /* __ASSEMBLY__ */ > > > > Hi Masami, > > > > You could just use ppc_function_entry() instead. > > No, I think ppc_function_entry() has two problems (on the latest -next kernel) > > At first, that is an inlined functions which is not applied in build time. > Since the NOKPROBE_SYMBOL() is used outside of any functions as like as > EXPORT_SYMBOL(), we can only use preprocessed macros. > Next, on PPC64 ABI*v2*, ppc_function_entry() returns local function entry, > which seems global function entry + 2 insns. I'm not sure about implementation > of the kallsyms on PPC64 ABIv2, but I guess we need global function entry > for kallsyms. ABIv2 does away with function descriptors and Anton fixed up that routine to handle the change (the +2 is an artefact of that). > BTW, could you test this patch on the latest -next tree on PPC64 if possible? I'll test it, but it may take a bit. Ananth From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e39.co.us.ibm.com (e39.co.us.ibm.com [32.97.110.160]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8E726140179 for ; Thu, 8 May 2014 16:16:16 +1000 (EST) Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 May 2014 00:16:14 -0600 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id D1C776E801C for ; Thu, 8 May 2014 02:16:02 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp23034.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s486GAGc9306454 for ; Thu, 8 May 2014 06:16:10 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s486G7hD002636 for ; Thu, 8 May 2014 02:16:09 -0400 Date: Thu, 8 May 2014 11:46:58 +0530 From: Ananth N Mavinakayanahalli To: Masami Hiramatsu Subject: Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64 Message-ID: <20140508061658.GA2384@in.ibm.com> References: <536A16A6.5040709@hitachi.com> <20140507115551.22259.70581.stgit@ltc230.yrl.intra.hitachi.co.jp> <20140508044753.GA13413@in.ibm.com> <536B18B0.9060209@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <536B18B0.9060209@hitachi.com> Cc: Jeremy Fitzhardinge , linux-ia64@vger.kernel.org, sparse@chrisli.org, Linux Kernel Mailing List , Paul Mackerras , "H. Peter Anvin" , Thomas Gleixner , linux-tip-commits@vger.kernel.org, anil.s.keshavamurthy@intel.com, Ingo Molnar , Fenghua Yu , Arnd Bergmann , Rusty Russell , Chris Wright , yrl.pp-manager.tt@hitachi.com, akataria@vmware.com, Tony Luck , Kevin Hao , Linus Torvalds , rdunlap@infradead.org, Tony Luck , dl9pf@gmx.de, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Reply-To: ananth@in.ibm.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, May 08, 2014 at 02:40:00PM +0900, Masami Hiramatsu wrote: > (2014/05/08 13:47), Ananth N Mavinakayanahalli wrote: > > On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote: > > > > ... > > > >> +#if defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF == 1) > >> +/* > >> + * On PPC64 ABIv1 the function pointer actually points to the > >> + * function's descriptor. The first entry in the descriptor is the > >> + * address of the function text. > >> + */ > >> +#define constant_function_entry(fn) (((func_descr_t *)(fn))->entry) > >> +#else > >> +#define constant_function_entry(fn) ((unsigned long)(fn)) > >> +#endif > >> + > >> #endif /* __ASSEMBLY__ */ > > > > Hi Masami, > > > > You could just use ppc_function_entry() instead. > > No, I think ppc_function_entry() has two problems (on the latest -next kernel) > > At first, that is an inlined functions which is not applied in build time. > Since the NOKPROBE_SYMBOL() is used outside of any functions as like as > EXPORT_SYMBOL(), we can only use preprocessed macros. > Next, on PPC64 ABI*v2*, ppc_function_entry() returns local function entry, > which seems global function entry + 2 insns. I'm not sure about implementation > of the kallsyms on PPC64 ABIv2, but I guess we need global function entry > for kallsyms. ABIv2 does away with function descriptors and Anton fixed up that routine to handle the change (the +2 is an artefact of that). > BTW, could you test this patch on the latest -next tree on PPC64 if possible? I'll test it, but it may take a bit. Ananth From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ananth N Mavinakayanahalli Date: Thu, 08 May 2014 06:28:58 +0000 Subject: Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64 Message-Id: <20140508061658.GA2384@in.ibm.com> List-Id: References: <536A16A6.5040709@hitachi.com> <20140507115551.22259.70581.stgit@ltc230.yrl.intra.hitachi.co.jp> <20140508044753.GA13413@in.ibm.com> <536B18B0.9060209@hitachi.com> In-Reply-To: <536B18B0.9060209@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Masami Hiramatsu Cc: Benjamin Herrenschmidt , Paul Mackerras , Tony Luck , Jeremy Fitzhardinge , linux-ia64@vger.kernel.org, sparse@chrisli.org, "H. Peter Anvin" , Thomas Gleixner , linux-tip-commits@vger.kernel.org, anil.s.keshavamurthy@intel.com, Ingo Molnar , Fenghua Yu , Arnd Bergmann , Rusty Russell , Chris Wright , yrl.pp-manager.tt@hitachi.com, akataria@vmware.com, Tony Luck , Kevin Hao , linuxppc-dev@lists.ozlabs.org, rdunlap@infradead.org, Linux Kernel Mailing List , dl9pf@gmx.de, Andrew Morton , Linus Torvalds , "David S. Miller" On Thu, May 08, 2014 at 02:40:00PM +0900, Masami Hiramatsu wrote: > (2014/05/08 13:47), Ananth N Mavinakayanahalli wrote: > > On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote: > > > > ... > > > >> +#if defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF = 1) > >> +/* > >> + * On PPC64 ABIv1 the function pointer actually points to the > >> + * function's descriptor. The first entry in the descriptor is the > >> + * address of the function text. > >> + */ > >> +#define constant_function_entry(fn) (((func_descr_t *)(fn))->entry) > >> +#else > >> +#define constant_function_entry(fn) ((unsigned long)(fn)) > >> +#endif > >> + > >> #endif /* __ASSEMBLY__ */ > > > > Hi Masami, > > > > You could just use ppc_function_entry() instead. > > No, I think ppc_function_entry() has two problems (on the latest -next kernel) > > At first, that is an inlined functions which is not applied in build time. > Since the NOKPROBE_SYMBOL() is used outside of any functions as like as > EXPORT_SYMBOL(), we can only use preprocessed macros. > Next, on PPC64 ABI*v2*, ppc_function_entry() returns local function entry, > which seems global function entry + 2 insns. I'm not sure about implementation > of the kallsyms on PPC64 ABIv2, but I guess we need global function entry > for kallsyms. ABIv2 does away with function descriptors and Anton fixed up that routine to handle the change (the +2 is an artefact of that). > BTW, could you test this patch on the latest -next tree on PPC64 if possible? I'll test it, but it may take a bit. Ananth