aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/mpparse.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2005-09-09 16:01:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:56:43 -0400
commit1299232b5743da454c73853b90b3d2d83dce1737 (patch)
tree84f5fc0c1a3cf0bd9a47baa7f4ed268494d565e2 /arch/i386/kernel/mpparse.c
parent5dce225bd9ea60e28e17076de63df0dee51b2883 (diff)
[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: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/mpparse.c')
-rw-r--r--arch/i386/kernel/mpparse.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index cafaeffe381..15949fd0810 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -122,8 +122,8 @@ static int MP_valid_apicid(int apicid, int version)
122 122
123static void __init MP_processor_info (struct mpc_config_processor *m) 123static void __init MP_processor_info (struct mpc_config_processor *m)
124{ 124{
125 int ver, apicid, cpu, found_bsp = 0; 125 int ver, apicid;
126 physid_mask_t tmp; 126 physid_mask_t phys_cpu;
127 127
128 if (!(m->mpc_cpuflag & CPU_ENABLED)) 128 if (!(m->mpc_cpuflag & CPU_ENABLED))
129 return; 129 return;
@@ -181,7 +181,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
181 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { 181 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
182 Dprintk(" Bootup CPU\n"); 182 Dprintk(" Bootup CPU\n");
183 boot_cpu_physical_apicid = m->mpc_apicid; 183 boot_cpu_physical_apicid = m->mpc_apicid;
184 found_bsp = 1;
185 } 184 }
186 185
187 if (num_processors >= NR_CPUS) { 186 if (num_processors >= NR_CPUS) {
@@ -195,29 +194,26 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
195 " Processor ignored.\n", maxcpus); 194 " Processor ignored.\n", maxcpus);
196 return; 195 return;
197 } 196 }
198 num_processors++;
199 ver = m->mpc_apicver; 197 ver = m->mpc_apicver;
200 198
201 if (!MP_valid_apicid(apicid, ver)) { 199 if (!MP_valid_apicid(apicid, ver)) {
202 printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n", 200 printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
203 m->mpc_apicid, MAX_APICS); 201 m->mpc_apicid, MAX_APICS);
204 --num_processors;
205 return; 202 return;
206 } 203 }
207 204
208 if (found_bsp) 205 cpu_set(num_processors, cpu_possible_map);
209 cpu = 0; 206 num_processors++;
210 else 207 phys_cpu = apicid_to_cpu_present(apicid);
211 cpu = num_processors - 1; 208 physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
212 cpu_set(cpu, cpu_possible_map); 209
213 tmp = apicid_to_cpu_present(apicid);
214 physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp);
215
216 /* 210 /*
217 * Validate version 211 * Validate version
218 */ 212 */
219 if (ver == 0x0) { 213 if (ver == 0x0) {
220 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! fixing up to 0x10. (tell your hw vendor)\n", m->mpc_apicid); 214 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! "
215 "fixing up to 0x10. (tell your hw vendor)\n",
216 m->mpc_apicid);
221 ver = 0x10; 217 ver = 0x10;
222 } 218 }
223 apic_version[m->mpc_apicid] = ver; 219 apic_version[m->mpc_apicid] = ver;