[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171211174459.l2ugmyi6kcr33zxp@pd.tnic>
Date: Mon, 11 Dec 2017 18:45:00 +0100
From: Borislav Petkov <bp@...en8.de>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Mark Salter <msalter@...hat.com>,
Tony Luck <tony.luck@...el.com>,
David Howells <dhowells@...hat.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Guan Xuetao <gxt@...c.pku.edu.cn>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Vineet Gupta <vgupta@...opsys.com>,
Fengguang Wu <fengguang.wu@...el.com>,
Steven Rostedt <rostedt@...dmis.org>,
Petr Mladek <pmladek@...e.com>,
LKML <linux-kernel@...r.kernel.org>,
linux-arm-kernel@...ts.infradead.org, linux-c6x-dev@...ux-c6x.org,
linux-ia64@...r.kernel.org, linux-am33-list@...hat.com,
linux-sh@...r.kernel.org, linux-edac@...r.kernel.org,
x86@...nel.org, linux-snps-arc@...ts.infradead.org,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [PATCH 08/13] x86: do not use print_symbol()
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@...il.com>
> Cc: Tony Luck <tony.luck@...el.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Thomas Gleixner <tglx@...utronix.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@...e.de>
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists