aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-01-15 16:22:35 -0500
committerThomas Gleixner <tglx@linutronix.de>2015-01-22 09:10:56 -0500
commitef4c59a4b64c62f977187cae444aee25bebb02fe (patch)
treea3e0b34cc5190b7315531f123ea6312731c9d20b
parent35e4c6d30e6f69745d77afd5f63203ad440bed12 (diff)
x86/smpboot: Cleanup ioapic handling
smpboot is very creative with the ways to disable ioapic. smpboot_clear_io_apic() smpboot_clear_io_apic_irqs() and disable_ioapic_support() serve a similar purpose. smpboot_clear_io_apic_irqs() is the most useless of all functions as it clears a variable which has not been setup yet. Aside of that it has the same ifdef mess and conditionals around the ioapic related code, which can now be removed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Borislav Petkov <bp@alien8.de> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: Tony Luck <tony.luck@intel.com> Link: http://lkml.kernel.org/r/20150115211703.650280684@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/kernel/smpboot.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 110ed1145e27..ca7f7b696f07 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -103,13 +103,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_info);
103 103
104atomic_t init_deasserted; 104atomic_t init_deasserted;
105 105
106static inline void smpboot_clear_io_apic_irqs(void)
107{
108#ifdef CONFIG_X86_IO_APIC
109 io_apic_irqs = 0;
110#endif
111}
112
113static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) 106static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
114{ 107{
115 unsigned long flags; 108 unsigned long flags;
@@ -147,27 +140,6 @@ static inline void smpboot_restore_warm_reset_vector(void)
147 *((volatile u32 *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0; 140 *((volatile u32 *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0;
148} 141}
149 142
150static inline void __init smpboot_setup_io_apic(void)
151{
152#ifdef CONFIG_X86_IO_APIC
153 /*
154 * Here we can be sure that there is an IO-APIC in the system. Let's
155 * go and set it up:
156 */
157 if (!skip_ioapic_setup && nr_ioapics)
158 setup_IO_APIC();
159 else
160 nr_ioapics = 0;
161#endif
162}
163
164static inline void smpboot_clear_io_apic(void)
165{
166#ifdef CONFIG_X86_IO_APIC
167 nr_ioapics = 0;
168#endif
169}
170
171/* 143/*
172 * Report back to the Boot Processor during boot time or to the caller processor 144 * Report back to the Boot Processor during boot time or to the caller processor
173 * during CPU online. 145 * during CPU online.
@@ -1019,9 +991,10 @@ void arch_disable_smp_support(void)
1019 */ 991 */
1020static __init void disable_smp(void) 992static __init void disable_smp(void)
1021{ 993{
994 disable_ioapic_support();
995
1022 init_cpu_present(cpumask_of(0)); 996 init_cpu_present(cpumask_of(0));
1023 init_cpu_possible(cpumask_of(0)); 997 init_cpu_possible(cpumask_of(0));
1024 smpboot_clear_io_apic_irqs();
1025 998
1026 if (smp_found_config) 999 if (smp_found_config)
1027 physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); 1000 physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
@@ -1105,7 +1078,6 @@ static int __init smp_sanity_check(unsigned max_cpus)
1105 boot_cpu_physical_apicid); 1078 boot_cpu_physical_apicid);
1106 pr_err("... forcing use of dummy APIC emulation (tell your hw vendor)\n"); 1079 pr_err("... forcing use of dummy APIC emulation (tell your hw vendor)\n");
1107 } 1080 }
1108 smpboot_clear_io_apic();
1109 disable_ioapic_support(); 1081 disable_ioapic_support();
1110 return -1; 1082 return -1;
1111 } 1083 }
@@ -1117,7 +1089,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
1117 */ 1089 */
1118 if (!max_cpus) { 1090 if (!max_cpus) {
1119 pr_info("SMP mode deactivated\n"); 1091 pr_info("SMP mode deactivated\n");
1120 smpboot_clear_io_apic(); 1092 disable_ioapic_support();
1121 1093
1122 connect_bsp_APIC(); 1094 connect_bsp_APIC();
1123 setup_local_APIC(); 1095 setup_local_APIC();
@@ -1191,18 +1163,15 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1191 else 1163 else
1192 cpu0_logical_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); 1164 cpu0_logical_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
1193 1165
1194 /* 1166 /* Enable IO APIC before setting up error vector */
1195 * Enable IO APIC before setting up error vector 1167 enable_IO_APIC();
1196 */
1197 if (!skip_ioapic_setup && nr_ioapics)
1198 enable_IO_APIC();
1199 1168
1200 bsp_end_local_APIC_setup(); 1169 bsp_end_local_APIC_setup();
1201 smpboot_setup_io_apic(); 1170 setup_IO_APIC();
1171
1202 /* 1172 /*
1203 * Set up local APIC timer on boot CPU. 1173 * Set up local APIC timer on boot CPU.
1204 */ 1174 */
1205
1206 pr_info("CPU%d: ", 0); 1175 pr_info("CPU%d: ", 0);
1207 print_cpu_info(&cpu_data(0)); 1176 print_cpu_info(&cpu_data(0));
1208 x86_init.timers.setup_percpu_clockev(); 1177 x86_init.timers.setup_percpu_clockev();
@@ -1241,9 +1210,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1241 1210
1242 nmi_selftest(); 1211 nmi_selftest();
1243 impress_friends(); 1212 impress_friends();
1244#ifdef CONFIG_X86_IO_APIC
1245 setup_ioapic_dest(); 1213 setup_ioapic_dest();
1246#endif
1247 mtrr_aps_init(); 1214 mtrr_aps_init();
1248} 1215}
1249 1216