Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexander Gordeev and committed by
Ingo Molnar
bf721d3a 49d0c7a0

+12 -45
+5
arch/x86/include/asm/apic.h
··· 537 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 545 DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); 541 546 542 547
-9
arch/x86/include/asm/x2apic.h
··· 9 9 #include <asm/ipi.h> 10 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 12 static int x2apic_apic_id_valid(int apicid) 22 13 { 23 14 return 1;
+2 -12
arch/x86/kernel/apic/apic_flat_64.c
··· 36 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 39 static void flat_vector_allocation_domain(int cpu, struct cpumask *retmask) 45 40 { 46 41 /* Careful. Some cpus do not strictly honor the set of cpus ··· 181 186 .irq_delivery_mode = dest_LowestPrio, 182 187 .irq_dest_mode = 1, /* logical */ 183 188 184 - .target_cpus = flat_target_cpus, 189 + .target_cpus = online_target_cpus, 185 190 .disable_esr = 0, 186 191 .dest_logical = APIC_DEST_LOGICAL, 187 192 .check_apicid_used = NULL, ··· 255 260 #endif 256 261 257 262 return 0; 258 - } 259 - 260 - static const struct cpumask *physflat_target_cpus(void) 261 - { 262 - return cpu_online_mask; 263 263 } 264 264 265 265 static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask) ··· 335 345 .irq_delivery_mode = dest_Fixed, 336 346 .irq_dest_mode = 0, /* physical */ 337 347 338 - .target_cpus = physflat_target_cpus, 348 + .target_cpus = online_target_cpus, 339 349 .disable_esr = 0, 340 350 .dest_logical = 0, 341 351 .check_apicid_used = NULL,
+1 -6
arch/x86/kernel/apic/apic_numachip.c
··· 72 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 75 static void numachip_vector_allocation_domain(int cpu, struct cpumask *retmask) 81 76 { 82 77 cpumask_clear(retmask); ··· 248 253 .irq_delivery_mode = dest_Fixed, 249 254 .irq_dest_mode = 0, /* physical */ 250 255 251 - .target_cpus = numachip_target_cpus, 256 + .target_cpus = online_target_cpus, 252 257 .disable_esr = 0, 253 258 .dest_logical = 0, 254 259 .check_apicid_used = NULL,
+1 -10
arch/x86/kernel/apic/bigsmp_32.c
··· 26 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 29 static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid) 39 30 { 40 31 return 0; ··· 196 205 /* phys delivery to target CPU: */ 197 206 .irq_dest_mode = 0, 198 207 199 - .target_cpus = bigsmp_target_cpus, 208 + .target_cpus = default_target_cpus, 200 209 .disable_esr = 1, 201 210 .dest_logical = 0, 202 211 .check_apicid_used = bigsmp_check_apicid_used,
+1 -1
arch/x86/kernel/apic/x2apic_cluster.c
··· 241 241 .irq_delivery_mode = dest_LowestPrio, 242 242 .irq_dest_mode = 1, /* logical */ 243 243 244 - .target_cpus = x2apic_target_cpus, 244 + .target_cpus = online_target_cpus, 245 245 .disable_esr = 0, 246 246 .dest_logical = APIC_DEST_LOGICAL, 247 247 .check_apicid_used = NULL,
+1 -1
arch/x86/kernel/apic/x2apic_phys.c
··· 140 140 .irq_delivery_mode = dest_Fixed, 141 141 .irq_dest_mode = 0, /* physical */ 142 142 143 - .target_cpus = x2apic_target_cpus, 143 + .target_cpus = online_target_cpus, 144 144 .disable_esr = 0, 145 145 .dest_logical = 0, 146 146 .check_apicid_used = NULL,
+1 -6
arch/x86/kernel/apic/x2apic_uv_x.c
··· 185 185 unsigned long sn_rtc_cycles_per_second; 186 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 188 static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask) 194 189 { 195 190 cpumask_clear(retmask); ··· 357 362 .irq_delivery_mode = dest_Fixed, 358 363 .irq_dest_mode = 0, /* physical */ 359 364 360 - .target_cpus = uv_target_cpus, 365 + .target_cpus = online_target_cpus, 361 366 .disable_esr = 0, 362 367 .dest_logical = APIC_DEST_LOGICAL, 363 368 .check_apicid_used = NULL,