• Andi Kleen's avatar
    [PATCH] x86-64: sibling map fix for clustered mode · 4bf5cb5e
    Andi Kleen authored
    From: James Cleverdon
    
    The value that cpuinfo returns for command 1 in ebx is the physical APIC ID
    latched when the system comes out of reset.
    
    Ordinarily, this is identical to the value in the local APIC's ID register,
    because nearly all BIOSes accept the HW assigned value.
    
    Our systems, made up of individual building blocks, can't do that.  Each
    node boots as a separate system and is joined together by the BIOS.  Thus,
    the BIOS rewrites the local APIC ID register with a new value.
    
    Potomac and Nocona chips have a mechanism by which the BIOS writer can
    change bits 7:5 to match the assigned cluster ID.  Bits 2:0 come from the
    thread ID.  However, bits 4:3 are still those latched at reset.  Oops!
    
    Summary: Large clustered systems can't use cpuid to derive the sibling
    information.
    
    Fix: Use the local APIC ID.  That's the value we use to online the CPUs, so
    it had better be OK.  For non-clustered systems, cpuid == local APIC, so
    nothing but large boxes should be affected.
    Signed-off-by: default avatarAndi Kleen <ak@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    4bf5cb5e
setup.c 30.9 KB