|
@@ -2202,27 +2202,37 @@ void __init apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void __init bsp_end_local_APIC_setup(void)
|
|
|
+static void __init apic_bsp_up_setup(void)
|
|
|
{
|
|
|
- end_local_APIC_setup();
|
|
|
+#ifdef CONFIG_X86_64
|
|
|
+ apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid));
|
|
|
+#else
|
|
|
/*
|
|
|
- * Now that local APIC setup is completed for BP, configure the fault
|
|
|
- * handling for interrupt remapping.
|
|
|
+ * Hack: In case of kdump, after a crash, kernel might be booting
|
|
|
+ * on a cpu with non-zero lapic id. But boot_cpu_physical_apicid
|
|
|
+ * might be zero if read from MP tables. Get it from LAPIC.
|
|
|
*/
|
|
|
- irq_remap_enable_fault_handling();
|
|
|
+# ifdef CONFIG_CRASH_DUMP
|
|
|
+ boot_cpu_physical_apicid = read_apic_id();
|
|
|
+# endif
|
|
|
+#endif
|
|
|
+ physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* apic_bsp_setup - Setup function for local apic and io-apic
|
|
|
+ * @upmode: Force UP mode (for APIC_init_uniprocessor)
|
|
|
*
|
|
|
* Returns:
|
|
|
* apic_id of BSP APIC
|
|
|
*/
|
|
|
-int __init apic_bsp_setup(void)
|
|
|
+int __init apic_bsp_setup(bool upmode)
|
|
|
{
|
|
|
int id;
|
|
|
|
|
|
connect_bsp_APIC();
|
|
|
+ if (upmode)
|
|
|
+ apic_bsp_up_setup();
|
|
|
setup_local_APIC();
|
|
|
|
|
|
if (x2apic_mode)
|
|
@@ -2231,7 +2241,8 @@ int __init apic_bsp_setup(void)
|
|
|
id = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
|
|
|
|
|
|
enable_IO_APIC();
|
|
|
- bsp_end_local_APIC_setup();
|
|
|
+ end_local_APIC_setup();
|
|
|
+ irq_remap_enable_fault_handling();
|
|
|
setup_IO_APIC();
|
|
|
return id;
|
|
|
}
|
|
@@ -2267,32 +2278,12 @@ int __init APIC_init_uniprocessor(void)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- default_setup_apic_routing();
|
|
|
+ if (!smp_found_config)
|
|
|
+ disable_ioapic_support();
|
|
|
|
|
|
+ default_setup_apic_routing();
|
|
|
verify_local_APIC();
|
|
|
- connect_bsp_APIC();
|
|
|
-
|
|
|
-#ifdef CONFIG_X86_64
|
|
|
- apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid));
|
|
|
-#else
|
|
|
- /*
|
|
|
- * Hack: In case of kdump, after a crash, kernel might be booting
|
|
|
- * on a cpu with non-zero lapic id. But boot_cpu_physical_apicid
|
|
|
- * might be zero if read from MP tables. Get it from LAPIC.
|
|
|
- */
|
|
|
-# ifdef CONFIG_CRASH_DUMP
|
|
|
- boot_cpu_physical_apicid = read_apic_id();
|
|
|
-# endif
|
|
|
-#endif
|
|
|
- physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
|
|
|
- setup_local_APIC();
|
|
|
-
|
|
|
- if (smp_found_config)
|
|
|
- enable_IO_APIC();
|
|
|
-
|
|
|
- bsp_end_local_APIC_setup();
|
|
|
-
|
|
|
- setup_IO_APIC();
|
|
|
+ apic_bsp_setup(true);
|
|
|
|
|
|
x86_init.timers.setup_percpu_clockev();
|
|
|
return 0;
|