• Ingo Molnar's avatar
    x86: fix CONFIG_NUMA and nosmp | maxcpus=0/1 crash · 54ffaa45
    Ingo Molnar authored
    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: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    54ffaa45
smpboot_32.c 32.5 KB