From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751760AbdJSGpu (ORCPT ); Thu, 19 Oct 2017 02:45:50 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:51908 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbdJSGps (ORCPT ); Thu, 19 Oct 2017 02:45:48 -0400 X-Google-Smtp-Source: ABhQp+QTKdOqWPvL8ifzQ92zrGro1UYEpRT8p6h4+s40v623SipP7kAqvvpfWMcIINOGx9cpElS3hA== Date: Thu, 19 Oct 2017 15:45:44 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Tony Luck , Fenghua Yu , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , 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 2/7] sections: split dereference_function_descriptor() Message-ID: <20171019064544.GE449@jagdpanzerIV> References: <20170930025319.987-1-sergey.senozhatsky@gmail.com> <20170930025319.987-3-sergey.senozhatsky@gmail.com> <20171004090043.GD20084@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171004090043.GD20084@pathway.suse.cz> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (10/04/17 11:00), Petr Mladek wrote: [..] > > /* random extra sections (if any). Override > > diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h > > index 4d0cb9bba93e..172904e9cded 100644 > > --- a/include/linux/moduleloader.h > > +++ b/include/linux/moduleloader.h > > @@ -85,6 +85,10 @@ void module_arch_cleanup(struct module *mod); > > /* Any cleanup before freeing mod->module_init */ > > void module_arch_freeing_init(struct module *mod); > > > > +/* Dereference module function descriptor */ > > +unsigned long dereference_module_function_descriptor(struct module *mod, > > + unsigned long addr); > > + > > The function is used when the module is already loaded. IMHO, > include/linux/module.h would be a better place. > > One advantage would be that we could use the same trick > as in include/asm-generic/sections.h. I mean: > > #define dereference_module_function_descriptor(mod, addr) (addr) > > and redefine it in the three affected > arch//include/asm/module.h headers. Then it might be completely > optimized out on all architectures. will take a look. -ss