Linux EDAC development
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mark Salter <msalter@redhat.com>, Tony Luck <tony.luck@intel.com>,
	David Howells <dhowells@redhat.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Vineet Gupta <vgupta@synopsys.com>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Petr Mladek <pmladek@suse.com>,
	LKML <linux-kernel@vger.kernel.org>,
	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@gmail.com>
Subject: [08/13] x86: do not use print_symbol()
Date: Mon, 11 Dec 2017 18:45:00 +0100	[thread overview]
Message-ID: <20171211174459.l2ugmyi6kcr33zxp@pd.tnic> (raw)

On Mon, Dec 11, 2017 at 09:50:20PM +0900, Sergey Senozhatsky wrote:
> 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 <sergey.senozhatsky@gmail.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  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 <linux/capability.h>
>  #include <linux/miscdevice.h>
>  #include <linux/ratelimit.h>
> -#include <linux/kallsyms.h>
>  #include <linux/rcupdate.h>
>  #include <linux/kobject.h>
>  #include <linux/uaccess.h>
> @@ -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");
>  	}
>  

For the mce.c bit above:

Acked-by: Borislav Petkov <bp@suse.de>

Thx.

             reply	other threads:[~2017-12-11 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 17:45 Borislav Petkov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-12-12  2:41 [08/13] x86: do not use print_symbol() Sergey Senozhatsky
2017-12-11 12:50 Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171211174459.l2ugmyi6kcr33zxp@pd.tnic \
    --to=bp@alien8.de \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=dhowells@redhat.com \
    --cc=fengguang.wu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=linux-am33-list@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=msalter@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=vgupta@synopsys.com \
    --cc=x86@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox