aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/mpparse_32.c
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-03-19 13:25:25 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:01 -0400
commita6c422ccdb57924bd20ae408dba8e9db01d09677 (patch)
tree3df5b830d56291ae024037fcda55ba405ddd306d /arch/x86/kernel/mpparse_32.c
parent73bf102b1cadc53d418df02ba687769a9f916a6d (diff)
x86: fill cpu to apicid and present map in mpparse
This is the way x86_64 does, and complement the already present patch that does the bios cpu to apicid mapping here Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/mpparse_32.c')
-rw-r--r--arch/x86/kernel/mpparse_32.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c
index 6ea97163701f..a0cec74b80ef 100644
--- a/arch/x86/kernel/mpparse_32.c
+++ b/arch/x86/kernel/mpparse_32.c
@@ -105,7 +105,8 @@ static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __cpuinit
105 105
106static void __cpuinit MP_processor_info (struct mpc_config_processor *m) 106static void __cpuinit MP_processor_info (struct mpc_config_processor *m)
107{ 107{
108 int ver, apicid; 108 int ver, apicid, cpu;
109 cpumask_t tmp_map;
109 physid_mask_t phys_cpu; 110 physid_mask_t phys_cpu;
110 111
111 if (!(m->mpc_cpuflag & CPU_ENABLED)) { 112 if (!(m->mpc_cpuflag & CPU_ENABLED)) {
@@ -198,6 +199,16 @@ static void __cpuinit MP_processor_info (struct mpc_config_processor *m)
198 199
199 cpu_set(num_processors, cpu_possible_map); 200 cpu_set(num_processors, cpu_possible_map);
200 num_processors++; 201 num_processors++;
202 cpus_complement(tmp_map, cpu_present_map);
203 cpu = first_cpu(tmp_map);
204
205 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR)
206 /*
207 * x86_bios_cpu_apicid is required to have processors listed
208 * in same order as logical cpu numbers. Hence the first
209 * entry is BSP, and so on.
210 */
211 cpu = 0;
201 212
202 /* 213 /*
203 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y 214 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
@@ -220,12 +231,16 @@ static void __cpuinit MP_processor_info (struct mpc_config_processor *m)
220 } 231 }
221 /* are we being called early in kernel startup? */ 232 /* are we being called early in kernel startup? */
222 if (x86_cpu_to_apicid_early_ptr) { 233 if (x86_cpu_to_apicid_early_ptr) {
234 u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
223 u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr; 235 u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
236
237 cpu_to_apicid[cpu] = m->mpc_apicid;
224 bios_cpu_apicid[num_processors - 1] = m->mpc_apicid; 238 bios_cpu_apicid[num_processors - 1] = m->mpc_apicid;
225 } else { 239 } else {
226 int cpu = num_processors - 1; 240 per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid;
227 per_cpu(x86_bios_cpu_apicid, cpu) = m->mpc_apicid; 241 per_cpu(x86_bios_cpu_apicid, cpu) = m->mpc_apicid;
228 } 242 }
243 cpu_set(cpu, cpu_present_map);
229} 244}
230 245
231static void __init MP_bus_info (struct mpc_config_bus *m) 246static void __init MP_bus_info (struct mpc_config_bus *m)