diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-11-09 17:06:59 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-09 23:52:07 -0500 |
commit | 7abc07531383ac7f727cc9d44e1360a829f2082e (patch) | |
tree | f93b92f86c527cf5d0e12a3b64a7dbcd368fbd95 | |
parent | f4a70c55376683213229af7266dc57ad81aee354 (diff) |
x86: apic: Do not use stacked physid_mask_t
We should not use physid_mask_t as a stack based
variable in apic code. This type depends on MAX_APICS
parameter which may be huge enough.
Especially it became a problem with apic NOOP driver which
is portable between 32 bit and 64 bit environment
(where we have really huge MAX_APICS).
So apic driver should operate with pointers and a caller
in turn should aware of allocation physid_mask_t variable.
As a side (but positive) effect -- we may use already
implemented physid_set_mask_of_physid function eliminating
default_apicid_to_cpu_present completely.
Note that physids_coerce and physids_promote turned into static
inline from macro (since macro hides the fact that parameter is
being interpreted as unsigned long, make it explicit).
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
LKML-Reference: <20091109220659.GA5568@lenovo>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/include/asm/apic.h | 19 | ||||
-rw-r--r-- | arch/x86/include/asm/mpspec.h | 16 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_noop.c | 18 | ||||
-rw-r--r-- | arch/x86/kernel/apic/bigsmp_32.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/apic/es7000_32.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 14 | ||||
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/apic/probe_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/summit_32.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/visws_quirks.c | 2 |
10 files changed, 50 insertions, 73 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 08a5f420e07b..b4ac2cdcb64f 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -297,20 +297,20 @@ struct apic { | |||
297 | int disable_esr; | 297 | int disable_esr; |
298 | 298 | ||
299 | int dest_logical; | 299 | int dest_logical; |
300 | unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid); | 300 | unsigned long (*check_apicid_used)(physid_mask_t *map, int apicid); |
301 | unsigned long (*check_apicid_present)(int apicid); | 301 | unsigned long (*check_apicid_present)(int apicid); |
302 | 302 | ||
303 | void (*vector_allocation_domain)(int cpu, struct cpumask *retmask); | 303 | void (*vector_allocation_domain)(int cpu, struct cpumask *retmask); |
304 | void (*init_apic_ldr)(void); | 304 | void (*init_apic_ldr)(void); |
305 | 305 | ||
306 | physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map); | 306 | void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap); |
307 | 307 | ||
308 | void (*setup_apic_routing)(void); | 308 | void (*setup_apic_routing)(void); |
309 | int (*multi_timer_check)(int apic, int irq); | 309 | int (*multi_timer_check)(int apic, int irq); |
310 | int (*apicid_to_node)(int logical_apicid); | 310 | int (*apicid_to_node)(int logical_apicid); |
311 | int (*cpu_to_logical_apicid)(int cpu); | 311 | int (*cpu_to_logical_apicid)(int cpu); |
312 | int (*cpu_present_to_apicid)(int mps_cpu); | 312 | int (*cpu_present_to_apicid)(int mps_cpu); |
313 | physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); | 313 | void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap); |
314 | void (*setup_portio_remap)(void); | 314 | void (*setup_portio_remap)(void); |
315 | int (*check_phys_apicid_present)(int phys_apicid); | 315 | int (*check_phys_apicid_present)(int phys_apicid); |
316 | void (*enable_apic_mode)(void); | 316 | void (*enable_apic_mode)(void); |
@@ -534,9 +534,9 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
534 | return (unsigned int)(mask1 & mask2 & mask3); | 534 | return (unsigned int)(mask1 & mask2 & mask3); |
535 | } | 535 | } |
536 | 536 | ||
537 | static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) | 537 | static inline unsigned long default_check_apicid_used(physid_mask_t *map, int apicid) |
538 | { | 538 | { |
539 | return physid_isset(apicid, bitmap); | 539 | return physid_isset(apicid, *map); |
540 | } | 540 | } |
541 | 541 | ||
542 | static inline unsigned long default_check_apicid_present(int bit) | 542 | static inline unsigned long default_check_apicid_present(int bit) |
@@ -544,9 +544,9 @@ static inline unsigned long default_check_apicid_present(int bit) | |||
544 | return physid_isset(bit, phys_cpu_present_map); | 544 | return physid_isset(bit, phys_cpu_present_map); |
545 | } | 545 | } |
546 | 546 | ||
547 | static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map) | 547 | static inline void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) |
548 | { | 548 | { |
549 | return phys_map; | 549 | *retmap = *phys_map; |
550 | } | 550 | } |
551 | 551 | ||
552 | /* Mapping from cpu number to logical apicid */ | 552 | /* Mapping from cpu number to logical apicid */ |
@@ -585,11 +585,6 @@ extern int default_cpu_present_to_apicid(int mps_cpu); | |||
585 | extern int default_check_phys_apicid_present(int phys_apicid); | 585 | extern int default_check_phys_apicid_present(int phys_apicid); |
586 | #endif | 586 | #endif |
587 | 587 | ||
588 | static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) | ||
589 | { | ||
590 | return physid_mask_of_physid(phys_apicid); | ||
591 | } | ||
592 | |||
593 | #endif /* CONFIG_X86_LOCAL_APIC */ | 588 | #endif /* CONFIG_X86_LOCAL_APIC */ |
594 | 589 | ||
595 | #ifdef CONFIG_X86_32 | 590 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 79c94500c0bb..61d90b1331c3 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -163,14 +163,16 @@ typedef struct physid_mask physid_mask_t; | |||
163 | #define physids_shift_left(d, s, n) \ | 163 | #define physids_shift_left(d, s, n) \ |
164 | bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS) | 164 | bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS) |
165 | 165 | ||
166 | #define physids_coerce(map) ((map).mask[0]) | 166 | static inline unsigned long physids_coerce(physid_mask_t *map) |
167 | { | ||
168 | return map->mask[0]; | ||
169 | } | ||
167 | 170 | ||
168 | #define physids_promote(physids) \ | 171 | static inline void physids_promote(unsigned long physids, physid_mask_t *map) |
169 | ({ \ | 172 | { |
170 | physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ | 173 | physids_clear(*map); |
171 | __physid_mask.mask[0] = physids; \ | 174 | map->mask[0] = physids; |
172 | __physid_mask; \ | 175 | } |
173 | }) | ||
174 | 176 | ||
175 | /* Note: will create very large stack frames if physid_mask_t is big */ | 177 | /* Note: will create very large stack frames if physid_mask_t is big */ |
176 | #define physid_mask_of_physid(physid) \ | 178 | #define physid_mask_of_physid(physid) \ |
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c index 89629f622b60..d9acc3bee0f4 100644 --- a/arch/x86/kernel/apic/apic_noop.c +++ b/arch/x86/kernel/apic/apic_noop.c | |||
@@ -54,11 +54,6 @@ static u64 noop_apic_icr_read(void) | |||
54 | return 0; | 54 | return 0; |
55 | } | 55 | } |
56 | 56 | ||
57 | static physid_mask_t noop_ioapic_phys_id_map(physid_mask_t phys_map) | ||
58 | { | ||
59 | return phys_map; | ||
60 | } | ||
61 | |||
62 | static int noop_cpu_to_logical_apicid(int cpu) | 57 | static int noop_cpu_to_logical_apicid(int cpu) |
63 | { | 58 | { |
64 | return 0; | 59 | return 0; |
@@ -100,9 +95,9 @@ static const struct cpumask *noop_target_cpus(void) | |||
100 | return cpumask_of(0); | 95 | return cpumask_of(0); |
101 | } | 96 | } |
102 | 97 | ||
103 | static unsigned long noop_check_apicid_used(physid_mask_t bitmap, int apicid) | 98 | static unsigned long noop_check_apicid_used(physid_mask_t *map, int apicid) |
104 | { | 99 | { |
105 | return physid_isset(apicid, bitmap); | 100 | return physid_isset(apicid, *map); |
106 | } | 101 | } |
107 | 102 | ||
108 | static unsigned long noop_check_apicid_present(int bit) | 103 | static unsigned long noop_check_apicid_present(int bit) |
@@ -155,19 +150,14 @@ struct apic apic_noop = { | |||
155 | .vector_allocation_domain = noop_vector_allocation_domain, | 150 | .vector_allocation_domain = noop_vector_allocation_domain, |
156 | .init_apic_ldr = noop_init_apic_ldr, | 151 | .init_apic_ldr = noop_init_apic_ldr, |
157 | 152 | ||
158 | .ioapic_phys_id_map = noop_ioapic_phys_id_map, | 153 | .ioapic_phys_id_map = default_ioapic_phys_id_map, |
159 | .setup_apic_routing = NULL, | 154 | .setup_apic_routing = NULL, |
160 | .multi_timer_check = NULL, | 155 | .multi_timer_check = NULL, |
161 | .apicid_to_node = noop_apicid_to_node, | 156 | .apicid_to_node = noop_apicid_to_node, |
162 | 157 | ||
163 | .cpu_to_logical_apicid = noop_cpu_to_logical_apicid, | 158 | .cpu_to_logical_apicid = noop_cpu_to_logical_apicid, |
164 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 159 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
165 | 160 | .apicid_to_cpu_present = physid_set_mask_of_physid, | |
166 | #ifdef CONFIG_X86_32 | ||
167 | .apicid_to_cpu_present = default_apicid_to_cpu_present, | ||
168 | #else | ||
169 | .apicid_to_cpu_present = NULL, | ||
170 | #endif | ||
171 | 161 | ||
172 | .setup_portio_remap = NULL, | 162 | .setup_portio_remap = NULL, |
173 | .check_phys_apicid_present = default_check_phys_apicid_present, | 163 | .check_phys_apicid_present = default_check_phys_apicid_present, |
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index 77a06413b6b2..38dcecfa5818 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
@@ -35,7 +35,7 @@ static const struct cpumask *bigsmp_target_cpus(void) | |||
35 | #endif | 35 | #endif |
36 | } | 36 | } |
37 | 37 | ||
38 | static unsigned long bigsmp_check_apicid_used(physid_mask_t bitmap, int apicid) | 38 | static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid) |
39 | { | 39 | { |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
@@ -93,11 +93,6 @@ static int bigsmp_cpu_present_to_apicid(int mps_cpu) | |||
93 | return BAD_APICID; | 93 | return BAD_APICID; |
94 | } | 94 | } |
95 | 95 | ||
96 | static physid_mask_t bigsmp_apicid_to_cpu_present(int phys_apicid) | ||
97 | { | ||
98 | return physid_mask_of_physid(phys_apicid); | ||
99 | } | ||
100 | |||
101 | /* Mapping from cpu number to logical apicid */ | 96 | /* Mapping from cpu number to logical apicid */ |
102 | static inline int bigsmp_cpu_to_logical_apicid(int cpu) | 97 | static inline int bigsmp_cpu_to_logical_apicid(int cpu) |
103 | { | 98 | { |
@@ -106,10 +101,10 @@ static inline int bigsmp_cpu_to_logical_apicid(int cpu) | |||
106 | return cpu_physical_id(cpu); | 101 | return cpu_physical_id(cpu); |
107 | } | 102 | } |
108 | 103 | ||
109 | static physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map) | 104 | static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) |
110 | { | 105 | { |
111 | /* For clustered we don't have a good way to do this yet - hack */ | 106 | /* For clustered we don't have a good way to do this yet - hack */ |
112 | return physids_promote(0xFFL); | 107 | physids_promote(0xFFL, retmap); |
113 | } | 108 | } |
114 | 109 | ||
115 | static int bigsmp_check_phys_apicid_present(int phys_apicid) | 110 | static int bigsmp_check_phys_apicid_present(int phys_apicid) |
@@ -230,7 +225,7 @@ struct apic apic_bigsmp = { | |||
230 | .apicid_to_node = bigsmp_apicid_to_node, | 225 | .apicid_to_node = bigsmp_apicid_to_node, |
231 | .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, | 226 | .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, |
232 | .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, | 227 | .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, |
233 | .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, | 228 | .apicid_to_cpu_present = physid_set_mask_of_physid, |
234 | .setup_portio_remap = NULL, | 229 | .setup_portio_remap = NULL, |
235 | .check_phys_apicid_present = bigsmp_check_phys_apicid_present, | 230 | .check_phys_apicid_present = bigsmp_check_phys_apicid_present, |
236 | .enable_apic_mode = NULL, | 231 | .enable_apic_mode = NULL, |
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 89174f847b49..e85f8fb7f8e7 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
@@ -466,11 +466,11 @@ static const struct cpumask *es7000_target_cpus(void) | |||
466 | return cpumask_of(smp_processor_id()); | 466 | return cpumask_of(smp_processor_id()); |
467 | } | 467 | } |
468 | 468 | ||
469 | static unsigned long | 469 | static unsigned long es7000_check_apicid_used(physid_mask_t *map, int apicid) |
470 | es7000_check_apicid_used(physid_mask_t bitmap, int apicid) | ||
471 | { | 470 | { |
472 | return 0; | 471 | return 0; |
473 | } | 472 | } |
473 | |||
474 | static unsigned long es7000_check_apicid_present(int bit) | 474 | static unsigned long es7000_check_apicid_present(int bit) |
475 | { | 475 | { |
476 | return physid_isset(bit, phys_cpu_present_map); | 476 | return physid_isset(bit, phys_cpu_present_map); |
@@ -539,14 +539,10 @@ static int es7000_cpu_present_to_apicid(int mps_cpu) | |||
539 | 539 | ||
540 | static int cpu_id; | 540 | static int cpu_id; |
541 | 541 | ||
542 | static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid) | 542 | static void es7000_apicid_to_cpu_present(int phys_apicid, physid_mask_t *retmap) |
543 | { | 543 | { |
544 | physid_mask_t mask; | 544 | physid_set_mask_of_physid(cpu_id, retmap); |
545 | |||
546 | mask = physid_mask_of_physid(cpu_id); | ||
547 | ++cpu_id; | 545 | ++cpu_id; |
548 | |||
549 | return mask; | ||
550 | } | 546 | } |
551 | 547 | ||
552 | /* Mapping from cpu number to logical apicid */ | 548 | /* Mapping from cpu number to logical apicid */ |
@@ -561,10 +557,10 @@ static int es7000_cpu_to_logical_apicid(int cpu) | |||
561 | #endif | 557 | #endif |
562 | } | 558 | } |
563 | 559 | ||
564 | static physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map) | 560 | static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) |
565 | { | 561 | { |
566 | /* For clustered we don't have a good way to do this yet - hack */ | 562 | /* For clustered we don't have a good way to do this yet - hack */ |
567 | return physids_promote(0xff); | 563 | physids_promote(0xFFL, retmap); |
568 | } | 564 | } |
569 | 565 | ||
570 | static int es7000_check_phys_apicid_present(int cpu_physical_apicid) | 566 | static int es7000_check_phys_apicid_present(int cpu_physical_apicid) |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 24d1458a1822..20ea8392bc57 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2031,7 +2031,7 @@ void __init setup_ioapic_ids_from_mpc(void) | |||
2031 | * This is broken; anything with a real cpu count has to | 2031 | * This is broken; anything with a real cpu count has to |
2032 | * circumvent this idiocy regardless. | 2032 | * circumvent this idiocy regardless. |
2033 | */ | 2033 | */ |
2034 | phys_id_present_map = apic->ioapic_phys_id_map(phys_cpu_present_map); | 2034 | apic->ioapic_phys_id_map(&phys_cpu_present_map, &phys_id_present_map); |
2035 | 2035 | ||
2036 | /* | 2036 | /* |
2037 | * Set the IOAPIC ID to the value stored in the MPC table. | 2037 | * Set the IOAPIC ID to the value stored in the MPC table. |
@@ -2058,7 +2058,7 @@ void __init setup_ioapic_ids_from_mpc(void) | |||
2058 | * system must have a unique ID or we get lots of nice | 2058 | * system must have a unique ID or we get lots of nice |
2059 | * 'stuck on smp_invalidate_needed IPI wait' messages. | 2059 | * 'stuck on smp_invalidate_needed IPI wait' messages. |
2060 | */ | 2060 | */ |
2061 | if (apic->check_apicid_used(phys_id_present_map, | 2061 | if (apic->check_apicid_used(&phys_id_present_map, |
2062 | mp_ioapics[apic_id].apicid)) { | 2062 | mp_ioapics[apic_id].apicid)) { |
2063 | printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", | 2063 | printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", |
2064 | apic_id, mp_ioapics[apic_id].apicid); | 2064 | apic_id, mp_ioapics[apic_id].apicid); |
@@ -2073,7 +2073,7 @@ void __init setup_ioapic_ids_from_mpc(void) | |||
2073 | mp_ioapics[apic_id].apicid = i; | 2073 | mp_ioapics[apic_id].apicid = i; |
2074 | } else { | 2074 | } else { |
2075 | physid_mask_t tmp; | 2075 | physid_mask_t tmp; |
2076 | tmp = apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid); | 2076 | apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid, &tmp); |
2077 | apic_printk(APIC_VERBOSE, "Setting %d in the " | 2077 | apic_printk(APIC_VERBOSE, "Setting %d in the " |
2078 | "phys_id_present_map\n", | 2078 | "phys_id_present_map\n", |
2079 | mp_ioapics[apic_id].apicid); | 2079 | mp_ioapics[apic_id].apicid); |
@@ -3904,7 +3904,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id) | |||
3904 | */ | 3904 | */ |
3905 | 3905 | ||
3906 | if (physids_empty(apic_id_map)) | 3906 | if (physids_empty(apic_id_map)) |
3907 | apic_id_map = apic->ioapic_phys_id_map(phys_cpu_present_map); | 3907 | apic->ioapic_phys_id_map(&phys_cpu_present_map, &apic_id_map); |
3908 | 3908 | ||
3909 | spin_lock_irqsave(&ioapic_lock, flags); | 3909 | spin_lock_irqsave(&ioapic_lock, flags); |
3910 | reg_00.raw = io_apic_read(ioapic, 0); | 3910 | reg_00.raw = io_apic_read(ioapic, 0); |
@@ -3920,10 +3920,10 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id) | |||
3920 | * Every APIC in a system must have a unique ID or we get lots of nice | 3920 | * Every APIC in a system must have a unique ID or we get lots of nice |
3921 | * 'stuck on smp_invalidate_needed IPI wait' messages. | 3921 | * 'stuck on smp_invalidate_needed IPI wait' messages. |
3922 | */ | 3922 | */ |
3923 | if (apic->check_apicid_used(apic_id_map, apic_id)) { | 3923 | if (apic->check_apicid_used(&apic_id_map, apic_id)) { |
3924 | 3924 | ||
3925 | for (i = 0; i < get_physical_broadcast(); i++) { | 3925 | for (i = 0; i < get_physical_broadcast(); i++) { |
3926 | if (!apic->check_apicid_used(apic_id_map, i)) | 3926 | if (!apic->check_apicid_used(&apic_id_map, i)) |
3927 | break; | 3927 | break; |
3928 | } | 3928 | } |
3929 | 3929 | ||
@@ -3936,7 +3936,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id) | |||
3936 | apic_id = i; | 3936 | apic_id = i; |
3937 | } | 3937 | } |
3938 | 3938 | ||
3939 | tmp = apic->apicid_to_cpu_present(apic_id); | 3939 | apic->apicid_to_cpu_present(apic_id, &tmp); |
3940 | physids_or(apic_id_map, apic_id_map, tmp); | 3940 | physids_or(apic_id_map, apic_id_map, tmp); |
3941 | 3941 | ||
3942 | if (reg_00.bits.ID != apic_id) { | 3942 | if (reg_00.bits.ID != apic_id) { |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index efa00e2b8505..07cdbdcd7a92 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -334,10 +334,9 @@ static inline const struct cpumask *numaq_target_cpus(void) | |||
334 | return cpu_all_mask; | 334 | return cpu_all_mask; |
335 | } | 335 | } |
336 | 336 | ||
337 | static inline unsigned long | 337 | static unsigned long numaq_check_apicid_used(physid_mask_t *map, int apicid) |
338 | numaq_check_apicid_used(physid_mask_t bitmap, int apicid) | ||
339 | { | 338 | { |
340 | return physid_isset(apicid, bitmap); | 339 | return physid_isset(apicid, *map); |
341 | } | 340 | } |
342 | 341 | ||
343 | static inline unsigned long numaq_check_apicid_present(int bit) | 342 | static inline unsigned long numaq_check_apicid_present(int bit) |
@@ -371,10 +370,10 @@ static inline int numaq_multi_timer_check(int apic, int irq) | |||
371 | return apic != 0 && irq == 0; | 370 | return apic != 0 && irq == 0; |
372 | } | 371 | } |
373 | 372 | ||
374 | static inline physid_mask_t numaq_ioapic_phys_id_map(physid_mask_t phys_map) | 373 | static inline void numaq_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) |
375 | { | 374 | { |
376 | /* We don't have a good way to do this yet - hack */ | 375 | /* We don't have a good way to do this yet - hack */ |
377 | return physids_promote(0xFUL); | 376 | return physids_promote(0xFUL, retmap); |
378 | } | 377 | } |
379 | 378 | ||
380 | static inline int numaq_cpu_to_logical_apicid(int cpu) | 379 | static inline int numaq_cpu_to_logical_apicid(int cpu) |
@@ -402,12 +401,12 @@ static inline int numaq_apicid_to_node(int logical_apicid) | |||
402 | return logical_apicid >> 4; | 401 | return logical_apicid >> 4; |
403 | } | 402 | } |
404 | 403 | ||
405 | static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid) | 404 | static void numaq_apicid_to_cpu_present(int logical_apicid, physid_mask_t *retmap) |
406 | { | 405 | { |
407 | int node = numaq_apicid_to_node(logical_apicid); | 406 | int node = numaq_apicid_to_node(logical_apicid); |
408 | int cpu = __ffs(logical_apicid & 0xf); | 407 | int cpu = __ffs(logical_apicid & 0xf); |
409 | 408 | ||
410 | return physid_mask_of_physid(cpu + 4*node); | 409 | physid_set_mask_of_physid(cpu + 4*node, retmap); |
411 | } | 410 | } |
412 | 411 | ||
413 | /* Where the IO area was mapped on multiquad, always 0 otherwise */ | 412 | /* Where the IO area was mapped on multiquad, always 0 otherwise */ |
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 0c0182cc947d..1a6559f6768c 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -108,7 +108,7 @@ struct apic apic_default = { | |||
108 | .apicid_to_node = default_apicid_to_node, | 108 | .apicid_to_node = default_apicid_to_node, |
109 | .cpu_to_logical_apicid = default_cpu_to_logical_apicid, | 109 | .cpu_to_logical_apicid = default_cpu_to_logical_apicid, |
110 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 110 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
111 | .apicid_to_cpu_present = default_apicid_to_cpu_present, | 111 | .apicid_to_cpu_present = physid_set_mask_of_physid, |
112 | .setup_portio_remap = NULL, | 112 | .setup_portio_remap = NULL, |
113 | .check_phys_apicid_present = default_check_phys_apicid_present, | 113 | .check_phys_apicid_present = default_check_phys_apicid_present, |
114 | .enable_apic_mode = NULL, | 114 | .enable_apic_mode = NULL, |
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c index 645ecc4ff0be..9b419263d90d 100644 --- a/arch/x86/kernel/apic/summit_32.c +++ b/arch/x86/kernel/apic/summit_32.c | |||
@@ -183,7 +183,7 @@ static const struct cpumask *summit_target_cpus(void) | |||
183 | return cpumask_of(0); | 183 | return cpumask_of(0); |
184 | } | 184 | } |
185 | 185 | ||
186 | static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid) | 186 | static unsigned long summit_check_apicid_used(physid_mask_t *map, int apicid) |
187 | { | 187 | { |
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
@@ -261,15 +261,15 @@ static int summit_cpu_present_to_apicid(int mps_cpu) | |||
261 | return BAD_APICID; | 261 | return BAD_APICID; |
262 | } | 262 | } |
263 | 263 | ||
264 | static physid_mask_t summit_ioapic_phys_id_map(physid_mask_t phys_id_map) | 264 | static void summit_ioapic_phys_id_map(physid_mask_t *phys_id_map, physid_mask_t *retmap) |
265 | { | 265 | { |
266 | /* For clustered we don't have a good way to do this yet - hack */ | 266 | /* For clustered we don't have a good way to do this yet - hack */ |
267 | return physids_promote(0x0F); | 267 | physids_promote(0x0FL, retmap); |
268 | } | 268 | } |
269 | 269 | ||
270 | static physid_mask_t summit_apicid_to_cpu_present(int apicid) | 270 | static void summit_apicid_to_cpu_present(int apicid, physid_mask_t *retmap) |
271 | { | 271 | { |
272 | return physid_mask_of_physid(0); | 272 | physid_set_mask_of_physid(0, retmap); |
273 | } | 273 | } |
274 | 274 | ||
275 | static int summit_check_phys_apicid_present(int physical_apicid) | 275 | static int summit_check_phys_apicid_present(int physical_apicid) |
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c index f068553a1b17..cff70c86e18e 100644 --- a/arch/x86/kernel/visws_quirks.c +++ b/arch/x86/kernel/visws_quirks.c | |||
@@ -183,7 +183,7 @@ static void __init MP_processor_info(struct mpc_cpu *m) | |||
183 | return; | 183 | return; |
184 | } | 184 | } |
185 | 185 | ||
186 | apic_cpus = apic->apicid_to_cpu_present(m->apicid); | 186 | apic->apicid_to_cpu_present(m->apicid, &apic_cpus); |
187 | physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus); | 187 | physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus); |
188 | /* | 188 | /* |
189 | * Validate version | 189 | * Validate version |