From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752767AbaEHFkL (ORCPT ); Thu, 8 May 2014 01:40:11 -0400 Received: from mail7.hitachi.co.jp ([133.145.228.42]:35789 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbaEHFkJ (ORCPT ); Thu, 8 May 2014 01:40:09 -0400 Message-ID: <536B18B0.9060209@hitachi.com> Date: Thu, 08 May 2014 14:40:00 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: ananth@in.ibm.com 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 References: <536A16A6.5040709@hitachi.com> <20140507115551.22259.70581.stgit@ltc230.yrl.intra.hitachi.co.jp> <20140508044753.GA13413@in.ibm.com> In-Reply-To: <20140508044753.GA13413@in.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (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. BTW, could you test this patch on the latest -next tree on PPC64 if possible? Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail7.hitachi.co.jp (mail7.hitachi.co.jp [133.145.228.42]) by ozlabs.org (Postfix) with ESMTP id 7C3E21401A7 for ; Thu, 8 May 2014 15:40:09 +1000 (EST) Message-ID: <536B18B0.9060209@hitachi.com> Date: Thu, 08 May 2014 14:40:00 +0900 From: Masami Hiramatsu MIME-Version: 1.0 To: ananth@in.ibm.com Subject: Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64 References: <536A16A6.5040709@hitachi.com> <20140507115551.22259.70581.stgit@ltc230.yrl.intra.hitachi.co.jp> <20140508044753.GA13413@in.ibm.com> In-Reply-To: <20140508044753.GA13413@in.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 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" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , (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. BTW, could you test this patch on the latest -next tree on PPC64 if possible? Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu Date: Thu, 08 May 2014 05:40:00 +0000 Subject: Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64 Message-Id: <536B18B0.9060209@hitachi.com> List-Id: References: <536A16A6.5040709@hitachi.com> <20140507115551.22259.70581.stgit@ltc230.yrl.intra.hitachi.co.jp> <20140508044753.GA13413@in.ibm.com> In-Reply-To: <20140508044753.GA13413@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ananth@in.ibm.com 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" (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. BTW, could you test this patch on the latest -next tree on PPC64 if possible? Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com