[PATCH] PPC64 Make UP kernel run on POWER4 logical partition
From: Paul Mackerras
Date: Thu Dec 09 2004 - 19:26:52 EST
Recently I tried booting a UP kernel on a 1-processor logical
partition on a POWER4 system. It failed because the CPU we happened
to be running on was CPU 2, but hard_smp_processor_id() is defined to
0 for !CONFIG_SMP. (Note that this code runs quite early, as part of
init_IRQ, so hard_smp_processor_id() should be the physical ID of the
boot cpu.)
This patch does a minimal fix to make it work. I think this patch
should go in 2.6.10. Ultimately I think the hard_smp_processor_id()
definition should be removed from include/linux/smp.h, but that
carries a risk of breaking other architectures and probably shouldn't
be done pre 2.6.10.
Signed-off-by: Paul Mackerras <paulus@xxxxxxxxx>
diff -urN linux-2.5/arch/ppc64/kernel/xics.c test/arch/ppc64/kernel/xics.c
--- linux-2.5/arch/ppc64/kernel/xics.c 2004-10-27 07:32:57.000000000 +1000
+++ test/arch/ppc64/kernel/xics.c 2004-12-10 11:08:18.532939288 +1100
@@ -504,7 +504,7 @@
np;
np = of_find_node_by_type(np, "cpu")) {
ireg = (uint *)get_property(np, "reg", &ilen);
- if (ireg && ireg[0] == hard_smp_processor_id()) {
+ if (ireg && ireg[0] == boot_cpuid_phys) {
ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s",
&ilen);
i = ilen / sizeof(int);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/