Commit 57da8b96 authored by Jan Beulich's avatar Jan Beulich Committed by Ingo Molnar

x86: Avoid double stack traces with show_regs()

What was called show_registers() so far already showed a stack
trace for kernel faults, and kernel_stack_pointer() isn't even
valid to be used for faults from user mode, hence it was
pointless for show_regs() to call show_trace() after
show_registers().

Simply rename show_registers() to show_regs() and eliminate
the old definition.
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/4FAA3D3902000078000826E1@nat28.tlf.novell.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent febb72a6
...@@ -24,7 +24,6 @@ enum die_val { ...@@ -24,7 +24,6 @@ enum die_val {
extern void printk_address(unsigned long address, int reliable); extern void printk_address(unsigned long address, int reliable);
extern void die(const char *, struct pt_regs *,long); extern void die(const char *, struct pt_regs *,long);
extern int __must_check __die(const char *, struct pt_regs *, long); extern int __must_check __die(const char *, struct pt_regs *, long);
extern void show_registers(struct pt_regs *regs);
extern void show_trace(struct task_struct *t, struct pt_regs *regs, extern void show_trace(struct task_struct *t, struct pt_regs *regs,
unsigned long *sp, unsigned long bp); unsigned long *sp, unsigned long bp);
extern void __show_regs(struct pt_regs *regs, int all); extern void __show_regs(struct pt_regs *regs, int all);
......
...@@ -271,7 +271,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) ...@@ -271,7 +271,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP) current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)
return 1; return 1;
show_registers(regs); show_regs(regs);
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
if (user_mode_vm(regs)) { if (user_mode_vm(regs)) {
sp = regs->sp; sp = regs->sp;
......
...@@ -82,7 +82,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, ...@@ -82,7 +82,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
} }
void show_registers(struct pt_regs *regs) void show_regs(struct pt_regs *regs)
{ {
int i; int i;
......
...@@ -245,7 +245,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, ...@@ -245,7 +245,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
show_trace_log_lvl(task, regs, sp, bp, log_lvl); show_trace_log_lvl(task, regs, sp, bp, log_lvl);
} }
void show_registers(struct pt_regs *regs) void show_regs(struct pt_regs *regs)
{ {
int i; int i;
unsigned long sp; unsigned long sp;
......
...@@ -1037,9 +1037,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) ...@@ -1037,9 +1037,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
"current sp %p does not match saved sp %p\n", "current sp %p does not match saved sp %p\n",
stack_addr(regs), kcb->jprobe_saved_sp); stack_addr(regs), kcb->jprobe_saved_sp);
printk(KERN_ERR "Saved registers for jprobe %p\n", jp); printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
show_registers(saved_regs); show_regs(saved_regs);
printk(KERN_ERR "Current registers\n"); printk(KERN_ERR "Current registers\n");
show_registers(regs); show_regs(regs);
BUG(); BUG();
} }
*regs = kcb->jprobe_saved_regs; *regs = kcb->jprobe_saved_regs;
......
...@@ -244,7 +244,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs) ...@@ -244,7 +244,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
pr_emerg( pr_emerg(
"NMI: IOCK error (debug interrupt?) for reason %02x on CPU %d.\n", "NMI: IOCK error (debug interrupt?) for reason %02x on CPU %d.\n",
reason, smp_processor_id()); reason, smp_processor_id());
show_registers(regs); show_regs(regs);
if (panic_on_io_nmi) if (panic_on_io_nmi)
panic("NMI IOCK error: Not continuing"); panic("NMI IOCK error: Not continuing");
......
...@@ -105,12 +105,6 @@ void exit_thread(void) ...@@ -105,12 +105,6 @@ void exit_thread(void)
} }
} }
void show_regs(struct pt_regs *regs)
{
show_registers(regs);
show_trace(NULL, regs, (unsigned long *)kernel_stack_pointer(regs), 0);
}
void show_regs_common(void) void show_regs_common(void)
{ {
const char *vendor, *product, *board; const char *vendor, *product, *board;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment