Skip to contentSkip to conversation

Make SMP x86-64 kernels boot on more UP systems.

PATCH Dave Jones 2 participants 3 messages Feb 24, 2006

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Should someone boot an SMP kernel on UP hardware on some systems, strange things happen, such as..

SMP: Allowing 0 CPUs.

We blow up shortly afterwards.

arch/x86_64/kernel/smpboot.c renamed from arch/x86_64/kernel/smpboot.c~ +5 -0
@@ -975,6 +975,11 @@ __init void prefill_possible_map(void)
 	if (possible > NR_CPUS) 
 		possible = NR_CPUS;
 
+	if (possible == 0) {	/* Could be SMP kernel on UP hw with broken BIOS */
+		possible = 1;
+		printk (KERN_DEBUG "BIOS never enumerated boot CPU, fixing.\n");
+	}
+
 	printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
 		possible,
 	        max_t(int, possible - num_processors, 0));
#1 lore raw
Quoted 2 lines · Dave Jones

Should someone boot an SMP kernel on UP hardware on some systems, strange things happen, such as..

Boot logs?

Quoted 9 lines

SMP: Allowing 0 CPUs.

We blow up shortly afterwards.

arch/x86_64/kernel/smpboot.c __init void prefill_possible_map(void) · line 981

Quoted 7 lines
arch/x86_64/kernel/smpboot.c renamed from arch/x86_64/kernel/smpboot.c~ +4 -0
@@ -975,6 +975,11 @@ __init void prefill_possible_map(void)
 	if (possible > NR_CPUS) 
 		possible = NR_CPUS;
 
+	if (possible == 0) {	/* Could be SMP kernel on UP hw with broken BIOS */
+		possible = 1;
+		printk (KERN_DEBUG "BIOS never enumerated boot CPU, fixing.\n");
+	}

It's the wrong place to handle this. Better would be in mpparse.c

-Andi

author
#2 lore raw
Quoted 4 lines · Andi Kleen
Quoted 2 lines · Dave Jones

Should someone boot an SMP kernel on UP hardware on some systems, strange things happen, such as..

Boot logs?

https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=124341

Quoted 5 lines
Quoted 5 lines

SMP: Allowing 0 CPUs.

We blow up shortly afterwards.

revisiting the bug, I'm not 100% sure my patch was the actual fix or just something cosmetic, as I changed other things too in subsequent kernels. I'll get the user to double check it.

Dave