PPC64 (1/3) Rework PPC64 cpu map setup
PATCH 1/1 PPC64 (1/3) Rework PPC64 cpu map setup
Move all cpu map initializations to one place (except for the online map -- cpus mark themselves online as they come up). This sets up cpu_possible_map early enough that we can use num_possible_cpus for allocating irqstacks instead of NR_CPUS. Hopefully this should also help set the stage for kexec.
Signed-off-by Nathan Lynch <[email protected]>
Signed-off-by Paul Mackerras <[email protected]>
arch/ppc64/kernel/prom.c +1 -27
@@ -939,20 +939,11 @@prom_getprop (node,"reg" , ®,sizeof (reg)); lpaca[cpuid].hw_cpu_id = reg; -#ifdef CONFIG_SMP -cpu_set (cpuid,RELOC (cpu_possible_map)); -cpu_set (cpuid,RELOC (cpu_present_map)); -if (reg ==0 ) -cpu_set (cpuid,RELOC (cpu_online_map)); -#endif /* CONFIG_SMP */ cpuid++; }return ; } -/* Initially, we must have one active CPU. */ - _systemcfg->processorCount =1 ; -prom_debug ("prom_hold_cpus: start...\n" );prom_debug (" 1) spinloop = 0x%x\n" , (unsigned long )spinloop);prom_debug (" 1) *spinloop = 0x%x\n" , *spinloop);
@@ -1038,23 +1029,13 @@* even if we never start it. */ if (cpuid >=NR_CPUS ) goto next; -#ifdef CONFIG_SMP -/* Set the number of active processors. */ - _systemcfg->processorCount++; -cpu_set (cpuid,RELOC (cpu_possible_map)); -cpu_set (cpuid,RELOC (cpu_present_map)); -#endif }else {prom_printf ("... failed: %x\n" , *acknowledge); } }#ifdef CONFIG_SMP - else { + else prom_printf("%x : booting cpu %s\n", cpuid, path); -cpu_set (cpuid,RELOC (cpu_possible_map)); -cpu_set (cpuid,RELOC (cpu_online_map)); -cpu_set (cpuid,RELOC (cpu_present_map)); - }#endif next: #ifdef CONFIG_SMP
@@ -1067,9 +1048,6 @@prom_printf ("%x : preparing thread ... " , interrupt_server[i]);if (_naca->smt_state) { -cpu_set (cpuid,RELOC (cpu_present_map)); -cpu_set (cpuid,RELOC (cpu_possible_map)); - _systemcfg->processorCount++;prom_printf ("available\n" ); }else {prom_printf ("not available\n" );
@@ -1099,11 +1077,7 @@ pir &0x3ff ; } } -/* cpu_set(i+1, cpu_online_map); */ -cpu_set (i+1 ,RELOC (cpu_possible_map)); -cpu_set (i+1 ,RELOC (cpu_present_map)); } - _systemcfg->processorCount *=2 ; }else {prom_printf ("Processor is not HMT capable\n" ); }
arch/ppc64/kernel/setup.c +116 -20
159 lines not on this page · raw message
arch/ppc64/kernel/smp.c +0 -54
83 lines not on this page · raw message