Broken LPAR cpu bringup
Nathan Lynch
nathanl at austin.ibm.com
Thu Jul 15 14:29:22 EST 2004
On Wed, 2004-07-14 at 19:14, Dave Hansen wrote:
> These results are from a clean 2.6.8-rc1-mm1 kernel. It's a partition
> on a p650 with 8 physical CPUs, and 2 in the partition that I'm using.
> 64GB of total RAM, 12 GB in the partition. There are no other active
> partitions.
>
> The early CPU booting appears to go as planned:
>
> instantiating rtas at 0x000000003fd3c000... done
> 0000000000000000 : booting cpu /cpus/PowerPC,POWER4 at 0
> 0000000000000001 : starting cpu /cpus/PowerPC,POWER4 at 1... ... done
> Calling quiesce ...
>
> But, when SMP cpu bringup happens, it gets really confused and tries to
> bring up *all* of the CPUs:
>
> Partition configured for 8 cpus.
> No more cpus available, failing
> Processor 1 is stuck.
> No more cpus available, failing
> Processor 2 is stuck.
> No more cpus available, failing
> Processor 3 is stuck.
> No more cpus available, failing
> Processor 4 is stuck.
> No more cpus available, failing
> Processor 5 is stuck.
> No more cpus available, failing
> Processor 6 is stuck.
> No more cpus available, failing
> Processor 7 is stuck.
> Brought up 1 CPUs
>
Does this fix it? The problem is that ppc64 doesn't know about
cpu_present_map. The arch-independent code copies cpu_possible_map to
cpu_present_map if the latter has not been modified by the arch bootup
code -- as you have discovered, this breaks on LPAR.
Nathan
Signed-off-by: Nathan Lynch <nathanl at austin.ibm.com>
diff -Naurp -X /home/nathanl/working/dontdiff 2.6.8-rc1-mm1/arch/ppc64/kernel/prom.c 2.6.8-rc1-mm1.new/arch/ppc64/kernel/prom.c
--- 2.6.8-rc1-mm1/arch/ppc64/kernel/prom.c 2004-07-14 20:08:13.000000000 -0500
+++ 2.6.8-rc1-mm1.new/arch/ppc64/kernel/prom.c 2004-07-14 19:57:01.000000000 -0500
@@ -942,7 +942,7 @@ static void __init prom_hold_cpus(unsign
#ifdef CONFIG_SMP
cpu_set(cpuid, RELOC(cpu_available_map));
cpu_set(cpuid, RELOC(cpu_possible_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
+ cpu_set(cpuid, RELOC(cpu_present_map));
if (reg == 0)
cpu_set(cpuid, RELOC(cpu_online_map));
#endif /* CONFIG_SMP */
@@ -1044,7 +1044,7 @@ static void __init prom_hold_cpus(unsign
_systemcfg->processorCount++;
cpu_set(cpuid, RELOC(cpu_available_map));
cpu_set(cpuid, RELOC(cpu_possible_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
+ cpu_set(cpuid, RELOC(cpu_present_map));
#endif
} else {
prom_printf("... failed: %x\n", *acknowledge);
@@ -1056,7 +1056,7 @@ static void __init prom_hold_cpus(unsign
cpu_set(cpuid, RELOC(cpu_available_map));
cpu_set(cpuid, RELOC(cpu_possible_map));
cpu_set(cpuid, RELOC(cpu_online_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
+ cpu_set(cpuid, RELOC(cpu_present_map));
}
#endif
next:
@@ -1071,7 +1071,7 @@ next:
interrupt_server[i]);
if (_naca->smt_state) {
cpu_set(cpuid, RELOC(cpu_available_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
+ cpu_set(cpuid, RELOC(cpu_present_map));
prom_printf("available\n");
} else {
prom_printf("not available\n");
diff -Naurp -X /home/nathanl/working/dontdiff 2.6.8-rc1-mm1/arch/ppc64/kernel/smp.c 2.6.8-rc1-mm1.new/arch/ppc64/kernel/smp.c
--- 2.6.8-rc1-mm1/arch/ppc64/kernel/smp.c 2004-07-14 20:08:20.000000000 -0500
+++ 2.6.8-rc1-mm1.new/arch/ppc64/kernel/smp.c 2004-07-14 20:31:38.000000000 -0500
@@ -60,7 +60,6 @@ unsigned long cache_decay_ticks;
cpumask_t cpu_possible_map = CPU_MASK_NONE;
cpumask_t cpu_online_map = CPU_MASK_NONE;
cpumask_t cpu_available_map = CPU_MASK_NONE;
-cpumask_t cpu_present_at_boot = CPU_MASK_NONE;
EXPORT_SYMBOL(cpu_online_map);
EXPORT_SYMBOL(cpu_possible_map);
@@ -126,7 +125,7 @@ static int smp_iSeries_numProcs(void)
if (paca[i].lppaca.xDynProcStatus < 2) {
cpu_set(i, cpu_available_map);
cpu_set(i, cpu_possible_map);
- cpu_set(i, cpu_present_at_boot);
+ cpu_set(i, cpu_present_map);
++np;
}
}
@@ -868,7 +867,7 @@ int __devinit __cpu_up(unsigned int cpu)
int c;
/* At boot, don't bother with non-present cpus -JSCHOPP */
- if (system_state == SYSTEM_BOOTING && !cpu_present_at_boot(cpu))
+ if (system_state == SYSTEM_BOOTING && !cpu_present(cpu))
return -ENOENT;
paca[cpu].prof_counter = 1;
diff -Naurp -X /home/nathanl/working/dontdiff 2.6.8-rc1-mm1/arch/ppc64/kernel/xics.c 2.6.8-rc1-mm1.new/arch/ppc64/kernel/xics.c
--- 2.6.8-rc1-mm1/arch/ppc64/kernel/xics.c 2004-07-14 20:08:13.000000000 -0500
+++ 2.6.8-rc1-mm1.new/arch/ppc64/kernel/xics.c 2004-07-14 19:55:33.000000000 -0500
@@ -548,7 +548,7 @@ nextnode:
#ifdef CONFIG_SMP
for_each_cpu(i) {
/* FIXME: Do this dynamically! --RR */
- if (!cpu_present_at_boot(i))
+ if (!cpu_present(i))
continue;
xics_per_cpu[i] = __ioremap((ulong)inodes[get_hard_smp_processor_id(i)].addr,
(ulong)inodes[get_hard_smp_processor_id(i)].size,
diff -Naurp -X /home/nathanl/working/dontdiff 2.6.8-rc1-mm1/include/asm-ppc64/smp.h 2.6.8-rc1-mm1.new/include/asm-ppc64/smp.h
--- 2.6.8-rc1-mm1/include/asm-ppc64/smp.h 2004-07-14 20:08:18.000000000 -0500
+++ 2.6.8-rc1-mm1.new/include/asm-ppc64/smp.h 2004-07-14 20:11:51.000000000 -0500
@@ -42,15 +42,11 @@ extern void smp_message_recv(int, struct
* possible: CPU is a candidate to be made online
* available: CPU is candidate for the 'possible' pool
* Used to get SMT threads started at boot time.
- * present_at_boot: CPU was available at boot time. Used in DLPAR
- * code to handle special cases for processor start up.
*/
-extern cpumask_t cpu_present_at_boot;
extern cpumask_t cpu_online_map;
extern cpumask_t cpu_possible_map;
extern cpumask_t cpu_available_map;
-#define cpu_present_at_boot(cpu) cpu_isset(cpu, cpu_present_at_boot)
#define cpu_available(cpu) cpu_isset(cpu, cpu_available_map)
/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list