aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/smpboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/kernel/smpboot.c')
-rw-r--r--arch/ia64/kernel/smpboot.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 3865f088ffa2..7d72c0d872b3 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -346,6 +346,7 @@ smp_callin (void)
346 lock_ipi_calllock(); 346 lock_ipi_calllock();
347 cpu_set(cpuid, cpu_online_map); 347 cpu_set(cpuid, cpu_online_map);
348 unlock_ipi_calllock(); 348 unlock_ipi_calllock();
349 per_cpu(cpu_state, cpuid) = CPU_ONLINE;
349 350
350 smp_setup_percpu_timer(); 351 smp_setup_percpu_timer();
351 352
@@ -524,47 +525,6 @@ smp_build_cpu_map (void)
524 } 525 }
525} 526}
526 527
527#ifdef CONFIG_NUMA
528
529/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
530u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
531EXPORT_SYMBOL(cpu_to_node_map);
532/* which logical CPUs are on which nodes */
533cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
534
535/*
536 * Build cpu to node mapping and initialize the per node cpu masks.
537 */
538void __init
539build_cpu_to_node_map (void)
540{
541 int cpu, i, node;
542
543 for(node=0; node<MAX_NUMNODES; node++)
544 cpus_clear(node_to_cpu_mask[node]);
545 for(cpu = 0; cpu < NR_CPUS; ++cpu) {
546 /*
547 * All Itanium NUMA platforms I know use ACPI, so maybe we
548 * can drop this ifdef completely. [EF]
549 */
550#ifdef CONFIG_ACPI_NUMA
551 node = -1;
552 for (i = 0; i < NR_CPUS; ++i)
553 if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
554 node = node_cpuid[i].nid;
555 break;
556 }
557#else
558# error Fixme: Dunno how to build CPU-to-node map.
559#endif
560 cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
561 if (node >= 0)
562 cpu_set(cpu, node_to_cpu_mask[node]);
563 }
564}
565
566#endif /* CONFIG_NUMA */
567
568/* 528/*
569 * Cycle through the APs sending Wakeup IPIs to boot each. 529 * Cycle through the APs sending Wakeup IPIs to boot each.
570 */ 530 */
@@ -611,6 +571,7 @@ void __devinit smp_prepare_boot_cpu(void)
611{ 571{
612 cpu_set(smp_processor_id(), cpu_online_map); 572 cpu_set(smp_processor_id(), cpu_online_map);
613 cpu_set(smp_processor_id(), cpu_callin_map); 573 cpu_set(smp_processor_id(), cpu_callin_map);
574 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
614} 575}
615 576
616/* 577/*
@@ -688,6 +649,7 @@ int __cpu_disable(void)
688 return -EBUSY; 649 return -EBUSY;
689 650
690 remove_siblinginfo(cpu); 651 remove_siblinginfo(cpu);
652 cpu_clear(cpu, cpu_online_map);
691 fixup_irqs(); 653 fixup_irqs();
692 local_flush_tlb_all(); 654 local_flush_tlb_all();
693 cpu_clear(cpu, cpu_callin_map); 655 cpu_clear(cpu, cpu_callin_map);
@@ -774,6 +736,7 @@ __cpu_up (unsigned int cpu)
774 if (cpu_isset(cpu, cpu_callin_map)) 736 if (cpu_isset(cpu, cpu_callin_map))
775 return -EINVAL; 737 return -EINVAL;
776 738
739 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
777 /* Processor goes to start_secondary(), sets online flag */ 740 /* Processor goes to start_secondary(), sets online flag */
778 ret = do_boot_cpu(sapicid, cpu); 741 ret = do_boot_cpu(sapicid, cpu);
779 if (ret < 0) 742 if (ret < 0)