aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 22:57:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 22:57:56 -0500
commite9a5a919719673b932ac968dfb4332b6f892b025 (patch)
treeb7ea17340055a6a41aa55736ec2b3cd36663ed64
parent74b84233458e9db7c160cec67638efdbec748ca9 (diff)
parent28a793892296ca3367193c7a7de1714f80049fd0 (diff)
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Ingo Molnar: "Small cleanups." * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Fix the error of using "const" in gen-insn-attr-x86.awk x86, apic: Cleanup cfg->domain setup for legacy interrupts x86: Remove dead hlt_use_halt code
-rw-r--r--arch/x86/kernel/apic/io_apic.c26
-rw-r--r--arch/x86/kernel/process.c39
-rw-r--r--arch/x86/tools/gen-insn-attr-x86.awk6
3 files changed, 23 insertions, 48 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index f78fc2b4deb0..70aa621df118 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -234,11 +234,11 @@ int __init arch_early_irq_init(void)
234 zalloc_cpumask_var_node(&cfg[i].old_domain, GFP_KERNEL, node); 234 zalloc_cpumask_var_node(&cfg[i].old_domain, GFP_KERNEL, node);
235 /* 235 /*
236 * For legacy IRQ's, start with assigning irq0 to irq15 to 236 * For legacy IRQ's, start with assigning irq0 to irq15 to
237 * IRQ0_VECTOR to IRQ15_VECTOR on cpu 0. 237 * IRQ0_VECTOR to IRQ15_VECTOR for all cpu's.
238 */ 238 */
239 if (i < legacy_pic->nr_legacy_irqs) { 239 if (i < legacy_pic->nr_legacy_irqs) {
240 cfg[i].vector = IRQ0_VECTOR + i; 240 cfg[i].vector = IRQ0_VECTOR + i;
241 cpumask_set_cpu(0, cfg[i].domain); 241 cpumask_setall(cfg[i].domain);
242 } 242 }
243 } 243 }
244 244
@@ -1141,7 +1141,8 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1141 * allocation for the members that are not used anymore. 1141 * allocation for the members that are not used anymore.
1142 */ 1142 */
1143 cpumask_andnot(cfg->old_domain, cfg->domain, tmp_mask); 1143 cpumask_andnot(cfg->old_domain, cfg->domain, tmp_mask);
1144 cfg->move_in_progress = 1; 1144 cfg->move_in_progress =
1145 cpumask_intersects(cfg->old_domain, cpu_online_mask);
1145 cpumask_and(cfg->domain, cfg->domain, tmp_mask); 1146 cpumask_and(cfg->domain, cfg->domain, tmp_mask);
1146 break; 1147 break;
1147 } 1148 }
@@ -1172,8 +1173,9 @@ next:
1172 current_vector = vector; 1173 current_vector = vector;
1173 current_offset = offset; 1174 current_offset = offset;
1174 if (cfg->vector) { 1175 if (cfg->vector) {
1175 cfg->move_in_progress = 1;
1176 cpumask_copy(cfg->old_domain, cfg->domain); 1176 cpumask_copy(cfg->old_domain, cfg->domain);
1177 cfg->move_in_progress =
1178 cpumask_intersects(cfg->old_domain, cpu_online_mask);
1177 } 1179 }
1178 for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask) 1180 for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask)
1179 per_cpu(vector_irq, new_cpu)[vector] = irq; 1181 per_cpu(vector_irq, new_cpu)[vector] = irq;
@@ -1241,12 +1243,6 @@ void __setup_vector_irq(int cpu)
1241 cfg = irq_get_chip_data(irq); 1243 cfg = irq_get_chip_data(irq);
1242 if (!cfg) 1244 if (!cfg)
1243 continue; 1245 continue;
1244 /*
1245 * If it is a legacy IRQ handled by the legacy PIC, this cpu
1246 * will be part of the irq_cfg's domain.
1247 */
1248 if (irq < legacy_pic->nr_legacy_irqs && !IO_APIC_IRQ(irq))
1249 cpumask_set_cpu(cpu, cfg->domain);
1250 1246
1251 if (!cpumask_test_cpu(cpu, cfg->domain)) 1247 if (!cpumask_test_cpu(cpu, cfg->domain))
1252 continue; 1248 continue;
@@ -1356,16 +1352,6 @@ static void setup_ioapic_irq(unsigned int irq, struct irq_cfg *cfg,
1356 if (!IO_APIC_IRQ(irq)) 1352 if (!IO_APIC_IRQ(irq))
1357 return; 1353 return;
1358 1354
1359 /*
1360 * For legacy irqs, cfg->domain starts with cpu 0. Now that IO-APIC
1361 * can handle this irq and the apic driver is finialized at this point,
1362 * update the cfg->domain.
1363 */
1364 if (irq < legacy_pic->nr_legacy_irqs &&
1365 cpumask_equal(cfg->domain, cpumask_of(0)))
1366 apic->vector_allocation_domain(0, cfg->domain,
1367 apic->target_cpus());
1368
1369 if (assign_irq_vector(irq, cfg, apic->target_cpus())) 1355 if (assign_irq_vector(irq, cfg, apic->target_cpus()))
1370 return; 1356 return;
1371 1357
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index b644e1c765dc..2f99e3121875 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -306,11 +306,6 @@ void (*pm_idle)(void);
306EXPORT_SYMBOL(pm_idle); 306EXPORT_SYMBOL(pm_idle);
307#endif 307#endif
308 308
309static inline int hlt_use_halt(void)
310{
311 return 1;
312}
313
314#ifndef CONFIG_SMP 309#ifndef CONFIG_SMP
315static inline void play_dead(void) 310static inline void play_dead(void)
316{ 311{
@@ -410,28 +405,22 @@ void cpu_idle(void)
410 */ 405 */
411void default_idle(void) 406void default_idle(void)
412{ 407{
413 if (hlt_use_halt()) { 408 trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
414 trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id()); 409 trace_cpu_idle_rcuidle(1, smp_processor_id());
415 trace_cpu_idle_rcuidle(1, smp_processor_id()); 410 current_thread_info()->status &= ~TS_POLLING;
416 current_thread_info()->status &= ~TS_POLLING; 411 /*
417 /* 412 * TS_POLLING-cleared state must be visible before we
418 * TS_POLLING-cleared state must be visible before we 413 * test NEED_RESCHED:
419 * test NEED_RESCHED: 414 */
420 */ 415 smp_mb();
421 smp_mb();
422 416
423 if (!need_resched()) 417 if (!need_resched())
424 safe_halt(); /* enables interrupts racelessly */ 418 safe_halt(); /* enables interrupts racelessly */
425 else 419 else
426 local_irq_enable();
427 current_thread_info()->status |= TS_POLLING;
428 trace_power_end_rcuidle(smp_processor_id());
429 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
430 } else {
431 local_irq_enable(); 420 local_irq_enable();
432 /* loop is done by the caller */ 421 current_thread_info()->status |= TS_POLLING;
433 cpu_relax(); 422 trace_power_end_rcuidle(smp_processor_id());
434 } 423 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
435} 424}
436#ifdef CONFIG_APM_MODULE 425#ifdef CONFIG_APM_MODULE
437EXPORT_SYMBOL(default_idle); 426EXPORT_SYMBOL(default_idle);
diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index ddcf39b1a18d..e6773dc8ac41 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -356,7 +356,7 @@ END {
356 exit 1 356 exit 1
357 # print escape opcode map's array 357 # print escape opcode map's array
358 print "/* Escape opcode map array */" 358 print "/* Escape opcode map array */"
359 print "const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1]" \ 359 print "const insn_attr_t * const inat_escape_tables[INAT_ESC_MAX + 1]" \
360 "[INAT_LSTPFX_MAX + 1] = {" 360 "[INAT_LSTPFX_MAX + 1] = {"
361 for (i = 0; i < geid; i++) 361 for (i = 0; i < geid; i++)
362 for (j = 0; j < max_lprefix; j++) 362 for (j = 0; j < max_lprefix; j++)
@@ -365,7 +365,7 @@ END {
365 print "};\n" 365 print "};\n"
366 # print group opcode map's array 366 # print group opcode map's array
367 print "/* Group opcode map array */" 367 print "/* Group opcode map array */"
368 print "const insn_attr_t const *inat_group_tables[INAT_GRP_MAX + 1]"\ 368 print "const insn_attr_t * const inat_group_tables[INAT_GRP_MAX + 1]"\
369 "[INAT_LSTPFX_MAX + 1] = {" 369 "[INAT_LSTPFX_MAX + 1] = {"
370 for (i = 0; i < ggid; i++) 370 for (i = 0; i < ggid; i++)
371 for (j = 0; j < max_lprefix; j++) 371 for (j = 0; j < max_lprefix; j++)
@@ -374,7 +374,7 @@ END {
374 print "};\n" 374 print "};\n"
375 # print AVX opcode map's array 375 # print AVX opcode map's array
376 print "/* AVX opcode map array */" 376 print "/* AVX opcode map array */"
377 print "const insn_attr_t const *inat_avx_tables[X86_VEX_M_MAX + 1]"\ 377 print "const insn_attr_t * const inat_avx_tables[X86_VEX_M_MAX + 1]"\
378 "[INAT_LSTPFX_MAX + 1] = {" 378 "[INAT_LSTPFX_MAX + 1] = {"
379 for (i = 0; i < gaid; i++) 379 for (i = 0; i < gaid; i++)
380 for (j = 0; j < max_lprefix; j++) 380 for (j = 0; j < max_lprefix; j++)