diff options
Diffstat (limited to 'arch/x86/kernel/mpparse_64.c')
-rw-r--r-- | arch/x86/kernel/mpparse_64.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c index ef4aab123581..72ab1403fed7 100644 --- a/arch/x86/kernel/mpparse_64.c +++ b/arch/x86/kernel/mpparse_64.c | |||
@@ -60,14 +60,18 @@ unsigned int boot_cpu_id = -1U; | |||
60 | EXPORT_SYMBOL(boot_cpu_id); | 60 | EXPORT_SYMBOL(boot_cpu_id); |
61 | 61 | ||
62 | /* Internal processor count */ | 62 | /* Internal processor count */ |
63 | unsigned int num_processors __cpuinitdata = 0; | 63 | unsigned int num_processors; |
64 | 64 | ||
65 | unsigned disabled_cpus __cpuinitdata; | 65 | unsigned disabled_cpus __cpuinitdata; |
66 | 66 | ||
67 | /* Bitmask of physically existing CPUs */ | 67 | /* Bitmask of physically existing CPUs */ |
68 | physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; | 68 | physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; |
69 | 69 | ||
70 | u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; | 70 | u16 x86_bios_cpu_apicid_init[NR_CPUS] __initdata |
71 | = { [0 ... NR_CPUS-1] = BAD_APICID }; | ||
72 | void *x86_bios_cpu_apicid_early_ptr; | ||
73 | DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID; | ||
74 | EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid); | ||
71 | 75 | ||
72 | 76 | ||
73 | /* | 77 | /* |
@@ -118,24 +122,22 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m) | |||
118 | physid_set(m->mpc_apicid, phys_cpu_present_map); | 122 | physid_set(m->mpc_apicid, phys_cpu_present_map); |
119 | if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { | 123 | if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { |
120 | /* | 124 | /* |
121 | * bios_cpu_apicid is required to have processors listed | 125 | * x86_bios_cpu_apicid is required to have processors listed |
122 | * in same order as logical cpu numbers. Hence the first | 126 | * in same order as logical cpu numbers. Hence the first |
123 | * entry is BSP, and so on. | 127 | * entry is BSP, and so on. |
124 | */ | 128 | */ |
125 | cpu = 0; | 129 | cpu = 0; |
126 | } | 130 | } |
127 | bios_cpu_apicid[cpu] = m->mpc_apicid; | 131 | /* are we being called early in kernel startup? */ |
128 | /* | 132 | if (x86_cpu_to_apicid_early_ptr) { |
129 | * We get called early in the the start_kernel initialization | 133 | u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr; |
130 | * process when the per_cpu data area is not yet setup, so we | 134 | u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr; |
131 | * use a static array that is removed after the per_cpu data | 135 | |
132 | * area is created. | 136 | cpu_to_apicid[cpu] = m->mpc_apicid; |
133 | */ | 137 | bios_cpu_apicid[cpu] = m->mpc_apicid; |
134 | if (x86_cpu_to_apicid_ptr) { | ||
135 | u8 *x86_cpu_to_apicid = (u8 *)x86_cpu_to_apicid_ptr; | ||
136 | x86_cpu_to_apicid[cpu] = m->mpc_apicid; | ||
137 | } else { | 138 | } else { |
138 | per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid; | 139 | per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid; |
140 | per_cpu(x86_bios_cpu_apicid, cpu) = m->mpc_apicid; | ||
139 | } | 141 | } |
140 | 142 | ||
141 | cpu_set(cpu, cpu_possible_map); | 143 | cpu_set(cpu, cpu_possible_map); |