From patchwork Mon Dec 11 12:50:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10104977 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 24B72602B3 for ; Mon, 11 Dec 2017 12:53:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED62529587 for ; Mon, 11 Dec 2017 12:53:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E17ED29589; Mon, 11 Dec 2017 12:53:50 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 554E129587 for ; Mon, 11 Dec 2017 12:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbdLKMwY (ORCPT ); Mon, 11 Dec 2017 07:52:24 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:32845 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbdLKMwU (ORCPT ); Mon, 11 Dec 2017 07:52:20 -0500 Received: by mail-pg0-f67.google.com with SMTP id g7so10867015pgs.0; Mon, 11 Dec 2017 04:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TN4g8HWAbYM+mHgchr9hE28hhDHAqrO4CBf5M7hSqn4=; b=Ga8OIa15h+bPjPK4cqmPPGhvJ8YE6v4TJA74B8lyKlcsf4eXaFqKJ0JS7E90m8goUm cxjKHCRAHTPRGzEiU6UrDrDeDn05x42XgwtYuUWORSavOfSJXIMstufPjU+4Ejl0Vyjx iokoi6S/isbRVFuHYIEjFKk2fuhtXV9awY93MRA+EQmkjaE7GGIDe3227/VMj4K9Xffu 89xOcPAF2pf8Nu5XIKF5QtNka/eC/3whPT2xQGtuvbaJSwpmRlkMJV9Dn2rhb+Zks39P 08B7ijkD9Va0ArVlFicXuzLe4OG8cRrMqz4wnhTLJ4BOMp4/wcxN3W3eQFsJXH8v7oDp 2OOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TN4g8HWAbYM+mHgchr9hE28hhDHAqrO4CBf5M7hSqn4=; b=Y5igrpYf3KJhNa6Fiv7NK4ptCP1oSEwxyN7Gkjs/XeIIajtkW5ctoKLlpxDjaxHqQG sE34i8eAkUWMwNR1nzxLLruqnXO7R53yOV80aZC/8n5WZbc2Wd8d7eX/VGOl72tLoFQl w1U8Wrcfk1jvpE7LDZM/BiTSNfKfnjwWeg38DWAPZCKxOqpi4zFCFUU56MOvjys+fJq7 LjGXjpABXDMHzw4yFl43tptePHlWcqKGs/8N2ZIArWqweqBR2EYg4ic0F9ku1g7lDcUS T1jbTY88N2StkycE3twfSqYfNEODn7V5er3QEbDbBfW4ugMZOGIAacnjv/fLtNcDLdxS 9ZkA== X-Gm-Message-State: AKGB3mInU3KkHf+PXi3+dTk/Wl8wyRamSuRQrKt0LjTTSqC44HIGwMvr XvkdaMA1rRlfA1ST5/A73Ys= X-Google-Smtp-Source: ACJfBothzCd2F0ApMZUNaBATDQTYSmzeGW9icOAs7v32kt/bp5k7iU3S1m0fyuFVhCFsm89PWJA/fg== X-Received: by 10.99.3.195 with SMTP id 186mr252046pgd.103.1512996739316; Mon, 11 Dec 2017 04:52:19 -0800 (PST) Received: from localhost.localdomain ([110.70.53.61]) by smtp.gmail.com with ESMTPSA id j13sm23374380pff.131.2017.12.11.04.52.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:52:18 -0800 (PST) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky To: Andrew Morton , Russell King , Catalin Marinas , Mark Salter , Tony Luck , David Howells , Yoshinori Sato , Guan Xuetao , Borislav Petkov , Greg Kroah-Hartman , Thomas Gleixner , Peter Zijlstra , Vineet Gupta , Fengguang Wu Cc: Steven Rostedt , Petr Mladek , LKML , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-am33-list@redhat.com, linux-sh@vger.kernel.org, linux-edac@vger.kernel.org, x86@kernel.org, linux-snps-arc@lists.infradead.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: [PATCH 08/13] x86: do not use print_symbol() Date: Mon, 11 Dec 2017 21:50:20 +0900 Message-Id: <20171211125025.2270-9-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> References: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP print_symbol() uses extra stack space to sprintf() symbol information and then to feed that buffer to printk() char buffer[KSYM_SYMBOL_LEN]; sprint_symbol(buffer, address); printk(fmt, buffer); Replace print_symbol() with a direct printk("%pS") call. Signed-off-by: Sergey Senozhatsky Cc: Tony Luck Cc: Borislav Petkov Cc: Thomas Gleixner Acked-by: Borislav Petkov --- arch/x86/kernel/cpu/mcheck/mce.c | 3 +-- arch/x86/mm/mmio-mod.c | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index b1d616d08eee..8ca8f6eb32db 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -235,7 +234,7 @@ static void __print_mce(struct mce *m) m->cs, m->ip); if (m->cs == __KERNEL_CS) - print_symbol("{%s}", m->ip); + pr_cont("{%pS}", (void *)m->ip); pr_cont("\n"); } diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index 4d434ddb75db..2c1ecf4763c4 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include /* for ISA_START_ADDRESS */ @@ -123,8 +122,8 @@ static void die_kmmio_nesting_error(struct pt_regs *regs, unsigned long addr) pr_emerg("unexpected fault for address: 0x%08lx, last fault for address: 0x%08lx\n", addr, my_reason->addr); print_pte(addr); - print_symbol(KERN_EMERG "faulting IP is at %s\n", regs->ip); - print_symbol(KERN_EMERG "last faulting IP was at %s\n", my_reason->ip); + pr_emerg("faulting IP is at %pS\n", (void *)regs->ip); + pr_emerg("last faulting IP was at %pS\n", (void *)my_reason->ip); #ifdef __i386__ pr_emerg("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n", regs->ax, regs->bx, regs->cx, regs->dx);