* [08/13] x86: do not use print_symbol()
@ 2017-12-11 12:50 Sergey Senozhatsky
0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2017-12-11 12:50 UTC (permalink / raw)
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,
linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
x86, linux-snps-arc, Sergey Senozhatsky, Sergey Senozhatsky
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");
}
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 <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/io.h>
-#include <linux/kallsyms.h>
#include <asm/pgtable.h>
#include <linux/mmiotrace.h>
#include <asm/e820/api.h> /* 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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [08/13] x86: do not use print_symbol()
@ 2017-12-11 17:45 Borislav Petkov
0 siblings, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2017-12-11 17:45 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Andrew Morton, Russell King, Catalin Marinas, Mark Salter,
Tony Luck, David Howells, Yoshinori Sato, Guan Xuetao,
Greg Kroah-Hartman, Thomas Gleixner, Peter Zijlstra, Vineet Gupta,
Fengguang Wu, Steven Rostedt, Petr Mladek, LKML, linux-arm-kernel,
linux-c6x-dev, linux-ia64, linux-am33-list, linux-sh, linux-edac,
x86, linux-snps-arc, Sergey Senozhatsky
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [08/13] x86: do not use print_symbol()
@ 2017-12-12 2:41 Sergey Senozhatsky
0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2017-12-12 2:41 UTC (permalink / raw)
To: Borislav Petkov
Cc: Sergey Senozhatsky, Andrew Morton, Russell King, Catalin Marinas,
Mark Salter, Tony Luck, David Howells, Yoshinori Sato,
Guan Xuetao, Greg Kroah-Hartman, Thomas Gleixner, Peter Zijlstra,
Vineet Gupta, Fengguang Wu, Steven Rostedt, Petr Mladek, LKML,
linux-arm-kernel, linux-c6x-dev, linux-ia64, linux-am33-list,
linux-sh, linux-edac, x86, linux-snps-arc, Sergey Senozhatsky
On (12/11/17 18:45), Borislav Petkov wrote:
> For the mce.c bit above:
>
> Acked-by: Borislav Petkov <bp@suse.de>
thanks.
-ss
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-12 2:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 2:41 [08/13] x86: do not use print_symbol() Sergey Senozhatsky
-- strict thread matches above, loose matches on Subject: below --
2017-12-11 17:45 Borislav Petkov
2017-12-11 12:50 Sergey Senozhatsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox