aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/traps.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-09-26 04:52:37 -0400
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 04:52:37 -0400
commit151f8cc1169f9052095b2be36183ab132d75c6c2 (patch)
treef3aae7a7e2fc15e88a8471256b2aa43c4850ad0f /arch/x86_64/kernel/traps.c
parent34464a5b8937b79801776dfb6970c1b949fed4be (diff)
[PATCH] Remove safe_smp_processor_id()
And replace all users with ordinary smp_processor_id. The function was originally added to get some basic oops information out even if the GS register was corrupted. However that didn't work for some anymore because printk is needed to print the oops and it uses smp_processor_id() already. Also GS register corruptions are not particularly common anymore. This also helps the Xen port which would otherwise need to do this in a special way because it can't access the local APIC. Cc: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/traps.c')
-rw-r--r--arch/x86_64/kernel/traps.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 34660b1e2720..38bc821e457b 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -264,7 +264,7 @@ static int dump_trace_unwind(struct unwind_frame_info *info, void *context)
264void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack, 264void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack,
265 struct stacktrace_ops *ops, void *data) 265 struct stacktrace_ops *ops, void *data)
266{ 266{
267 const unsigned cpu = safe_smp_processor_id(); 267 const unsigned cpu = smp_processor_id();
268 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; 268 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
269 unsigned used = 0; 269 unsigned used = 0;
270 270
@@ -429,7 +429,7 @@ _show_stack(struct task_struct *tsk, struct pt_regs *regs, unsigned long *rsp)
429{ 429{
430 unsigned long *stack; 430 unsigned long *stack;
431 int i; 431 int i;
432 const int cpu = safe_smp_processor_id(); 432 const int cpu = smp_processor_id();
433 unsigned long *irqstack_end = (unsigned long *) (cpu_pda(cpu)->irqstackptr); 433 unsigned long *irqstack_end = (unsigned long *) (cpu_pda(cpu)->irqstackptr);
434 unsigned long *irqstack = (unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE); 434 unsigned long *irqstack = (unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE);
435 435
@@ -483,7 +483,7 @@ void show_registers(struct pt_regs *regs)
483 int i; 483 int i;
484 int in_kernel = !user_mode(regs); 484 int in_kernel = !user_mode(regs);
485 unsigned long rsp; 485 unsigned long rsp;
486 const int cpu = safe_smp_processor_id(); 486 const int cpu = smp_processor_id();
487 struct task_struct *cur = cpu_pda(cpu)->pcurrent; 487 struct task_struct *cur = cpu_pda(cpu)->pcurrent;
488 488
489 rsp = regs->rsp; 489 rsp = regs->rsp;
@@ -558,7 +558,7 @@ static unsigned int die_nest_count;
558 558
559unsigned __kprobes long oops_begin(void) 559unsigned __kprobes long oops_begin(void)
560{ 560{
561 int cpu = safe_smp_processor_id(); 561 int cpu = smp_processor_id();
562 unsigned long flags; 562 unsigned long flags;
563 563
564 oops_enter(); 564 oops_enter();
@@ -636,7 +636,7 @@ void __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic)
636 * We are in trouble anyway, lets at least try 636 * We are in trouble anyway, lets at least try
637 * to get a message out. 637 * to get a message out.
638 */ 638 */
639 printk(str, safe_smp_processor_id()); 639 printk(str, smp_processor_id());
640 show_registers(regs); 640 show_registers(regs);
641 if (kexec_should_crash(current)) 641 if (kexec_should_crash(current))
642 crash_kexec(regs); 642 crash_kexec(regs);