x86: fix CONFIG_NUMA and nosmp | maxcpus=0/1 crash
commit54ffaa45c5f572ff6c344ca583137d0edf2d78cc
authorIngo Molnar <mingo@elte.hu>
Fri, 19 Oct 2007 18:35:02 +0000 (19 20:35 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 19 Oct 2007 18:35:02 +0000 (19 20:35 +0200)
tree389a89b03cf4c8197e3ed8ac7af78950251ce235
parent3ceba7815cfc0b5d4c2bef5bb58e0c766da63549
x86: fix CONFIG_NUMA and nosmp | maxcpus=0/1 crash

x86 NUMA kernels crash in the scheduler setup code if "nosmp" or
"maxcpus=0" is passed on the boot command line:

| Brought up 1 CPUs
| BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
| printing eip: c011f0b5 *pde = 00000000
| Oops: 0000 [#1] SMP
|
| Pid: 1, comm: swapper Not tainted (2.6.23 #67)
| EIP: 0060:[<c011f0b5>] EFLAGS: 00010246 CPU: 0
| EIP is at sd_degenerate+0x35/0x40

the reason is sloppy spaghetti code in smpboot_32.c that resulted in a
missing map_cpu_to_logical_apicid() call - which also had the side-effect
of setting up the cpu_2_node[] entry for the lone CPU. That resulted in
node_to_cpumask(0) resulting in 00000000 - confusing the sched-domains
setup code.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/smpboot_32.c