Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757192AbdIHWX5 convert rfc822-to-8bit (ORCPT ); Fri, 8 Sep 2017 18:23:57 -0400 Received: from mga14.intel.com ([192.55.52.115]:36535 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752952AbdIHWX4 (ORCPT ); Fri, 8 Sep 2017 18:23:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,363,1500966000"; d="scan'208";a="309657242" From: "Yu, Fenghua" To: Sergey Senozhatsky , Helge Deller , "Luck, Tony" CC: "linux-kernel@vger.kernel.org" , "Sergey Senozhatsky" , Petr Mladek , Andrew Morton , Benjamin Herrenschmidt , Paul Mackerras , "Michael Ellerman" Subject: RE: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier usages Thread-Topic: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier usages Thread-Index: AQHTKGq2C0r9RXx6WEmz4tOL8BdkUKKrkIrg Date: Fri, 8 Sep 2017 22:23:54 +0000 Message-ID: <3E5A0FA7E9CA944F9D5414FEC6C7122075892DD0@ORSMSX106.amr.corp.intel.com> References: <1504729681-3504-1-git-send-email-deller@gmx.de> <20170907004522.GA3885@jagdpanzerIV.localdomain> <8b93f9ca-95f6-4e40-1cc8-d1a65833abff@gmx.de> <20170907075653.GA533@jagdpanzerIV.localdomain> <20170907083207.GC533@jagdpanzerIV.localdomain> <667b8849-fb60-a312-2483-505252ff737e@gmx.de> <20170907093631.GD533@jagdpanzerIV.localdomain> <20170907095119.GE533@jagdpanzerIV.localdomain> <0604f27e-24ab-625b-9013-c6c0f4f6acc1@gmx.de> <3908561D78D1C84285E8C5FCA982C28F6136C2ED@ORSMSX114.amr.corp.intel.com> <20170908061830.GA496@jagdpanzerIV.localdomain> In-Reply-To: <20170908061830.GA496@jagdpanzerIV.localdomain> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1290 Lines: 34 > From: Sergey Senozhatsky [mailto:sergey.senozhatsky.work@gmail.com] > On (09/07/17 16:05), Luck, Tony wrote: > +static inline bool __mod_text_address(struct module *mod, > + unsigned long addr) { > + /* Make sure it's within the text section. */ > + if (!within(addr, mod->init_layout.base, mod->init_layout.text_size) > + && !within(addr, mod->core_layout.base, mod- > >core_layout.text_size)) > + return false; > + return true; > +} The __mod_text_address() may be defined only on IA64, PPC64 and PARISC since it's only called in those cases. > + > #ifdef CONFIG_KALLSYMS > /* > * This ignores the intensely annoying "mapping symbols" found @@ -3942,6 > +3952,14 @@ const char *module_address_lookup(unsigned long addr, > preempt_disable(); > mod = __module_address(addr); > if (mod) { > +#if defined(CONFIG_IA64) || defined(CONFIG_PPC64) || > defined(CONFIG_PARISC) > + unsigned long deref_addr; > + > + if (!__mod_text_address(mod, addr)) > + deref_addr = dereference_function_descriptor(addr); > + if (__mod_text_address(mod, deref_addr)) > + addr = deref_addr; #endif Thanks. -Fenghua