aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@redhat.com>2012-06-07 09:14:49 -0400
committerIngo Molnar <mingo@kernel.org>2012-06-08 05:44:27 -0400
commit9d8e10667624ea6411f04495aef1fa4a8a778ee8 (patch)
treed804e319fbb27a21e532b9888d9ee3b13c2640a9 /arch/x86
parent6398268d2bc454735f11e08705e858f9fdf5c750 (diff)
x86/apic: Factor out default vector_allocation_domain() operation
Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/20120607131449.GC4759@dhcp-26-207.brq.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/apic.h21
-rw-r--r--arch/x86/kernel/apic/apic_flat_64.c22
-rw-r--r--arch/x86/kernel/apic/apic_noop.c3
-rw-r--r--arch/x86/kernel/apic/apic_numachip.c8
-rw-r--r--arch/x86/kernel/apic/bigsmp_32.c8
-rw-r--r--arch/x86/kernel/apic/es7000_32.c19
-rw-r--r--arch/x86/kernel/apic/numaq_32.c16
-rw-r--r--arch/x86/kernel/apic/probe_32.c17
-rw-r--r--arch/x86/kernel/apic/summit_32.c16
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c11
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c8
11 files changed, 32 insertions, 117 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index bef571769e68..feb2dbdae9ec 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -615,6 +615,27 @@ extern unsigned int
615default_cpu_mask_to_apicid_and(const struct cpumask *cpumask, 615default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
616 const struct cpumask *andmask); 616 const struct cpumask *andmask);
617 617
618static inline void
619flat_vector_allocation_domain(int cpu, struct cpumask *retmask)
620{
621 /* Careful. Some cpus do not strictly honor the set of cpus
622 * specified in the interrupt destination when using lowest
623 * priority interrupt delivery mode.
624 *
625 * In particular there was a hyperthreading cpu observed to
626 * deliver interrupts to the wrong hyperthread when only one
627 * hyperthread was specified in the interrupt desitination.
628 */
629 cpumask_clear(retmask);
630 cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
631}
632
633static inline void
634default_vector_allocation_domain(int cpu, struct cpumask *retmask)
635{
636 cpumask_copy(retmask, cpumask_of(cpu));
637}
638
618static inline unsigned long default_check_apicid_used(physid_mask_t *map, int apicid) 639static inline unsigned long default_check_apicid_used(physid_mask_t *map, int apicid)
619{ 640{
620 return physid_isset(apicid, *map); 641 return physid_isset(apicid, *map);
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index 55b97ce4fa19..bddc92566d0a 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -36,20 +36,6 @@ static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
36 return 1; 36 return 1;
37} 37}
38 38
39static void flat_vector_allocation_domain(int cpu, struct cpumask *retmask)
40{
41 /* Careful. Some cpus do not strictly honor the set of cpus
42 * specified in the interrupt destination when using lowest
43 * priority interrupt delivery mode.
44 *
45 * In particular there was a hyperthreading cpu observed to
46 * deliver interrupts to the wrong hyperthread when only one
47 * hyperthread was specified in the interrupt desitination.
48 */
49 cpumask_clear(retmask);
50 cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
51}
52
53/* 39/*
54 * Set up the logical destination ID. 40 * Set up the logical destination ID.
55 * 41 *
@@ -257,12 +243,6 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
257 return 0; 243 return 0;
258} 244}
259 245
260static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask)
261{
262 cpumask_clear(retmask);
263 cpumask_set_cpu(cpu, retmask);
264}
265
266static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector) 246static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector)
267{ 247{
268 default_send_IPI_mask_sequence_phys(cpumask, vector); 248 default_send_IPI_mask_sequence_phys(cpumask, vector);
@@ -309,7 +289,7 @@ static struct apic apic_physflat = {
309 .check_apicid_used = NULL, 289 .check_apicid_used = NULL,
310 .check_apicid_present = NULL, 290 .check_apicid_present = NULL,
311 291
312 .vector_allocation_domain = physflat_vector_allocation_domain, 292 .vector_allocation_domain = default_vector_allocation_domain,
313 /* not needed, but shouldn't hurt: */ 293 /* not needed, but shouldn't hurt: */
314 .init_apic_ldr = flat_init_apic_ldr, 294 .init_apic_ldr = flat_init_apic_ldr,
315 295
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
index 7c3dd4fe0686..3e43cf528939 100644
--- a/arch/x86/kernel/apic/apic_noop.c
+++ b/arch/x86/kernel/apic/apic_noop.c
@@ -104,8 +104,7 @@ static void noop_vector_allocation_domain(int cpu, struct cpumask *retmask)
104{ 104{
105 if (cpu != 0) 105 if (cpu != 0)
106 pr_warning("APIC: Vector allocated for non-BSP cpu\n"); 106 pr_warning("APIC: Vector allocated for non-BSP cpu\n");
107 cpumask_clear(retmask); 107 cpumask_copy(retmask, cpumask_of(cpu));
108 cpumask_set_cpu(cpu, retmask);
109} 108}
110 109
111static u32 noop_apic_read(u32 reg) 110static u32 noop_apic_read(u32 reg)
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index dba4bf2ed566..c028132ad358 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -72,12 +72,6 @@ static int numachip_phys_pkg_id(int initial_apic_id, int index_msb)
72 return initial_apic_id >> index_msb; 72 return initial_apic_id >> index_msb;
73} 73}
74 74
75static void numachip_vector_allocation_domain(int cpu, struct cpumask *retmask)
76{
77 cpumask_clear(retmask);
78 cpumask_set_cpu(cpu, retmask);
79}
80
81static int __cpuinit numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip) 75static int __cpuinit numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip)
82{ 76{
83 union numachip_csr_g3_ext_irq_gen int_gen; 77 union numachip_csr_g3_ext_irq_gen int_gen;
@@ -222,7 +216,7 @@ static struct apic apic_numachip __refconst = {
222 .check_apicid_used = NULL, 216 .check_apicid_used = NULL,
223 .check_apicid_present = NULL, 217 .check_apicid_present = NULL,
224 218
225 .vector_allocation_domain = numachip_vector_allocation_domain, 219 .vector_allocation_domain = default_vector_allocation_domain,
226 .init_apic_ldr = flat_init_apic_ldr, 220 .init_apic_ldr = flat_init_apic_ldr,
227 221
228 .ioapic_phys_id_map = NULL, 222 .ioapic_phys_id_map = NULL,
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index 907aa3d112a6..df342fe4d6aa 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -142,12 +142,6 @@ static const struct dmi_system_id bigsmp_dmi_table[] = {
142 { } /* NULL entry stops DMI scanning */ 142 { } /* NULL entry stops DMI scanning */
143}; 143};
144 144
145static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask)
146{
147 cpumask_clear(retmask);
148 cpumask_set_cpu(cpu, retmask);
149}
150
151static int probe_bigsmp(void) 145static int probe_bigsmp(void)
152{ 146{
153 if (def_to_bigsmp) 147 if (def_to_bigsmp)
@@ -176,7 +170,7 @@ static struct apic apic_bigsmp = {
176 .check_apicid_used = bigsmp_check_apicid_used, 170 .check_apicid_used = bigsmp_check_apicid_used,
177 .check_apicid_present = bigsmp_check_apicid_present, 171 .check_apicid_present = bigsmp_check_apicid_present,
178 172
179 .vector_allocation_domain = bigsmp_vector_allocation_domain, 173 .vector_allocation_domain = default_vector_allocation_domain,
180 .init_apic_ldr = bigsmp_init_apic_ldr, 174 .init_apic_ldr = bigsmp_init_apic_ldr,
181 175
182 .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, 176 .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map,
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
index db4ab1be3c79..3c42865757e2 100644
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -394,21 +394,6 @@ static void es7000_enable_apic_mode(void)
394 WARN(1, "Command failed, status = %x\n", mip_status); 394 WARN(1, "Command failed, status = %x\n", mip_status);
395} 395}
396 396
397static void es7000_vector_allocation_domain(int cpu, struct cpumask *retmask)
398{
399 /* Careful. Some cpus do not strictly honor the set of cpus
400 * specified in the interrupt destination when using lowest
401 * priority interrupt delivery mode.
402 *
403 * In particular there was a hyperthreading cpu observed to
404 * deliver interrupts to the wrong hyperthread when only one
405 * hyperthread was specified in the interrupt desitination.
406 */
407 cpumask_clear(retmask);
408 cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
409}
410
411
412static void es7000_wait_for_init_deassert(atomic_t *deassert) 397static void es7000_wait_for_init_deassert(atomic_t *deassert)
413{ 398{
414 while (!atomic_read(deassert)) 399 while (!atomic_read(deassert))
@@ -638,7 +623,7 @@ static struct apic __refdata apic_es7000_cluster = {
638 .check_apicid_used = es7000_check_apicid_used, 623 .check_apicid_used = es7000_check_apicid_used,
639 .check_apicid_present = es7000_check_apicid_present, 624 .check_apicid_present = es7000_check_apicid_present,
640 625
641 .vector_allocation_domain = es7000_vector_allocation_domain, 626 .vector_allocation_domain = flat_vector_allocation_domain,
642 .init_apic_ldr = es7000_init_apic_ldr_cluster, 627 .init_apic_ldr = es7000_init_apic_ldr_cluster,
643 628
644 .ioapic_phys_id_map = es7000_ioapic_phys_id_map, 629 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
@@ -705,7 +690,7 @@ static struct apic __refdata apic_es7000 = {
705 .check_apicid_used = es7000_check_apicid_used, 690 .check_apicid_used = es7000_check_apicid_used,
706 .check_apicid_present = es7000_check_apicid_present, 691 .check_apicid_present = es7000_check_apicid_present,
707 692
708 .vector_allocation_domain = es7000_vector_allocation_domain, 693 .vector_allocation_domain = flat_vector_allocation_domain,
709 .init_apic_ldr = es7000_init_apic_ldr, 694 .init_apic_ldr = es7000_init_apic_ldr,
710 695
711 .ioapic_phys_id_map = es7000_ioapic_phys_id_map, 696 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index f00a68cca37a..eb2d466fd81a 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -441,20 +441,6 @@ static int probe_numaq(void)
441 return found_numaq; 441 return found_numaq;
442} 442}
443 443
444static void numaq_vector_allocation_domain(int cpu, struct cpumask *retmask)
445{
446 /* Careful. Some cpus do not strictly honor the set of cpus
447 * specified in the interrupt destination when using lowest
448 * priority interrupt delivery mode.
449 *
450 * In particular there was a hyperthreading cpu observed to
451 * deliver interrupts to the wrong hyperthread when only one
452 * hyperthread was specified in the interrupt desitination.
453 */
454 cpumask_clear(retmask);
455 cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
456}
457
458static void numaq_setup_portio_remap(void) 444static void numaq_setup_portio_remap(void)
459{ 445{
460 int num_quads = num_online_nodes(); 446 int num_quads = num_online_nodes();
@@ -491,7 +477,7 @@ static struct apic __refdata apic_numaq = {
491 .check_apicid_used = numaq_check_apicid_used, 477 .check_apicid_used = numaq_check_apicid_used,
492 .check_apicid_present = numaq_check_apicid_present, 478 .check_apicid_present = numaq_check_apicid_present,
493 479
494 .vector_allocation_domain = numaq_vector_allocation_domain, 480 .vector_allocation_domain = flat_vector_allocation_domain,
495 .init_apic_ldr = numaq_init_apic_ldr, 481 .init_apic_ldr = numaq_init_apic_ldr,
496 482
497 .ioapic_phys_id_map = numaq_ioapic_phys_id_map, 483 .ioapic_phys_id_map = numaq_ioapic_phys_id_map,
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
index 71b6ac48ab26..2c6f003b2e4b 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -66,21 +66,6 @@ static void setup_apic_flat_routing(void)
66#endif 66#endif
67} 67}
68 68
69static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
70{
71 /*
72 * Careful. Some cpus do not strictly honor the set of cpus
73 * specified in the interrupt destination when using lowest
74 * priority interrupt delivery mode.
75 *
76 * In particular there was a hyperthreading cpu observed to
77 * deliver interrupts to the wrong hyperthread when only one
78 * hyperthread was specified in the interrupt desitination.
79 */
80 cpumask_clear(retmask);
81 cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
82}
83
84/* should be called last. */ 69/* should be called last. */
85static int probe_default(void) 70static int probe_default(void)
86{ 71{
@@ -105,7 +90,7 @@ static struct apic apic_default = {
105 .check_apicid_used = default_check_apicid_used, 90 .check_apicid_used = default_check_apicid_used,
106 .check_apicid_present = default_check_apicid_present, 91 .check_apicid_present = default_check_apicid_present,
107 92
108 .vector_allocation_domain = default_vector_allocation_domain, 93 .vector_allocation_domain = flat_vector_allocation_domain,
109 .init_apic_ldr = default_init_apic_ldr, 94 .init_apic_ldr = default_init_apic_ldr,
110 95
111 .ioapic_phys_id_map = default_ioapic_phys_id_map, 96 .ioapic_phys_id_map = default_ioapic_phys_id_map,
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c
index 659897c00755..35d254c1fec2 100644
--- a/arch/x86/kernel/apic/summit_32.c
+++ b/arch/x86/kernel/apic/summit_32.c
@@ -320,20 +320,6 @@ static int probe_summit(void)
320 return 0; 320 return 0;
321} 321}
322 322
323static void summit_vector_allocation_domain(int cpu, struct cpumask *retmask)
324{
325 /* Careful. Some cpus do not strictly honor the set of cpus
326 * specified in the interrupt destination when using lowest
327 * priority interrupt delivery mode.
328 *
329 * In particular there was a hyperthreading cpu observed to
330 * deliver interrupts to the wrong hyperthread when only one
331 * hyperthread was specified in the interrupt desitination.
332 */
333 cpumask_clear(retmask);
334 cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
335}
336
337#ifdef CONFIG_X86_SUMMIT_NUMA 323#ifdef CONFIG_X86_SUMMIT_NUMA
338static struct rio_table_hdr *rio_table_hdr; 324static struct rio_table_hdr *rio_table_hdr;
339static struct scal_detail *scal_devs[MAX_NUMNODES]; 325static struct scal_detail *scal_devs[MAX_NUMNODES];
@@ -509,7 +495,7 @@ static struct apic apic_summit = {
509 .check_apicid_used = summit_check_apicid_used, 495 .check_apicid_used = summit_check_apicid_used,
510 .check_apicid_present = summit_check_apicid_present, 496 .check_apicid_present = summit_check_apicid_present,
511 497
512 .vector_allocation_domain = summit_vector_allocation_domain, 498 .vector_allocation_domain = flat_vector_allocation_domain,
513 .init_apic_ldr = summit_init_apic_ldr, 499 .init_apic_ldr = summit_init_apic_ldr,
514 500
515 .ioapic_phys_id_map = summit_ioapic_phys_id_map, 501 .ioapic_phys_id_map = summit_ioapic_phys_id_map,
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index f730269edef2..f109388a0e80 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -88,15 +88,6 @@ static int x2apic_phys_probe(void)
88 return apic == &apic_x2apic_phys; 88 return apic == &apic_x2apic_phys;
89} 89}
90 90
91/*
92 * Each logical cpu is in its own vector allocation domain.
93 */
94static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
95{
96 cpumask_clear(retmask);
97 cpumask_set_cpu(cpu, retmask);
98}
99
100static struct apic apic_x2apic_phys = { 91static struct apic apic_x2apic_phys = {
101 92
102 .name = "physical x2apic", 93 .name = "physical x2apic",
@@ -114,7 +105,7 @@ static struct apic apic_x2apic_phys = {
114 .check_apicid_used = NULL, 105 .check_apicid_used = NULL,
115 .check_apicid_present = NULL, 106 .check_apicid_present = NULL,
116 107
117 .vector_allocation_domain = x2apic_vector_allocation_domain, 108 .vector_allocation_domain = default_vector_allocation_domain,
118 .init_apic_ldr = init_x2apic_ldr, 109 .init_apic_ldr = init_x2apic_ldr,
119 110
120 .ioapic_phys_id_map = NULL, 111 .ioapic_phys_id_map = NULL,
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 16efb92bfea5..df89a7d78748 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -185,12 +185,6 @@ EXPORT_SYMBOL_GPL(uv_possible_blades);
185unsigned long sn_rtc_cycles_per_second; 185unsigned long sn_rtc_cycles_per_second;
186EXPORT_SYMBOL(sn_rtc_cycles_per_second); 186EXPORT_SYMBOL(sn_rtc_cycles_per_second);
187 187
188static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask)
189{
190 cpumask_clear(retmask);
191 cpumask_set_cpu(cpu, retmask);
192}
193
194static int __cpuinit uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) 188static int __cpuinit uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
195{ 189{
196#ifdef CONFIG_SMP 190#ifdef CONFIG_SMP
@@ -363,7 +357,7 @@ static struct apic __refdata apic_x2apic_uv_x = {
363 .check_apicid_used = NULL, 357 .check_apicid_used = NULL,
364 .check_apicid_present = NULL, 358 .check_apicid_present = NULL,
365 359
366 .vector_allocation_domain = uv_vector_allocation_domain, 360 .vector_allocation_domain = default_vector_allocation_domain,
367 .init_apic_ldr = uv_init_apic_ldr, 361 .init_apic_ldr = uv_init_apic_ldr,
368 362
369 .ioapic_phys_id_map = NULL, 363 .ioapic_phys_id_map = NULL,