Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100AbdIGJyL (ORCPT ); Thu, 7 Sep 2017 05:54:11 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34298 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754944AbdIGJyK (ORCPT ); Thu, 7 Sep 2017 05:54:10 -0400 X-Google-Smtp-Source: ADKCNb6p/xXOMItDnWXDwBlhpL5WghiLNwXjVMFND5eR1TjEPHdCTsNY9P7bqoqp0qJwL/xXN7sZuQ== Date: Thu, 7 Sep 2017 18:51:19 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Cc: Helge Deller , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Petr Mladek , Andrew Morton , Tony Luck , Fenghua Yu , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier usages Message-ID: <20170907095119.GE533@jagdpanzerIV.localdomain> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170907093631.GD533@jagdpanzerIV.localdomain> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1131 Lines: 49 On (09/07/17 18:36), Sergey Senozhatsky wrote: [..] > > I can look into adding such check-code, but even then the warning will > > only show up if you run on ia64, ppc64 and parisc64. sorry, not sure I understand the "warning" part. what I'm thinking about is: - every platform that needs descriptor dereference defines its own function. otherwise dereference_descriptor(p) is just (p). - so it's something like arch/platform_abc/include/asm/sections.h #undef dereference_function_descriptor static inline void *dereference_function_descriptor(void *ptr) { if (not_a_function_descriptor(ptr)) return ptr; if (!probe_kernel_address(....)) return function_ip; return ptr; } - so then in lib/vsprintf.c we can do unconditionally case F: case f: case S: case s: case B: ptr = dereference_function_descriptor(ptr); return symbol_string(....); because platforms will take care of proper descriptor dereference, when needed. - and ideally we even can drop %pF-%pf. because there won't be any difference between `S' and `F'. something like this. let's see if this is possible. any thoughts? -ss