aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-16 14:44:00 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-16 14:44:00 -0400
commit9843099ff46467461d6476a827f6f9701682dbac (patch)
tree989c39138718d8ea005a8fcf9651da19a2f270a8
parentf948cc6ab9e61a8e88d70ee9aafc690e6d26f92c (diff)
sparc64: Fix SMP bootup with CONFIG_STACK_DEBUG or ftrace.
Based upon a report by Meelis Roos. Any function call can try to access the current thread register via the _mcount hooks when the kernel is built with -pg (via ftrace or STACK_DEBUG). That can't be setup properly very early on during the bootup of other cpus for sun4u and some early sun4v systems. So add notrace markers to these specific functions, so that _mcount doesn't get invoked too early. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc64/kernel/irq.c5
-rw-r--r--arch/sparc64/kernel/traps.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 23963882bc18..7495bc774685 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -7,6 +7,7 @@
7 7
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/linkage.h>
10#include <linux/ptrace.h> 11#include <linux/ptrace.h>
11#include <linux/errno.h> 12#include <linux/errno.h>
12#include <linux/kernel_stat.h> 13#include <linux/kernel_stat.h>
@@ -866,7 +867,7 @@ static void kill_prom_timer(void)
866 : "g1", "g2"); 867 : "g1", "g2");
867} 868}
868 869
869void init_irqwork_curcpu(void) 870void notrace init_irqwork_curcpu(void)
870{ 871{
871 int cpu = hard_smp_processor_id(); 872 int cpu = hard_smp_processor_id();
872 873
@@ -897,7 +898,7 @@ static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type
897 } 898 }
898} 899}
899 900
900void __cpuinit sun4v_register_mondo_queues(int this_cpu) 901void __cpuinit notrace sun4v_register_mondo_queues(int this_cpu)
901{ 902{
902 struct trap_per_cpu *tb = &trap_block[this_cpu]; 903 struct trap_per_cpu *tb = &trap_block[this_cpu];
903 904
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 3d924121c796..c824df13f589 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -10,6 +10,7 @@
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/linkage.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/signal.h> 15#include <linux/signal.h>
15#include <linux/smp.h> 16#include <linux/smp.h>
@@ -2453,7 +2454,7 @@ struct trap_per_cpu trap_block[NR_CPUS];
2453/* This can get invoked before sched_init() so play it super safe 2454/* This can get invoked before sched_init() so play it super safe
2454 * and use hard_smp_processor_id(). 2455 * and use hard_smp_processor_id().
2455 */ 2456 */
2456void init_cur_cpu_trap(struct thread_info *t) 2457void notrace init_cur_cpu_trap(struct thread_info *t)
2457{ 2458{
2458 int cpu = hard_smp_processor_id(); 2459 int cpu = hard_smp_processor_id();
2459 struct trap_per_cpu *p = &trap_block[cpu]; 2460 struct trap_per_cpu *p = &trap_block[cpu];