diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2012-06-05 07:23:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-06-06 04:22:17 -0400 |
commit | bf721d3a3bc7a731add45c8078b142b494ab413e (patch) | |
tree | 7c0671a46ae23c5c6389ae910f7e9aa5ebaf99fb /arch | |
parent | 49d0c7a0a425a89190b7c3b1445faba9eb227bec (diff) |
x86/apic: Factor out default target_cpus() operation
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20120605112324.GA11449@dhcp-26-207.brq.redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/apic.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/x2apic.h | 9 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 14 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_numachip.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/apic/bigsmp_32.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_cluster.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_phys.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 7 |
8 files changed, 12 insertions, 45 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index eaff4790ed96..fc38195d6405 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -537,6 +537,11 @@ static inline const struct cpumask *default_target_cpus(void) | |||
537 | #endif | 537 | #endif |
538 | } | 538 | } |
539 | 539 | ||
540 | static inline const struct cpumask *online_target_cpus(void) | ||
541 | { | ||
542 | return cpu_online_mask; | ||
543 | } | ||
544 | |||
540 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); | 545 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); |
541 | 546 | ||
542 | 547 | ||
diff --git a/arch/x86/include/asm/x2apic.h b/arch/x86/include/asm/x2apic.h index 7a5a832a99b6..f90f0a587c66 100644 --- a/arch/x86/include/asm/x2apic.h +++ b/arch/x86/include/asm/x2apic.h | |||
@@ -9,15 +9,6 @@ | |||
9 | #include <asm/ipi.h> | 9 | #include <asm/ipi.h> |
10 | #include <linux/cpumask.h> | 10 | #include <linux/cpumask.h> |
11 | 11 | ||
12 | /* | ||
13 | * Need to use more than cpu 0, because we need more vectors | ||
14 | * when MSI-X are used. | ||
15 | */ | ||
16 | static const struct cpumask *x2apic_target_cpus(void) | ||
17 | { | ||
18 | return cpu_online_mask; | ||
19 | } | ||
20 | |||
21 | static int x2apic_apic_id_valid(int apicid) | 12 | static int x2apic_apic_id_valid(int apicid) |
22 | { | 13 | { |
23 | return 1; | 14 | return 1; |
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index de279b32ceb1..61ac1afeff07 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -36,11 +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 | ||
39 | static const struct cpumask *flat_target_cpus(void) | ||
40 | { | ||
41 | return cpu_online_mask; | ||
42 | } | ||
43 | |||
44 | static void flat_vector_allocation_domain(int cpu, struct cpumask *retmask) | 39 | static void flat_vector_allocation_domain(int cpu, struct cpumask *retmask) |
45 | { | 40 | { |
46 | /* Careful. Some cpus do not strictly honor the set of cpus | 41 | /* Careful. Some cpus do not strictly honor the set of cpus |
@@ -186,7 +181,7 @@ static struct apic apic_flat = { | |||
186 | .irq_delivery_mode = dest_LowestPrio, | 181 | .irq_delivery_mode = dest_LowestPrio, |
187 | .irq_dest_mode = 1, /* logical */ | 182 | .irq_dest_mode = 1, /* logical */ |
188 | 183 | ||
189 | .target_cpus = flat_target_cpus, | 184 | .target_cpus = online_target_cpus, |
190 | .disable_esr = 0, | 185 | .disable_esr = 0, |
191 | .dest_logical = APIC_DEST_LOGICAL, | 186 | .dest_logical = APIC_DEST_LOGICAL, |
192 | .check_apicid_used = NULL, | 187 | .check_apicid_used = NULL, |
@@ -262,11 +257,6 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
262 | return 0; | 257 | return 0; |
263 | } | 258 | } |
264 | 259 | ||
265 | static const struct cpumask *physflat_target_cpus(void) | ||
266 | { | ||
267 | return cpu_online_mask; | ||
268 | } | ||
269 | |||
270 | static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask) | 260 | static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask) |
271 | { | 261 | { |
272 | cpumask_clear(retmask); | 262 | cpumask_clear(retmask); |
@@ -345,7 +335,7 @@ static struct apic apic_physflat = { | |||
345 | .irq_delivery_mode = dest_Fixed, | 335 | .irq_delivery_mode = dest_Fixed, |
346 | .irq_dest_mode = 0, /* physical */ | 336 | .irq_dest_mode = 0, /* physical */ |
347 | 337 | ||
348 | .target_cpus = physflat_target_cpus, | 338 | .target_cpus = online_target_cpus, |
349 | .disable_esr = 0, | 339 | .disable_esr = 0, |
350 | .dest_logical = 0, | 340 | .dest_logical = 0, |
351 | .check_apicid_used = NULL, | 341 | .check_apicid_used = NULL, |
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c index 6ec6d5d297c3..3255a60fcc95 100644 --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c | |||
@@ -72,11 +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 | ||
75 | static const struct cpumask *numachip_target_cpus(void) | ||
76 | { | ||
77 | return cpu_online_mask; | ||
78 | } | ||
79 | |||
80 | static void numachip_vector_allocation_domain(int cpu, struct cpumask *retmask) | 75 | static void numachip_vector_allocation_domain(int cpu, struct cpumask *retmask) |
81 | { | 76 | { |
82 | cpumask_clear(retmask); | 77 | cpumask_clear(retmask); |
@@ -253,7 +248,7 @@ static struct apic apic_numachip __refconst = { | |||
253 | .irq_delivery_mode = dest_Fixed, | 248 | .irq_delivery_mode = dest_Fixed, |
254 | .irq_dest_mode = 0, /* physical */ | 249 | .irq_dest_mode = 0, /* physical */ |
255 | 250 | ||
256 | .target_cpus = numachip_target_cpus, | 251 | .target_cpus = online_target_cpus, |
257 | .disable_esr = 0, | 252 | .disable_esr = 0, |
258 | .dest_logical = 0, | 253 | .dest_logical = 0, |
259 | .check_apicid_used = NULL, | 254 | .check_apicid_used = NULL, |
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index 31fbdbfbf960..c288e81e00ff 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
@@ -26,15 +26,6 @@ static int bigsmp_apic_id_registered(void) | |||
26 | return 1; | 26 | return 1; |
27 | } | 27 | } |
28 | 28 | ||
29 | static const struct cpumask *bigsmp_target_cpus(void) | ||
30 | { | ||
31 | #ifdef CONFIG_SMP | ||
32 | return cpu_online_mask; | ||
33 | #else | ||
34 | return cpumask_of(0); | ||
35 | #endif | ||
36 | } | ||
37 | |||
38 | static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid) | 29 | static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid) |
39 | { | 30 | { |
40 | return 0; | 31 | return 0; |
@@ -205,7 +196,7 @@ static struct apic apic_bigsmp = { | |||
205 | /* phys delivery to target CPU: */ | 196 | /* phys delivery to target CPU: */ |
206 | .irq_dest_mode = 0, | 197 | .irq_dest_mode = 0, |
207 | 198 | ||
208 | .target_cpus = bigsmp_target_cpus, | 199 | .target_cpus = default_target_cpus, |
209 | .disable_esr = 1, | 200 | .disable_esr = 1, |
210 | .dest_logical = 0, | 201 | .dest_logical = 0, |
211 | .check_apicid_used = bigsmp_check_apicid_used, | 202 | .check_apicid_used = bigsmp_check_apicid_used, |
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 2919e45d30c3..612622c47dfb 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
@@ -241,7 +241,7 @@ static struct apic apic_x2apic_cluster = { | |||
241 | .irq_delivery_mode = dest_LowestPrio, | 241 | .irq_delivery_mode = dest_LowestPrio, |
242 | .irq_dest_mode = 1, /* logical */ | 242 | .irq_dest_mode = 1, /* logical */ |
243 | 243 | ||
244 | .target_cpus = x2apic_target_cpus, | 244 | .target_cpus = online_target_cpus, |
245 | .disable_esr = 0, | 245 | .disable_esr = 0, |
246 | .dest_logical = APIC_DEST_LOGICAL, | 246 | .dest_logical = APIC_DEST_LOGICAL, |
247 | .check_apicid_used = NULL, | 247 | .check_apicid_used = NULL, |
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index 93b25706f177..b1a8b39e3c3f 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
@@ -140,7 +140,7 @@ static struct apic apic_x2apic_phys = { | |||
140 | .irq_delivery_mode = dest_Fixed, | 140 | .irq_delivery_mode = dest_Fixed, |
141 | .irq_dest_mode = 0, /* physical */ | 141 | .irq_dest_mode = 0, /* physical */ |
142 | 142 | ||
143 | .target_cpus = x2apic_target_cpus, | 143 | .target_cpus = online_target_cpus, |
144 | .disable_esr = 0, | 144 | .disable_esr = 0, |
145 | .dest_logical = 0, | 145 | .dest_logical = 0, |
146 | .check_apicid_used = NULL, | 146 | .check_apicid_used = NULL, |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index c6d03f7a4401..16efb92bfea5 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -185,11 +185,6 @@ EXPORT_SYMBOL_GPL(uv_possible_blades); | |||
185 | unsigned long sn_rtc_cycles_per_second; | 185 | unsigned long sn_rtc_cycles_per_second; |
186 | EXPORT_SYMBOL(sn_rtc_cycles_per_second); | 186 | EXPORT_SYMBOL(sn_rtc_cycles_per_second); |
187 | 187 | ||
188 | static const struct cpumask *uv_target_cpus(void) | ||
189 | { | ||
190 | return cpu_online_mask; | ||
191 | } | ||
192 | |||
193 | static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask) | 188 | static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask) |
194 | { | 189 | { |
195 | cpumask_clear(retmask); | 190 | cpumask_clear(retmask); |
@@ -362,7 +357,7 @@ static struct apic __refdata apic_x2apic_uv_x = { | |||
362 | .irq_delivery_mode = dest_Fixed, | 357 | .irq_delivery_mode = dest_Fixed, |
363 | .irq_dest_mode = 0, /* physical */ | 358 | .irq_dest_mode = 0, /* physical */ |
364 | 359 | ||
365 | .target_cpus = uv_target_cpus, | 360 | .target_cpus = online_target_cpus, |
366 | .disable_esr = 0, | 361 | .disable_esr = 0, |
367 | .dest_logical = APIC_DEST_LOGICAL, | 362 | .dest_logical = APIC_DEST_LOGICAL, |
368 | .check_apicid_used = NULL, | 363 | .check_apicid_used = NULL, |