From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yHfZk20ZWzDqXn for ; Thu, 19 Oct 2017 17:45:50 +1100 (AEDT) Received: by mail-pg0-x243.google.com with SMTP id r25so6309700pgn.4 for ; Wed, 18 Oct 2017 23:45:50 -0700 (PDT) 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 In-Reply-To: <20171004090043.GD20084@pathway.suse.cz> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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