From patchwork Wed Dec 6 10:32:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Mladek X-Patchwork-Id: 10095369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E7DF60210 for ; Wed, 6 Dec 2017 10:32:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D09E2859E for ; Wed, 6 Dec 2017 10:32:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7141B297B7; Wed, 6 Dec 2017 10:32:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBEE22859E for ; Wed, 6 Dec 2017 10:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754875AbdLFKcq (ORCPT ); Wed, 6 Dec 2017 05:32:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:58506 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754869AbdLFKco (ORCPT ); Wed, 6 Dec 2017 05:32:44 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C1E18ACB6; Wed, 6 Dec 2017 10:32:42 +0000 (UTC) Date: Wed, 6 Dec 2017 11:32:41 +0100 From: Petr Mladek To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Tony Luck , Fenghua Yu , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , James Bottomley , Andrew Morton , Jessica Yu , Steven Rostedt , linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv4 5/6] symbol lookup: introduce dereference_symbol_descriptor() Message-ID: <20171206103241.t2jbljml7it7wsnz@pathway.suse.cz> References: <20171109234830.5067-1-sergey.senozhatsky@gmail.com> <20171109234830.5067-6-sergey.senozhatsky@gmail.com> <20171206043649.GB15885@jagdpanzerIV> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171206043649.GB15885@jagdpanzerIV> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed 2017-12-06 13:36:49, Sergey Senozhatsky wrote: > Hello, > > so we got a number of build-error reports [somehow I > thought 0day has compile tested the patches already; well, I > was wrong] basically on congifs that have no KALLSYMS. > > > Petr, can we replace 0006 with the following patch? Done. See comments below. > From: Sergey Senozhatsky > Subject: [PATCH] symbol lookup: introduce dereference_symbol_descriptor() > > > Signed-off-by: Sergey Senozhatsky The new patch only shuffled the code to fix a compilation problem with CONFIG_CALLSYMS undefined. It did not change the functionality. Therefore I put back: Tested-by: Tony Luck #ia64 Tested-by: Santosh Sivaraj #powerpc Tested-by: Helge Deller #parisc64 > --- > Documentation/printk-formats.txt | 42 ++++++++++++------------------- > include/linux/kallsyms.h | 53 ++++++++++++++++++++++++++++++++++++++++ > kernel/kallsyms.c | 33 ------------------------- > lib/vsprintf.c | 5 ++-- > 4 files changed, 71 insertions(+), 62 deletions(-) > > diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt > index aa0a776c817a..02745028e909 100644 > --- a/Documentation/printk-formats.txt > +++ b/Documentation/printk-formats.txt > @@ -61,41 +61,31 @@ Symbols/Function Pointers > > :: > > - %pF versatile_init+0x0/0x110 > - %pf versatile_init > - %pS versatile_init+0x0/0x110 > - %pSR versatile_init+0x9/0x110 > + %pS versatile_init+0x0/0x110 > + %ps versatile_init > + %pF versatile_init+0x0/0x110 > + %pf versatile_init > + %pSR versatile_init+0x9/0x110 > (with __builtin_extract_return_addr() translation) > - %ps versatile_init > - %pB prev_fn_of_versatile_init+0x88/0x88 > + %pB prev_fn_of_versatile_init+0x88/0x88 I was curious why so many lines were changed here. You converted the 2nd tab to spaces. I put back the tab. The result is: Best Regards, Petr --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/Documentation/printk-formats.txt +++ b/Documentation/printk-formats.txt @@ -50,42 +50,31 @@ Symbols/Function Pointers :: + %pS versatile_init+0x0/0x110 + %ps versatile_init %pF versatile_init+0x0/0x110 %pf versatile_init - %pS versatile_init+0x0/0x110 %pSR versatile_init+0x9/0x110 (with __builtin_extract_return_addr() translation) - %ps versatile_init %pB prev_fn_of_versatile_init+0x88/0x88 https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-4.16-deprecate-printk-pf&id=78675fe41d57c2bf9cb671f0a85b369a5a156f0a > > diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h > index bd118a6c60cb..1bcfe221e62c 100644 > --- a/include/linux/kallsyms.h > +++ b/include/linux/kallsyms.h > +static inline void *dereference_symbol_descriptor(void *ptr) > +{ > +#ifdef HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR > + struct module *mod; > + > + ptr = dereference_kernel_function_descriptor(ptr); > + if (is_ksym_addr((unsigned long)ptr)) > + return ptr; > + > + preempt_disable(); > + mod = __module_address((unsigned long)ptr); > + preempt_enable(); > + > + if (mod) > + ptr = dereference_module_function_descriptor(mod, ptr); > +#endif > + return ptr; > +} It is a bit too long for an inline function but I did not find a better solution. It should always be defined and all suitable .c files are compiled only under certain configuration. Well, it is a nop on most architectures.