From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbdJDLGm (ORCPT ); Wed, 4 Oct 2017 07:06:42 -0400 Received: from ozlabs.org ([103.22.144.67]:35823 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751446AbdJDLGk (ORCPT ); Wed, 4 Oct 2017 07:06:40 -0400 From: Michael Ellerman To: Petr Mladek , Sergey Senozhatsky Cc: Steven Rostedt , Tony Luck , Fenghua Yu , Benjamin Herrenschmidt , Paul Mackerras , James Bottomley , Helge Deller , Andrew Morton , Jessica Yu , Alexei Starovoitov , linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv3 4/7] powerpc64: Add .opd based function descriptor dereference In-Reply-To: <20171004092108.GF20084@pathway.suse.cz> References: <20170930025319.987-1-sergey.senozhatsky@gmail.com> <20170930025319.987-5-sergey.senozhatsky@gmail.com> <20171004092108.GF20084@pathway.suse.cz> Date: Wed, 04 Oct 2017 22:06:35 +1100 Message-ID: <87r2ujp3yc.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Petr Mladek writes: > On Sat 2017-09-30 11:53:16, Sergey Senozhatsky wrote: >> diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c >> index 0b0f89685b67..94caec045a90 100644 >> --- a/arch/powerpc/kernel/module_64.c >> +++ b/arch/powerpc/kernel/module_64.c >> @@ -712,6 +717,17 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, >> return 0; >> } >> >> +#ifdef PPC64_ELF_ABI_v1 >> +unsigned long dereference_module_function_descriptor(struct module *mod, >> + unsigned long addr) >> +{ >> + if (addr < mod->arch.start_opd || addr >= mod->arch.end_opd) >> + return addr; >> + >> + return dereference_function_descriptor(addr); >> +} >> +#endif /* PPC64_ELF_ABI_v1 */ > > I would personally move this up in the source file. It is related to > the definition of func_desc() and other functions that are > also PPC_ELF_ABI-specific. Yeah that would be neater. There's already a PPC64_ELF_ABI_v2 block, you could put this in the else case of that. But we can do that later if you're not respinning otherwise. cheers