From: Zwane Mwaikambo <zwane@arm.linux.org.uk>

This fixes an oops due to cpu_sibling_map being uninitialised when a system
with no MP table (most UP boxen) boots a CONFIG_SMT kernel.  What also
happens is that the cpu_group lists end up not being terminated properly,
but this oops kills it first.  Patch tested on UP w/o MP table, 2x P2 and
UP Xeon w/ no siblings.



---

 25-akpm/arch/i386/kernel/smpboot.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN arch/i386/kernel/smpboot.c~sched-find_busiest_group-fix arch/i386/kernel/smpboot.c
--- 25/arch/i386/kernel/smpboot.c~sched-find_busiest_group-fix	Wed Feb  4 12:30:01 2004
+++ 25-akpm/arch/i386/kernel/smpboot.c	Wed Feb  4 12:30:01 2004
@@ -953,6 +953,8 @@ static void __init smp_boot_cpus(unsigne
 
 	current_thread_info()->cpu = 0;
 	smp_tune_scheduling();
+	cpus_clear(cpu_sibling_map[0]);
+	cpu_set(0, cpu_sibling_map[0]);
 
 	/*
 	 * If we couldn't find an SMP configuration at boot time,
@@ -1085,7 +1087,7 @@ static void __init smp_boot_cpus(unsigne
 	 * efficiently.
 	 */
 	for (cpu = 0; cpu < NR_CPUS; cpu++)
-		cpu_sibling_map[cpu] = CPU_MASK_NONE;
+		cpus_clear(cpu_sibling_map[cpu]);
 
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		int siblings = 0;
@@ -1305,7 +1307,7 @@ __init void arch_init_sched_domains(void
 		for_each_cpu_mask(j, cpu_domain->span) {
 			struct sched_group *cpu = &sched_group_cpus[j];
 
-			cpu->cpumask = CPU_MASK_NONE;
+			cpus_clear(cpu->cpumask);
 			cpu_set(j, cpu->cpumask);
 
 			if (!first_cpu)

_