aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/smpboot_32.c')
-rw-r--r--arch/x86/kernel/smpboot_32.c137
1 files changed, 0 insertions, 137 deletions
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
index 5a0f57f35191..3a1b9e40cedb 100644
--- a/arch/x86/kernel/smpboot_32.c
+++ b/arch/x86/kernel/smpboot_32.c
@@ -74,7 +74,6 @@ EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid);
74 74
75u8 apicid_2_node[MAX_APICID]; 75u8 apicid_2_node[MAX_APICID];
76 76
77extern void map_cpu_to_logical_apicid(void);
78extern void unmap_cpu_to_logical_apicid(int cpu); 77extern void unmap_cpu_to_logical_apicid(int cpu);
79 78
80#ifdef CONFIG_HOTPLUG_CPU 79#ifdef CONFIG_HOTPLUG_CPU
@@ -94,144 +93,8 @@ void cpu_exit_clear(void)
94} 93}
95#endif 94#endif
96 95
97static int boot_cpu_logical_apicid;
98/* Where the IO area was mapped on multiquad, always 0 otherwise */ 96/* Where the IO area was mapped on multiquad, always 0 otherwise */
99void *xquad_portio; 97void *xquad_portio;
100#ifdef CONFIG_X86_NUMAQ 98#ifdef CONFIG_X86_NUMAQ
101EXPORT_SYMBOL(xquad_portio); 99EXPORT_SYMBOL(xquad_portio);
102#endif 100#endif
103
104static void __init disable_smp(void)
105{
106 cpu_possible_map = cpumask_of_cpu(0);
107 cpu_present_map = cpumask_of_cpu(0);
108 smpboot_clear_io_apic_irqs();
109 if (smp_found_config)
110 phys_cpu_present_map =
111 physid_mask_of_physid(boot_cpu_physical_apicid);
112 else
113 phys_cpu_present_map = physid_mask_of_physid(0);
114 map_cpu_to_logical_apicid();
115 cpu_set(0, per_cpu(cpu_sibling_map, 0));
116 cpu_set(0, per_cpu(cpu_core_map, 0));
117}
118
119static int __init smp_sanity_check(unsigned max_cpus)
120{
121 if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
122 printk(KERN_WARNING "weird, boot CPU (#%d) not listed"
123 "by the BIOS.\n", hard_smp_processor_id());
124 physid_set(hard_smp_processor_id(), phys_cpu_present_map);
125 }
126
127 /*
128 * If we couldn't find an SMP configuration at boot time,
129 * get out of here now!
130 */
131 if (!smp_found_config && !acpi_lapic) {
132 printk(KERN_NOTICE "SMP motherboard not detected.\n");
133 disable_smp();
134 if (APIC_init_uniprocessor())
135 printk(KERN_NOTICE "Local APIC not detected."
136 " Using dummy APIC emulation.\n");
137 return -1;
138 }
139
140 /*
141 * Should not be necessary because the MP table should list the boot
142 * CPU too, but we do it for the sake of robustness anyway.
143 * Makes no sense to do this check in clustered apic mode, so skip it
144 */
145 if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
146 printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
147 boot_cpu_physical_apicid);
148 physid_set(hard_smp_processor_id(), phys_cpu_present_map);
149 }
150
151 /*
152 * If we couldn't find a local APIC, then get out of here now!
153 */
154 if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && !cpu_has_apic) {
155 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
156 boot_cpu_physical_apicid);
157 printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
158 smpboot_clear_io_apic();
159 return -1;
160 }
161
162 verify_local_APIC();
163
164 /*
165 * If SMP should be disabled, then really disable it!
166 */
167 if (!max_cpus) {
168 smp_found_config = 0;
169 printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n");
170
171 if (nmi_watchdog == NMI_LOCAL_APIC) {
172 printk(KERN_INFO "activating minimal APIC for NMI watchdog use.\n");
173 connect_bsp_APIC();
174 setup_local_APIC();
175 end_local_APIC_setup();
176 }
177 smpboot_clear_io_apic();
178 return -1;
179 }
180 return 0;
181}
182
183static void __init smp_cpu_index_default(void)
184{
185 int i;
186 struct cpuinfo_x86 *c;
187
188 for_each_cpu_mask(i, cpu_possible_map) {
189 c = &cpu_data(i);
190 /* mark all to hotplug */
191 c->cpu_index = NR_CPUS;
192 }
193}
194
195void __init native_smp_prepare_cpus(unsigned int max_cpus)
196{
197 nmi_watchdog_default();
198 smp_cpu_index_default();
199 current_cpu_data = boot_cpu_data;
200 cpu_callin_map = cpumask_of_cpu(0);
201 mb();
202
203 /*
204 * Setup boot CPU information
205 */
206 smp_store_cpu_info(0); /* Final full version of the data */
207 boot_cpu_logical_apicid = logical_smp_processor_id();
208 current_thread_info()->cpu = 0;
209
210 set_cpu_sibling_map(0);
211
212 if (smp_sanity_check(max_cpus) < 0) {
213 printk(KERN_INFO "SMP disabled\n");
214 disable_smp();
215 return;
216 }
217
218 if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid) {
219 panic("Boot APIC ID in local APIC unexpected (%d vs %d)",
220 GET_APIC_ID(apic_read(APIC_ID)), boot_cpu_physical_apicid);
221 /* Or can we switch back to PIC here? */
222 }
223
224 connect_bsp_APIC();
225 setup_local_APIC();
226 end_local_APIC_setup();
227 map_cpu_to_logical_apicid();
228
229 setup_portio_remap();
230
231 smpboot_setup_io_apic();
232
233 printk(KERN_INFO "CPU%d: ", 0);
234 print_cpu_info(&cpu_data(0));
235 setup_boot_clock();
236}
237