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 lists.ozlabs.org (Postfix) with ESMTP id 96F671A0009 for ; Wed, 2 Jul 2014 17:00:33 +1000 (EST) Subject: [PATCH v5 1/2] kprobes/powerpc: Fix arch_deref_entry_point to support ABIv2 From: Masami Hiramatsu To: Benjamin Herrenschmidt , Paul Mackerras , Tony Luck Date: Wed, 02 Jul 2014 07:00:22 +0000 Message-ID: <20140702070022.14689.7254.stgit@kbuild-fedora.novalocal> In-Reply-To: <1404276081.7254.1.camel@concordia> References: <1404276081.7254.1.camel@concordia> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: Jeremy Fitzhardinge , Rusty Russell , Anoop Thomas Mathew , Andrew Morton , Arnd Bergmann , linux-tip-commits@vger.kernel.org, Jiri Kosina , sparse@chrisli.org, rdunlap@infradead.org, "H. Peter Anvin" , Linux Kernel Mailing List , anil.s.keshavamurthy@intel.com, Ingo Molnar , Chris Wright , linuxppc-dev@lists.ozlabs.org, Thomas Gleixner , dl9pf@gmx.de, yrl.pp-manager.tt@hitachi.com, akataria@vmware.com, Linus Torvalds , "David S. Miller" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Since PowerPC64 ABIv2 doesn't have function descriptor any more, arch_deref_entry_point(), which returns function entry point from function descriptor, should be updated. Signed-off-by: Masami Hiramatsu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Anoop Thomas Mathew Cc: Jiri Kosina Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/kprobes.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 90fab64..72a1034 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c @@ -491,7 +491,12 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, return ret; } -#ifdef CONFIG_PPC64 +#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. + */ unsigned long arch_deref_entry_point(void *entry) { return ((func_descr_t *)entry)->entry;