aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2015-08-16 11:45:48 -0400
committerIngo Molnar <mingo@kernel.org>2015-08-17 04:42:28 -0400
commit656bba306827a44ed73b3f93f75bb3147de17fae (patch)
tree649f20edd161667db4bf441847e34c5f8f38b6d9 /arch
parenta9bcaa02a5104ace6a9d9e4a9cd9192a9e7744d6 (diff)
x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted
Both the per-APIC flag ".wait_for_init_deassert", and the global atomic_t "init_deasserted" are dead code -- remove them. For all APIC types, "wait_for_master()" prevents an AP from proceeding until the BSP has set cpu_callout_mask, making "init_deasserted" {unnecessary}: BSP: <de-assert INIT> ... BSP: {set init_deasserted} AP: wait_for_master() set cpu_initialized_mask wait for cpu_callout_mask BSP: test cpu_initialized_mask BSP: set cpu_callout_mask AP: test cpu_callout_mask AP: {wait for init_deasserted} ... AP: <touch APIC> Deleting the {dead code} above is necessary to enable some parallelism in a future patch. Signed-off-by: Len Brown <len.brown@intel.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: Jan H. Schönherr <jschoenh@amazon.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Link: http://lkml.kernel.org/r/de4b3a9bab894735e285870b5296da25ee6a8a5a.1439739165.git.len.brown@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/apic.h2
-rw-r--r--arch/x86/kernel/apic/apic_flat_64.c2
-rw-r--r--arch/x86/kernel/apic/apic_noop.c1
-rw-r--r--arch/x86/kernel/apic/apic_numachip.c2
-rw-r--r--arch/x86/kernel/apic/bigsmp_32.c1
-rw-r--r--arch/x86/kernel/apic/probe_32.c1
-rw-r--r--arch/x86/kernel/apic/x2apic_cluster.c1
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c1
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c2
-rw-r--r--arch/x86/kernel/smpboot.c16
10 files changed, 3 insertions, 26 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index c8393634ca0c..ebf6d5e5668c 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -313,7 +313,6 @@ struct apic {
313 /* wakeup_secondary_cpu */ 313 /* wakeup_secondary_cpu */
314 int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); 314 int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
315 315
316 bool wait_for_init_deassert;
317 void (*inquire_remote_apic)(int apicid); 316 void (*inquire_remote_apic)(int apicid);
318 317
319 /* apic ops */ 318 /* apic ops */
@@ -378,7 +377,6 @@ extern struct apic *__apicdrivers[], *__apicdrivers_end[];
378 * APIC functionality to boot other CPUs - only used on SMP: 377 * APIC functionality to boot other CPUs - only used on SMP:
379 */ 378 */
380#ifdef CONFIG_SMP 379#ifdef CONFIG_SMP
381extern atomic_t init_deasserted;
382extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip); 380extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip);
383#endif 381#endif
384 382
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index de918c410eae..f92ab36979a2 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -191,7 +191,6 @@ static struct apic apic_flat = {
191 .send_IPI_all = flat_send_IPI_all, 191 .send_IPI_all = flat_send_IPI_all,
192 .send_IPI_self = apic_send_IPI_self, 192 .send_IPI_self = apic_send_IPI_self,
193 193
194 .wait_for_init_deassert = false,
195 .inquire_remote_apic = default_inquire_remote_apic, 194 .inquire_remote_apic = default_inquire_remote_apic,
196 195
197 .read = native_apic_mem_read, 196 .read = native_apic_mem_read,
@@ -299,7 +298,6 @@ static struct apic apic_physflat = {
299 .send_IPI_all = physflat_send_IPI_all, 298 .send_IPI_all = physflat_send_IPI_all,
300 .send_IPI_self = apic_send_IPI_self, 299 .send_IPI_self = apic_send_IPI_self,
301 300
302 .wait_for_init_deassert = false,
303 .inquire_remote_apic = default_inquire_remote_apic, 301 .inquire_remote_apic = default_inquire_remote_apic,
304 302
305 .read = native_apic_mem_read, 303 .read = native_apic_mem_read,
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
index b205cdbdbe6a..0d96749cfcac 100644
--- a/arch/x86/kernel/apic/apic_noop.c
+++ b/arch/x86/kernel/apic/apic_noop.c
@@ -152,7 +152,6 @@ struct apic apic_noop = {
152 152
153 .wakeup_secondary_cpu = noop_wakeup_secondary_cpu, 153 .wakeup_secondary_cpu = noop_wakeup_secondary_cpu,
154 154
155 .wait_for_init_deassert = false,
156 .inquire_remote_apic = NULL, 155 .inquire_remote_apic = NULL,
157 156
158 .read = noop_apic_read, 157 .read = noop_apic_read,
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index 017149cded07..b548fd3b764b 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -92,7 +92,6 @@ static int numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip)
92 92
93 write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v); 93 write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v);
94 94
95 atomic_set(&init_deasserted, 1);
96 return 0; 95 return 0;
97} 96}
98 97
@@ -235,7 +234,6 @@ static const struct apic apic_numachip __refconst = {
235 .send_IPI_self = numachip_send_IPI_self, 234 .send_IPI_self = numachip_send_IPI_self,
236 235
237 .wakeup_secondary_cpu = numachip_wakeup_secondary, 236 .wakeup_secondary_cpu = numachip_wakeup_secondary,
238 .wait_for_init_deassert = false,
239 .inquire_remote_apic = NULL, /* REMRD not supported */ 237 .inquire_remote_apic = NULL, /* REMRD not supported */
240 238
241 .read = native_apic_mem_read, 239 .read = native_apic_mem_read,
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index c4a8d63f8220..971cf8875939 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -186,7 +186,6 @@ static struct apic apic_bigsmp = {
186 .send_IPI_all = bigsmp_send_IPI_all, 186 .send_IPI_all = bigsmp_send_IPI_all,
187 .send_IPI_self = default_send_IPI_self, 187 .send_IPI_self = default_send_IPI_self,
188 188
189 .wait_for_init_deassert = true,
190 .inquire_remote_apic = default_inquire_remote_apic, 189 .inquire_remote_apic = default_inquire_remote_apic,
191 190
192 .read = native_apic_mem_read, 191 .read = native_apic_mem_read,
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
index bda488680dbc..7694ae6c1199 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -111,7 +111,6 @@ static struct apic apic_default = {
111 .send_IPI_all = default_send_IPI_all, 111 .send_IPI_all = default_send_IPI_all,
112 .send_IPI_self = default_send_IPI_self, 112 .send_IPI_self = default_send_IPI_self,
113 113
114 .wait_for_init_deassert = true,
115 .inquire_remote_apic = default_inquire_remote_apic, 114 .inquire_remote_apic = default_inquire_remote_apic,
116 115
117 .read = native_apic_mem_read, 116 .read = native_apic_mem_read,
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index ab3219b3fbda..1b6c1a4526a5 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -272,7 +272,6 @@ static struct apic apic_x2apic_cluster = {
272 .send_IPI_all = x2apic_send_IPI_all, 272 .send_IPI_all = x2apic_send_IPI_all,
273 .send_IPI_self = x2apic_send_IPI_self, 273 .send_IPI_self = x2apic_send_IPI_self,
274 274
275 .wait_for_init_deassert = false,
276 .inquire_remote_apic = NULL, 275 .inquire_remote_apic = NULL,
277 276
278 .read = native_apic_msr_read, 277 .read = native_apic_msr_read,
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 3ffd925655e0..662e9150ea6f 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -128,7 +128,6 @@ static struct apic apic_x2apic_phys = {
128 .send_IPI_all = x2apic_send_IPI_all, 128 .send_IPI_all = x2apic_send_IPI_all,
129 .send_IPI_self = x2apic_send_IPI_self, 129 .send_IPI_self = x2apic_send_IPI_self,
130 130
131 .wait_for_init_deassert = false,
132 .inquire_remote_apic = NULL, 131 .inquire_remote_apic = NULL,
133 132
134 .read = native_apic_msr_read, 133 .read = native_apic_msr_read,
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index c8d92950bc04..4a139465f1d4 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -248,7 +248,6 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
248 APIC_DM_STARTUP; 248 APIC_DM_STARTUP;
249 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 249 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
250 250
251 atomic_set(&init_deasserted, 1);
252 return 0; 251 return 0;
253} 252}
254 253
@@ -414,7 +413,6 @@ static struct apic __refdata apic_x2apic_uv_x = {
414 .send_IPI_self = uv_send_IPI_self, 413 .send_IPI_self = uv_send_IPI_self,
415 414
416 .wakeup_secondary_cpu = uv_wakeup_secondary, 415 .wakeup_secondary_cpu = uv_wakeup_secondary,
417 .wait_for_init_deassert = false,
418 .inquire_remote_apic = NULL, 416 .inquire_remote_apic = NULL,
419 417
420 .read = native_apic_msr_read, 418 .read = native_apic_msr_read,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 674026455fee..c15d0073c829 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -97,8 +97,6 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map);
97DEFINE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info); 97DEFINE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info);
98EXPORT_PER_CPU_SYMBOL(cpu_info); 98EXPORT_PER_CPU_SYMBOL(cpu_info);
99 99
100atomic_t init_deasserted;
101
102static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) 100static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
103{ 101{
104 unsigned long flags; 102 unsigned long flags;
@@ -146,16 +144,11 @@ static void smp_callin(void)
146 144
147 /* 145 /*
148 * If waken up by an INIT in an 82489DX configuration 146 * If waken up by an INIT in an 82489DX configuration
149 * we may get here before an INIT-deassert IPI reaches 147 * cpu_callout_mask guarantees we don't get here before
150 * our local APIC. We have to wait for the IPI or we'll 148 * an INIT_deassert IPI reaches our local APIC, so it is
151 * lock up on an APIC access. 149 * now safe to touch our local APIC.
152 *
153 * Since CPU0 is not wakened up by INIT, it doesn't wait for the IPI.
154 */ 150 */
155 cpuid = smp_processor_id(); 151 cpuid = smp_processor_id();
156 if (apic->wait_for_init_deassert && cpuid)
157 while (!atomic_read(&init_deasserted))
158 cpu_relax();
159 152
160 /* 153 /*
161 * (This works even if the APIC is not enabled.) 154 * (This works even if the APIC is not enabled.)
@@ -620,7 +613,6 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
620 send_status = safe_apic_wait_icr_idle(); 613 send_status = safe_apic_wait_icr_idle();
621 614
622 mb(); 615 mb();
623 atomic_set(&init_deasserted, 1);
624 616
625 /* 617 /*
626 * Should we send STARTUP IPIs ? 618 * Should we send STARTUP IPIs ?
@@ -861,8 +853,6 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
861 * the targeted processor. 853 * the targeted processor.
862 */ 854 */
863 855
864 atomic_set(&init_deasserted, 0);
865
866 if (get_uv_system_type() != UV_NON_UNIQUE_APIC) { 856 if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
867 857
868 pr_debug("Setting warm reset code and vector.\n"); 858 pr_debug("Setting warm reset code and vector.\n");