diff options
Diffstat (limited to 'arch/powerpc/kernel/smp.c')
-rw-r--r-- | arch/powerpc/kernel/smp.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 30374d2f88e..d381ec90b75 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/sysdev.h> | 31 | #include <linux/sysdev.h> |
32 | #include <linux/cpu.h> | 32 | #include <linux/cpu.h> |
33 | #include <linux/notifier.h> | 33 | #include <linux/notifier.h> |
34 | #include <linux/topology.h> | ||
34 | 35 | ||
35 | #include <asm/ptrace.h> | 36 | #include <asm/ptrace.h> |
36 | #include <asm/atomic.h> | 37 | #include <asm/atomic.h> |
@@ -75,6 +76,8 @@ void smp_call_function_interrupt(void); | |||
75 | 76 | ||
76 | int smt_enabled_at_boot = 1; | 77 | int smt_enabled_at_boot = 1; |
77 | 78 | ||
79 | static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL; | ||
80 | |||
78 | #ifdef CONFIG_MPIC | 81 | #ifdef CONFIG_MPIC |
79 | int __init smp_mpic_probe(void) | 82 | int __init smp_mpic_probe(void) |
80 | { | 83 | { |
@@ -123,11 +126,16 @@ void smp_message_recv(int msg, struct pt_regs *regs) | |||
123 | /* XXX Do we have to do this? */ | 126 | /* XXX Do we have to do this? */ |
124 | set_need_resched(); | 127 | set_need_resched(); |
125 | break; | 128 | break; |
126 | #ifdef CONFIG_DEBUGGER | ||
127 | case PPC_MSG_DEBUGGER_BREAK: | 129 | case PPC_MSG_DEBUGGER_BREAK: |
130 | if (crash_ipi_function_ptr) { | ||
131 | crash_ipi_function_ptr(regs); | ||
132 | break; | ||
133 | } | ||
134 | #ifdef CONFIG_DEBUGGER | ||
128 | debugger_ipi(regs); | 135 | debugger_ipi(regs); |
129 | break; | 136 | break; |
130 | #endif | 137 | #endif /* CONFIG_DEBUGGER */ |
138 | /* FALLTHROUGH */ | ||
131 | default: | 139 | default: |
132 | printk("SMP %d: smp_message_recv(): unknown msg %d\n", | 140 | printk("SMP %d: smp_message_recv(): unknown msg %d\n", |
133 | smp_processor_id(), msg); | 141 | smp_processor_id(), msg); |
@@ -147,6 +155,17 @@ void smp_send_debugger_break(int cpu) | |||
147 | } | 155 | } |
148 | #endif | 156 | #endif |
149 | 157 | ||
158 | #ifdef CONFIG_KEXEC | ||
159 | void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)) | ||
160 | { | ||
161 | crash_ipi_function_ptr = crash_ipi_callback; | ||
162 | if (crash_ipi_callback) { | ||
163 | mb(); | ||
164 | smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK); | ||
165 | } | ||
166 | } | ||
167 | #endif | ||
168 | |||
150 | static void stop_this_cpu(void *dummy) | 169 | static void stop_this_cpu(void *dummy) |
151 | { | 170 | { |
152 | local_irq_disable(); | 171 | local_irq_disable(); |
@@ -452,10 +471,6 @@ int __devinit __cpu_up(unsigned int cpu) | |||
452 | if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)) | 471 | if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)) |
453 | return -EINVAL; | 472 | return -EINVAL; |
454 | 473 | ||
455 | #ifdef CONFIG_PPC64 | ||
456 | paca[cpu].default_decr = tb_ticks_per_jiffy; | ||
457 | #endif | ||
458 | |||
459 | /* Make sure callin-map entry is 0 (can be leftover a CPU | 474 | /* Make sure callin-map entry is 0 (can be leftover a CPU |
460 | * hotplug | 475 | * hotplug |
461 | */ | 476 | */ |
@@ -554,6 +569,8 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
554 | smp_ops->setup_cpu(boot_cpuid); | 569 | smp_ops->setup_cpu(boot_cpuid); |
555 | 570 | ||
556 | set_cpus_allowed(current, old_mask); | 571 | set_cpus_allowed(current, old_mask); |
572 | |||
573 | dump_numa_cpu_topology(); | ||
557 | } | 574 | } |
558 | 575 | ||
559 | #ifdef CONFIG_HOTPLUG_CPU | 576 | #ifdef CONFIG_HOTPLUG_CPU |