Commit 1299232b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] x86: MP_processor_info fix

Remove the weird and apparently unnecessary logic in MP_processor_info() which
assumes that the BSP is the first one to run MP_processor_info().  On one of
my boxes that isn't true and cpu_possible_map gets the wrong value.

Cc: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: Alexander Nyberg <alexn@telia.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5dce225b
...@@ -122,8 +122,8 @@ static int MP_valid_apicid(int apicid, int version) ...@@ -122,8 +122,8 @@ static int MP_valid_apicid(int apicid, int version)
static void __init MP_processor_info (struct mpc_config_processor *m) static void __init MP_processor_info (struct mpc_config_processor *m)
{ {
int ver, apicid, cpu, found_bsp = 0; int ver, apicid;
physid_mask_t tmp; physid_mask_t phys_cpu;
if (!(m->mpc_cpuflag & CPU_ENABLED)) if (!(m->mpc_cpuflag & CPU_ENABLED))
return; return;
...@@ -181,7 +181,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m) ...@@ -181,7 +181,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
Dprintk(" Bootup CPU\n"); Dprintk(" Bootup CPU\n");
boot_cpu_physical_apicid = m->mpc_apicid; boot_cpu_physical_apicid = m->mpc_apicid;
found_bsp = 1;
} }
if (num_processors >= NR_CPUS) { if (num_processors >= NR_CPUS) {
...@@ -195,29 +194,26 @@ static void __init MP_processor_info (struct mpc_config_processor *m) ...@@ -195,29 +194,26 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
" Processor ignored.\n", maxcpus); " Processor ignored.\n", maxcpus);
return; return;
} }
num_processors++;
ver = m->mpc_apicver; ver = m->mpc_apicver;
if (!MP_valid_apicid(apicid, ver)) { if (!MP_valid_apicid(apicid, ver)) {
printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n", printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
m->mpc_apicid, MAX_APICS); m->mpc_apicid, MAX_APICS);
--num_processors;
return; return;
} }
if (found_bsp) cpu_set(num_processors, cpu_possible_map);
cpu = 0; num_processors++;
else phys_cpu = apicid_to_cpu_present(apicid);
cpu = num_processors - 1; physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
cpu_set(cpu, cpu_possible_map);
tmp = apicid_to_cpu_present(apicid);
physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp);
/* /*
* Validate version * Validate version
*/ */
if (ver == 0x0) { if (ver == 0x0) {
printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! fixing up to 0x10. (tell your hw vendor)\n", m->mpc_apicid); printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! "
"fixing up to 0x10. (tell your hw vendor)\n",
m->mpc_apicid);
ver = 0x10; ver = 0x10;
} }
apic_version[m->mpc_apicid] = ver; apic_version[m->mpc_apicid] = ver;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment