aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 09:42:24 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:31 -0500
commitdac5f4121df3c39fdb2ea57acd669a0ae19e46f8 (patch)
treec3dde8b525b1a8e73732bdffdb7e819f4a14fd3a /arch
parentdebccb3e77be52cfc26c5a99e123c114c5c72aeb (diff)
x86, apic: untangle the send_IPI_*() jungle
Our send_IPI_*() methods and definitions are a twisted mess: the same symbol is defined to different things depending on .config details, in a non-transparent way. - spread out the quirks into separately named per apic driver methods - prefix the standard PC methods with default_ - get rid of wrapper macro obfuscation - clean up various details Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/bigsmp/ipi.h16
-rw-r--r--arch/x86/include/asm/es7000/ipi.h16
-rw-r--r--arch/x86/include/asm/hw_irq.h4
-rw-r--r--arch/x86/include/asm/ipi.h38
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h1
-rw-r--r--arch/x86/include/asm/mach-default/mach_ipi.h40
-rw-r--r--arch/x86/include/asm/mach-generic/mach_ipi.h4
-rw-r--r--arch/x86/include/asm/numaq/ipi.h16
-rw-r--r--arch/x86/include/asm/summit/ipi.h16
-rw-r--r--arch/x86/kernel/apic.c2
-rw-r--r--arch/x86/kernel/genapic_64.c2
-rw-r--r--arch/x86/kernel/genapic_flat_64.c24
-rw-r--r--arch/x86/kernel/genx2apic_cluster.c38
-rw-r--r--arch/x86/kernel/genx2apic_phys.c36
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c21
-rw-r--r--arch/x86/kernel/io_apic.c10
-rw-r--r--arch/x86/kernel/ipi.c28
-rw-r--r--arch/x86/kernel/kgdb.c2
-rw-r--r--arch/x86/kernel/reboot.c2
-rw-r--r--arch/x86/kernel/smp.c10
-rw-r--r--arch/x86/mach-generic/bigsmp.c6
-rw-r--r--arch/x86/mach-generic/default.c6
-rw-r--r--arch/x86/mach-generic/es7000.c6
-rw-r--r--arch/x86/mach-generic/numaq.c6
-rw-r--r--arch/x86/mach-generic/summit.c6
-rw-r--r--arch/x86/mm/tlb.c2
26 files changed, 178 insertions, 180 deletions
diff --git a/arch/x86/include/asm/bigsmp/ipi.h b/arch/x86/include/asm/bigsmp/ipi.h
index 27fcd01b3ae6..a91db69cda6b 100644
--- a/arch/x86/include/asm/bigsmp/ipi.h
+++ b/arch/x86/include/asm/bigsmp/ipi.h
@@ -1,22 +1,22 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_MACH_IPI_H
3 3
4void send_IPI_mask_sequence(const struct cpumask *mask, int vector); 4void default_send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector); 5void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
6 6
7static inline void send_IPI_mask(const struct cpumask *mask, int vector) 7static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
8{ 8{
9 send_IPI_mask_sequence(mask, vector); 9 default_send_IPI_mask_sequence(mask, vector);
10} 10}
11 11
12static inline void send_IPI_allbutself(int vector) 12static inline void bigsmp_send_IPI_allbutself(int vector)
13{ 13{
14 send_IPI_mask_allbutself(cpu_online_mask, vector); 14 default_send_IPI_mask_allbutself(cpu_online_mask, vector);
15} 15}
16 16
17static inline void send_IPI_all(int vector) 17static inline void bigsmp_send_IPI_all(int vector)
18{ 18{
19 send_IPI_mask(cpu_online_mask, vector); 19 default_send_IPI_mask(cpu_online_mask, vector);
20} 20}
21 21
22#endif /* __ASM_MACH_IPI_H */ 22#endif /* __ASM_MACH_IPI_H */
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
index 7e8ed24d4b8a..81e77c812baa 100644
--- a/arch/x86/include/asm/es7000/ipi.h
+++ b/arch/x86/include/asm/es7000/ipi.h
@@ -1,22 +1,22 @@
1#ifndef __ASM_ES7000_IPI_H 1#ifndef __ASM_ES7000_IPI_H
2#define __ASM_ES7000_IPI_H 2#define __ASM_ES7000_IPI_H
3 3
4void send_IPI_mask_sequence(const struct cpumask *mask, int vector); 4void default_send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector); 5void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
6 6
7static inline void send_IPI_mask(const struct cpumask *mask, int vector) 7static inline void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
8{ 8{
9 send_IPI_mask_sequence(mask, vector); 9 default_send_IPI_mask_sequence(mask, vector);
10} 10}
11 11
12static inline void send_IPI_allbutself(int vector) 12static inline void es7000_send_IPI_allbutself(int vector)
13{ 13{
14 send_IPI_mask_allbutself(cpu_online_mask, vector); 14 default_send_IPI_mask_allbutself(cpu_online_mask, vector);
15} 15}
16 16
17static inline void send_IPI_all(int vector) 17static inline void es7000_send_IPI_all(int vector)
18{ 18{
19 send_IPI_mask(cpu_online_mask, vector); 19 es7000_send_IPI_mask(cpu_online_mask, vector);
20} 20}
21 21
22#endif /* __ASM_ES7000_IPI_H */ 22#endif /* __ASM_ES7000_IPI_H */
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 8de644b6b959..bfa921fad133 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -73,9 +73,9 @@ extern void enable_IO_APIC(void);
73 73
74/* IPI functions */ 74/* IPI functions */
75#ifdef CONFIG_X86_32 75#ifdef CONFIG_X86_32
76extern void send_IPI_self(int vector); 76extern void default_send_IPI_self(int vector);
77#endif 77#endif
78extern void send_IPI(int dest, int vector); 78extern void default_send_IPI(int dest, int vector);
79 79
80/* Statistics */ 80/* Statistics */
81extern atomic_t irq_err_count; 81extern atomic_t irq_err_count;
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h
index c745a306f7d3..a8d717f2c7e7 100644
--- a/arch/x86/include/asm/ipi.h
+++ b/arch/x86/include/asm/ipi.h
@@ -55,8 +55,9 @@ static inline void __xapic_wait_icr_idle(void)
55 cpu_relax(); 55 cpu_relax();
56} 56}
57 57
58static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, 58static inline void
59 unsigned int dest) 59__default_send_IPI_shortcut(unsigned int shortcut,
60 int vector, unsigned int dest)
60{ 61{
61 /* 62 /*
62 * Subtle. In the case of the 'never do double writes' workaround 63 * Subtle. In the case of the 'never do double writes' workaround
@@ -87,8 +88,8 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
87 * This is used to send an IPI with no shorthand notation (the destination is 88 * This is used to send an IPI with no shorthand notation (the destination is
88 * specified in bits 56 to 63 of the ICR). 89 * specified in bits 56 to 63 of the ICR).
89 */ 90 */
90static inline void __send_IPI_dest_field(unsigned int mask, int vector, 91static inline void
91 unsigned int dest) 92 __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest)
92{ 93{
93 unsigned long cfg; 94 unsigned long cfg;
94 95
@@ -117,11 +118,11 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,
117 native_apic_mem_write(APIC_ICR, cfg); 118 native_apic_mem_write(APIC_ICR, cfg);
118} 119}
119 120
120static inline void send_IPI_mask_sequence(const struct cpumask *mask, 121static inline void
121 int vector) 122default_send_IPI_mask_sequence(const struct cpumask *mask, int vector)
122{ 123{
123 unsigned long flags;
124 unsigned long query_cpu; 124 unsigned long query_cpu;
125 unsigned long flags;
125 126
126 /* 127 /*
127 * Hack. The clustered APIC addressing mode doesn't allow us to send 128 * Hack. The clustered APIC addressing mode doesn't allow us to send
@@ -130,27 +131,28 @@ static inline void send_IPI_mask_sequence(const struct cpumask *mask,
130 */ 131 */
131 local_irq_save(flags); 132 local_irq_save(flags);
132 for_each_cpu(query_cpu, mask) { 133 for_each_cpu(query_cpu, mask) {
133 __send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu), 134 __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
134 vector, APIC_DEST_PHYSICAL); 135 query_cpu), vector, APIC_DEST_PHYSICAL);
135 } 136 }
136 local_irq_restore(flags); 137 local_irq_restore(flags);
137} 138}
138 139
139static inline void send_IPI_mask_allbutself(const struct cpumask *mask, 140static inline void
140 int vector) 141default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
141{ 142{
142 unsigned long flags;
143 unsigned int query_cpu;
144 unsigned int this_cpu = smp_processor_id(); 143 unsigned int this_cpu = smp_processor_id();
144 unsigned int query_cpu;
145 unsigned long flags;
145 146
146 /* See Hack comment above */ 147 /* See Hack comment above */
147 148
148 local_irq_save(flags); 149 local_irq_save(flags);
149 for_each_cpu(query_cpu, mask) 150 for_each_cpu(query_cpu, mask) {
150 if (query_cpu != this_cpu) 151 if (query_cpu == this_cpu)
151 __send_IPI_dest_field( 152 continue;
152 per_cpu(x86_cpu_to_apicid, query_cpu), 153 __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
153 vector, APIC_DEST_PHYSICAL); 154 query_cpu), vector, APIC_DEST_PHYSICAL);
155 }
154 local_irq_restore(flags); 156 local_irq_restore(flags);
155} 157}
156 158
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 8972f8434145..2e4104cf3481 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -20,7 +20,6 @@ static inline const struct cpumask *default_target_cpus(void)
20#ifdef CONFIG_X86_64 20#ifdef CONFIG_X86_64
21#include <asm/genapic.h> 21#include <asm/genapic.h>
22#define read_apic_id() (apic->get_apic_id(apic_read(APIC_ID))) 22#define read_apic_id() (apic->get_apic_id(apic_read(APIC_ID)))
23#define send_IPI_self (apic->send_IPI_self)
24#define wakeup_secondary_cpu (apic->wakeup_cpu) 23#define wakeup_secondary_cpu (apic->wakeup_cpu)
25extern void default_setup_apic_routing(void); 24extern void default_setup_apic_routing(void);
26#else 25#else
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
index 089399643dfa..85dec630c69c 100644
--- a/arch/x86/include/asm/mach-default/mach_ipi.h
+++ b/arch/x86/include/asm/mach-default/mach_ipi.h
@@ -4,45 +4,40 @@
4/* Avoid include hell */ 4/* Avoid include hell */
5#define NMI_VECTOR 0x02 5#define NMI_VECTOR 0x02
6 6
7void send_IPI_mask_bitmask(const struct cpumask *mask, int vector); 7void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
8void send_IPI_mask_allbutself(const struct cpumask *mask, int vector); 8void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
9void __send_IPI_shortcut(unsigned int shortcut, int vector); 9void __default_send_IPI_shortcut(unsigned int shortcut, int vector);
10 10
11extern int no_broadcast; 11extern int no_broadcast;
12 12
13#ifdef CONFIG_X86_64 13#ifdef CONFIG_X86_64
14#include <asm/genapic.h> 14#include <asm/genapic.h>
15#define send_IPI_mask (apic->send_IPI_mask)
16#define send_IPI_mask_allbutself (apic->send_IPI_mask_allbutself)
17#else 15#else
18static inline void send_IPI_mask(const struct cpumask *mask, int vector) 16static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
19{ 17{
20 send_IPI_mask_bitmask(mask, vector); 18 default_send_IPI_mask_bitmask(mask, vector);
21} 19}
22void send_IPI_mask_allbutself(const struct cpumask *mask, int vector); 20void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
23#endif 21#endif
24 22
25static inline void __local_send_IPI_allbutself(int vector) 23static inline void __default_local_send_IPI_allbutself(int vector)
26{ 24{
27 if (no_broadcast || vector == NMI_VECTOR) 25 if (no_broadcast || vector == NMI_VECTOR)
28 send_IPI_mask_allbutself(cpu_online_mask, vector); 26 apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
29 else 27 else
30 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); 28 __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
31} 29}
32 30
33static inline void __local_send_IPI_all(int vector) 31static inline void __default_local_send_IPI_all(int vector)
34{ 32{
35 if (no_broadcast || vector == NMI_VECTOR) 33 if (no_broadcast || vector == NMI_VECTOR)
36 send_IPI_mask(cpu_online_mask, vector); 34 apic->send_IPI_mask(cpu_online_mask, vector);
37 else 35 else
38 __send_IPI_shortcut(APIC_DEST_ALLINC, vector); 36 __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector);
39} 37}
40 38
41#ifdef CONFIG_X86_64 39#ifdef CONFIG_X86_32
42#define send_IPI_allbutself (apic->send_IPI_allbutself) 40static inline void default_send_IPI_allbutself(int vector)
43#define send_IPI_all (apic->send_IPI_all)
44#else
45static inline void send_IPI_allbutself(int vector)
46{ 41{
47 /* 42 /*
48 * if there are no other CPUs in the system then we get an APIC send 43 * if there are no other CPUs in the system then we get an APIC send
@@ -51,13 +46,12 @@ static inline void send_IPI_allbutself(int vector)
51 if (!(num_online_cpus() > 1)) 46 if (!(num_online_cpus() > 1))
52 return; 47 return;
53 48
54 __local_send_IPI_allbutself(vector); 49 __default_local_send_IPI_allbutself(vector);
55 return;
56} 50}
57 51
58static inline void send_IPI_all(int vector) 52static inline void default_send_IPI_all(int vector)
59{ 53{
60 __local_send_IPI_all(vector); 54 __default_local_send_IPI_all(vector);
61} 55}
62#endif 56#endif
63 57
diff --git a/arch/x86/include/asm/mach-generic/mach_ipi.h b/arch/x86/include/asm/mach-generic/mach_ipi.h
index 75e54bd6cbdc..5691c09645c5 100644
--- a/arch/x86/include/asm/mach-generic/mach_ipi.h
+++ b/arch/x86/include/asm/mach-generic/mach_ipi.h
@@ -3,8 +3,4 @@
3 3
4#include <asm/genapic.h> 4#include <asm/genapic.h>
5 5
6#define send_IPI_mask (apic->send_IPI_mask)
7#define send_IPI_allbutself (apic->send_IPI_allbutself)
8#define send_IPI_all (apic->send_IPI_all)
9
10#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */ 6#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */
diff --git a/arch/x86/include/asm/numaq/ipi.h b/arch/x86/include/asm/numaq/ipi.h
index a8374c652778..5dbc4b4cd5e5 100644
--- a/arch/x86/include/asm/numaq/ipi.h
+++ b/arch/x86/include/asm/numaq/ipi.h
@@ -1,22 +1,22 @@
1#ifndef __ASM_NUMAQ_IPI_H 1#ifndef __ASM_NUMAQ_IPI_H
2#define __ASM_NUMAQ_IPI_H 2#define __ASM_NUMAQ_IPI_H
3 3
4void send_IPI_mask_sequence(const struct cpumask *mask, int vector); 4void default_send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector); 5void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
6 6
7static inline void send_IPI_mask(const struct cpumask *mask, int vector) 7static inline void numaq_send_IPI_mask(const struct cpumask *mask, int vector)
8{ 8{
9 send_IPI_mask_sequence(mask, vector); 9 default_send_IPI_mask_sequence(mask, vector);
10} 10}
11 11
12static inline void send_IPI_allbutself(int vector) 12static inline void numaq_send_IPI_allbutself(int vector)
13{ 13{
14 send_IPI_mask_allbutself(cpu_online_mask, vector); 14 default_send_IPI_mask_allbutself(cpu_online_mask, vector);
15} 15}
16 16
17static inline void send_IPI_all(int vector) 17static inline void numaq_send_IPI_all(int vector)
18{ 18{
19 send_IPI_mask(cpu_online_mask, vector); 19 numaq_send_IPI_mask(cpu_online_mask, vector);
20} 20}
21 21
22#endif /* __ASM_NUMAQ_IPI_H */ 22#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/arch/x86/include/asm/summit/ipi.h b/arch/x86/include/asm/summit/ipi.h
index a8a2c24f50cc..f87a43fe0aed 100644
--- a/arch/x86/include/asm/summit/ipi.h
+++ b/arch/x86/include/asm/summit/ipi.h
@@ -1,26 +1,26 @@
1#ifndef __ASM_SUMMIT_IPI_H 1#ifndef __ASM_SUMMIT_IPI_H
2#define __ASM_SUMMIT_IPI_H 2#define __ASM_SUMMIT_IPI_H
3 3
4void send_IPI_mask_sequence(const cpumask_t *mask, int vector); 4void default_send_IPI_mask_sequence(const cpumask_t *mask, int vector);
5void send_IPI_mask_allbutself(const cpumask_t *mask, int vector); 5void default_send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
6 6
7static inline void send_IPI_mask(const cpumask_t *mask, int vector) 7static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector)
8{ 8{
9 send_IPI_mask_sequence(mask, vector); 9 default_send_IPI_mask_sequence(mask, vector);
10} 10}
11 11
12static inline void send_IPI_allbutself(int vector) 12static inline void summit_send_IPI_allbutself(int vector)
13{ 13{
14 cpumask_t mask = cpu_online_map; 14 cpumask_t mask = cpu_online_map;
15 cpu_clear(smp_processor_id(), mask); 15 cpu_clear(smp_processor_id(), mask);
16 16
17 if (!cpus_empty(mask)) 17 if (!cpus_empty(mask))
18 send_IPI_mask(&mask, vector); 18 summit_send_IPI_mask(&mask, vector);
19} 19}
20 20
21static inline void send_IPI_all(int vector) 21static inline void summit_send_IPI_all(int vector)
22{ 22{
23 send_IPI_mask(&cpu_online_map, vector); 23 summit_send_IPI_mask(&cpu_online_map, vector);
24} 24}
25 25
26#endif /* __ASM_SUMMIT_IPI_H */ 26#endif /* __ASM_SUMMIT_IPI_H */
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 5f7f3a9a47ad..84b8e7c57abc 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -475,7 +475,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
475static void lapic_timer_broadcast(const struct cpumask *mask) 475static void lapic_timer_broadcast(const struct cpumask *mask)
476{ 476{
477#ifdef CONFIG_SMP 477#ifdef CONFIG_SMP
478 send_IPI_mask(mask, LOCAL_TIMER_VECTOR); 478 apic->send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
479#endif 479#endif
480} 480}
481 481
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index d57d2138f078..820dea5d0ebe 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -65,7 +65,7 @@ void __init default_setup_apic_routing(void)
65 65
66void apic_send_IPI_self(int vector) 66void apic_send_IPI_self(int vector)
67{ 67{
68 __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); 68 __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
69} 69}
70 70
71int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 71int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index b941b112cafb..7c648ccea514 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -74,7 +74,7 @@ static inline void _flat_send_IPI_mask(unsigned long mask, int vector)
74 unsigned long flags; 74 unsigned long flags;
75 75
76 local_irq_save(flags); 76 local_irq_save(flags);
77 __send_IPI_dest_field(mask, vector, apic->dest_logical); 77 __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
78 local_irq_restore(flags); 78 local_irq_restore(flags);
79} 79}
80 80
@@ -85,14 +85,15 @@ static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector)
85 _flat_send_IPI_mask(mask, vector); 85 _flat_send_IPI_mask(mask, vector);
86} 86}
87 87
88static void flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, 88static void
89 int vector) 89 flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector)
90{ 90{
91 unsigned long mask = cpumask_bits(cpumask)[0]; 91 unsigned long mask = cpumask_bits(cpumask)[0];
92 int cpu = smp_processor_id(); 92 int cpu = smp_processor_id();
93 93
94 if (cpu < BITS_PER_LONG) 94 if (cpu < BITS_PER_LONG)
95 clear_bit(cpu, &mask); 95 clear_bit(cpu, &mask);
96
96 _flat_send_IPI_mask(mask, vector); 97 _flat_send_IPI_mask(mask, vector);
97} 98}
98 99
@@ -114,16 +115,19 @@ static void flat_send_IPI_allbutself(int vector)
114 _flat_send_IPI_mask(mask, vector); 115 _flat_send_IPI_mask(mask, vector);
115 } 116 }
116 } else if (num_online_cpus() > 1) { 117 } else if (num_online_cpus() > 1) {
117 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical); 118 __default_send_IPI_shortcut(APIC_DEST_ALLBUT,
119 vector, apic->dest_logical);
118 } 120 }
119} 121}
120 122
121static void flat_send_IPI_all(int vector) 123static void flat_send_IPI_all(int vector)
122{ 124{
123 if (vector == NMI_VECTOR) 125 if (vector == NMI_VECTOR) {
124 flat_send_IPI_mask(cpu_online_mask, vector); 126 flat_send_IPI_mask(cpu_online_mask, vector);
125 else 127 } else {
126 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical); 128 __default_send_IPI_shortcut(APIC_DEST_ALLINC,
129 vector, apic->dest_logical);
130 }
127} 131}
128 132
129static unsigned int flat_get_apic_id(unsigned long x) 133static unsigned int flat_get_apic_id(unsigned long x)
@@ -265,18 +269,18 @@ static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask)
265 269
266static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector) 270static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector)
267{ 271{
268 send_IPI_mask_sequence(cpumask, vector); 272 default_send_IPI_mask_sequence(cpumask, vector);
269} 273}
270 274
271static void physflat_send_IPI_mask_allbutself(const struct cpumask *cpumask, 275static void physflat_send_IPI_mask_allbutself(const struct cpumask *cpumask,
272 int vector) 276 int vector)
273{ 277{
274 send_IPI_mask_allbutself(cpumask, vector); 278 default_send_IPI_mask_allbutself(cpumask, vector);
275} 279}
276 280
277static void physflat_send_IPI_allbutself(int vector) 281static void physflat_send_IPI_allbutself(int vector)
278{ 282{
279 send_IPI_mask_allbutself(cpu_online_mask, vector); 283 default_send_IPI_mask_allbutself(cpu_online_mask, vector);
280} 284}
281 285
282static void physflat_send_IPI_all(int vector) 286static void physflat_send_IPI_all(int vector)
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 62f9fccf01dd..2d97726a973e 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -36,8 +36,8 @@ static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
36 cpumask_set_cpu(cpu, retmask); 36 cpumask_set_cpu(cpu, retmask);
37} 37}
38 38
39static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, 39static void
40 unsigned int dest) 40 __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest)
41{ 41{
42 unsigned long cfg; 42 unsigned long cfg;
43 43
@@ -57,45 +57,50 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
57 */ 57 */
58static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) 58static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
59{ 59{
60 unsigned long flags;
61 unsigned long query_cpu; 60 unsigned long query_cpu;
61 unsigned long flags;
62 62
63 local_irq_save(flags); 63 local_irq_save(flags);
64 for_each_cpu(query_cpu, mask) 64 for_each_cpu(query_cpu, mask) {
65 __x2apic_send_IPI_dest( 65 __x2apic_send_IPI_dest(
66 per_cpu(x86_cpu_to_logical_apicid, query_cpu), 66 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
67 vector, apic->dest_logical); 67 vector, apic->dest_logical);
68 }
68 local_irq_restore(flags); 69 local_irq_restore(flags);
69} 70}
70 71
71static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, 72static void
72 int vector) 73 x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
73{ 74{
74 unsigned long flags;
75 unsigned long query_cpu;
76 unsigned long this_cpu = smp_processor_id(); 75 unsigned long this_cpu = smp_processor_id();
76 unsigned long query_cpu;
77 unsigned long flags;
77 78
78 local_irq_save(flags); 79 local_irq_save(flags);
79 for_each_cpu(query_cpu, mask) 80 for_each_cpu(query_cpu, mask) {
80 if (query_cpu != this_cpu) 81 if (query_cpu == this_cpu)
81 __x2apic_send_IPI_dest( 82 continue;
83 __x2apic_send_IPI_dest(
82 per_cpu(x86_cpu_to_logical_apicid, query_cpu), 84 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
83 vector, apic->dest_logical); 85 vector, apic->dest_logical);
86 }
84 local_irq_restore(flags); 87 local_irq_restore(flags);
85} 88}
86 89
87static void x2apic_send_IPI_allbutself(int vector) 90static void x2apic_send_IPI_allbutself(int vector)
88{ 91{
89 unsigned long flags;
90 unsigned long query_cpu;
91 unsigned long this_cpu = smp_processor_id(); 92 unsigned long this_cpu = smp_processor_id();
93 unsigned long query_cpu;
94 unsigned long flags;
92 95
93 local_irq_save(flags); 96 local_irq_save(flags);
94 for_each_online_cpu(query_cpu) 97 for_each_online_cpu(query_cpu) {
95 if (query_cpu != this_cpu) 98 if (query_cpu == this_cpu)
96 __x2apic_send_IPI_dest( 99 continue;
100 __x2apic_send_IPI_dest(
97 per_cpu(x86_cpu_to_logical_apicid, query_cpu), 101 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
98 vector, apic->dest_logical); 102 vector, apic->dest_logical);
103 }
99 local_irq_restore(flags); 104 local_irq_restore(flags);
100} 105}
101 106
@@ -175,7 +180,6 @@ static void init_x2apic_ldr(void)
175 int cpu = smp_processor_id(); 180 int cpu = smp_processor_id();
176 181
177 per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR); 182 per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR);
178 return;
179} 183}
180 184
181struct genapic apic_x2apic_cluster = { 185struct genapic apic_x2apic_cluster = {
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 3da1675b2604..74777c276693 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -55,8 +55,8 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
55 55
56static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) 56static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
57{ 57{
58 unsigned long flags;
59 unsigned long query_cpu; 58 unsigned long query_cpu;
59 unsigned long flags;
60 60
61 local_irq_save(flags); 61 local_irq_save(flags);
62 for_each_cpu(query_cpu, mask) { 62 for_each_cpu(query_cpu, mask) {
@@ -66,12 +66,12 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
66 local_irq_restore(flags); 66 local_irq_restore(flags);
67} 67}
68 68
69static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, 69static void
70 int vector) 70 x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
71{ 71{
72 unsigned long flags;
73 unsigned long query_cpu;
74 unsigned long this_cpu = smp_processor_id(); 72 unsigned long this_cpu = smp_processor_id();
73 unsigned long query_cpu;
74 unsigned long flags;
75 75
76 local_irq_save(flags); 76 local_irq_save(flags);
77 for_each_cpu(query_cpu, mask) { 77 for_each_cpu(query_cpu, mask) {
@@ -85,16 +85,17 @@ static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
85 85
86static void x2apic_send_IPI_allbutself(int vector) 86static void x2apic_send_IPI_allbutself(int vector)
87{ 87{
88 unsigned long flags;
89 unsigned long query_cpu;
90 unsigned long this_cpu = smp_processor_id(); 88 unsigned long this_cpu = smp_processor_id();
89 unsigned long query_cpu;
90 unsigned long flags;
91 91
92 local_irq_save(flags); 92 local_irq_save(flags);
93 for_each_online_cpu(query_cpu) 93 for_each_online_cpu(query_cpu) {
94 if (query_cpu != this_cpu) 94 if (query_cpu == this_cpu)
95 __x2apic_send_IPI_dest( 95 continue;
96 per_cpu(x86_cpu_to_apicid, query_cpu), 96 __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu),
97 vector, APIC_DEST_PHYSICAL); 97 vector, APIC_DEST_PHYSICAL);
98 }
98 local_irq_restore(flags); 99 local_irq_restore(flags);
99} 100}
100 101
@@ -145,18 +146,12 @@ x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
145 146
146static unsigned int x2apic_phys_get_apic_id(unsigned long x) 147static unsigned int x2apic_phys_get_apic_id(unsigned long x)
147{ 148{
148 unsigned int id; 149 return x;
149
150 id = x;
151 return id;
152} 150}
153 151
154static unsigned long set_apic_id(unsigned int id) 152static unsigned long set_apic_id(unsigned int id)
155{ 153{
156 unsigned long x; 154 return id;
157
158 x = id;
159 return x;
160} 155}
161 156
162static int x2apic_phys_pkg_id(int initial_apicid, int index_msb) 157static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
@@ -171,7 +166,6 @@ static void x2apic_send_IPI_self(int vector)
171 166
172static void init_x2apic_ldr(void) 167static void init_x2apic_ldr(void)
173{ 168{
174 return;
175} 169}
176 170
177struct genapic apic_x2apic_phys = { 171struct genapic apic_x2apic_phys = {
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index f957878c21e9..24b9f42db9b7 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -118,12 +118,13 @@ static void uv_send_IPI_one(int cpu, int vector)
118 int pnode; 118 int pnode;
119 119
120 apicid = per_cpu(x86_cpu_to_apicid, cpu); 120 apicid = per_cpu(x86_cpu_to_apicid, cpu);
121 lapicid = apicid & 0x3f; /* ZZZ macro needed */ 121 lapicid = apicid & 0x3f; /* ZZZ macro needed */
122 pnode = uv_apicid_to_pnode(apicid); 122 pnode = uv_apicid_to_pnode(apicid);
123 val = 123
124 (1UL << UVH_IPI_INT_SEND_SHFT) | (lapicid << 124 val = ( 1UL << UVH_IPI_INT_SEND_SHFT ) |
125 UVH_IPI_INT_APIC_ID_SHFT) | 125 ( lapicid << UVH_IPI_INT_APIC_ID_SHFT ) |
126 (vector << UVH_IPI_INT_VECTOR_SHFT); 126 ( vector << UVH_IPI_INT_VECTOR_SHFT );
127
127 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 128 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
128} 129}
129 130
@@ -137,22 +138,24 @@ static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
137 138
138static void uv_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) 139static void uv_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
139{ 140{
140 unsigned int cpu;
141 unsigned int this_cpu = smp_processor_id(); 141 unsigned int this_cpu = smp_processor_id();
142 unsigned int cpu;
142 143
143 for_each_cpu(cpu, mask) 144 for_each_cpu(cpu, mask) {
144 if (cpu != this_cpu) 145 if (cpu != this_cpu)
145 uv_send_IPI_one(cpu, vector); 146 uv_send_IPI_one(cpu, vector);
147 }
146} 148}
147 149
148static void uv_send_IPI_allbutself(int vector) 150static void uv_send_IPI_allbutself(int vector)
149{ 151{
150 unsigned int cpu;
151 unsigned int this_cpu = smp_processor_id(); 152 unsigned int this_cpu = smp_processor_id();
153 unsigned int cpu;
152 154
153 for_each_online_cpu(cpu) 155 for_each_online_cpu(cpu) {
154 if (cpu != this_cpu) 156 if (cpu != this_cpu)
155 uv_send_IPI_one(cpu, vector); 157 uv_send_IPI_one(cpu, vector);
158 }
156} 159}
157 160
158static void uv_send_IPI_all(int vector) 161static void uv_send_IPI_all(int vector)
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 01a2505d7275..e90970ce21a0 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -514,11 +514,11 @@ static void send_cleanup_vector(struct irq_cfg *cfg)
514 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) 514 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
515 cfg->move_cleanup_count++; 515 cfg->move_cleanup_count++;
516 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) 516 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
517 send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR); 517 apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
518 } else { 518 } else {
519 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask); 519 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask);
520 cfg->move_cleanup_count = cpumask_weight(cleanup_mask); 520 cfg->move_cleanup_count = cpumask_weight(cleanup_mask);
521 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); 521 apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
522 free_cpumask_var(cleanup_mask); 522 free_cpumask_var(cleanup_mask);
523 } 523 }
524 cfg->move_in_progress = 0; 524 cfg->move_in_progress = 0;
@@ -800,7 +800,7 @@ static void clear_IO_APIC (void)
800} 800}
801 801
802#if !defined(CONFIG_SMP) && defined(CONFIG_X86_32) 802#if !defined(CONFIG_SMP) && defined(CONFIG_X86_32)
803void send_IPI_self(int vector) 803void default_send_IPI_self(int vector)
804{ 804{
805 unsigned int cfg; 805 unsigned int cfg;
806 806
@@ -2297,7 +2297,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
2297 unsigned long flags; 2297 unsigned long flags;
2298 2298
2299 spin_lock_irqsave(&vector_lock, flags); 2299 spin_lock_irqsave(&vector_lock, flags);
2300 send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector); 2300 apic->send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector);
2301 spin_unlock_irqrestore(&vector_lock, flags); 2301 spin_unlock_irqrestore(&vector_lock, flags);
2302 2302
2303 return 1; 2303 return 1;
@@ -2305,7 +2305,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
2305#else 2305#else
2306static int ioapic_retrigger_irq(unsigned int irq) 2306static int ioapic_retrigger_irq(unsigned int irq)
2307{ 2307{
2308 send_IPI_self(irq_cfg(irq)->vector); 2308 apic->send_IPI_self(irq_cfg(irq)->vector);
2309 2309
2310 return 1; 2310 return 1;
2311} 2311}
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index 367c5e684fa1..e16c41b2e4ec 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -48,7 +48,7 @@ static inline int __prepare_ICR2(unsigned int mask)
48 return SET_APIC_DEST_FIELD(mask); 48 return SET_APIC_DEST_FIELD(mask);
49} 49}
50 50
51void __send_IPI_shortcut(unsigned int shortcut, int vector) 51void __default_send_IPI_shortcut(unsigned int shortcut, int vector)
52{ 52{
53 /* 53 /*
54 * Subtle. In the case of the 'never do double writes' workaround 54 * Subtle. In the case of the 'never do double writes' workaround
@@ -75,16 +75,16 @@ void __send_IPI_shortcut(unsigned int shortcut, int vector)
75 apic_write(APIC_ICR, cfg); 75 apic_write(APIC_ICR, cfg);
76} 76}
77 77
78void send_IPI_self(int vector) 78void default_send_IPI_self(int vector)
79{ 79{
80 __send_IPI_shortcut(APIC_DEST_SELF, vector); 80 __default_send_IPI_shortcut(APIC_DEST_SELF, vector);
81} 81}
82 82
83/* 83/*
84 * This is used to send an IPI with no shorthand notation (the destination is 84 * This is used to send an IPI with no shorthand notation (the destination is
85 * specified in bits 56 to 63 of the ICR). 85 * specified in bits 56 to 63 of the ICR).
86 */ 86 */
87static inline void __send_IPI_dest_field(unsigned long mask, int vector) 87static inline void __default_send_IPI_dest_field(unsigned long mask, int vector)
88{ 88{
89 unsigned long cfg; 89 unsigned long cfg;
90 90
@@ -116,18 +116,18 @@ static inline void __send_IPI_dest_field(unsigned long mask, int vector)
116/* 116/*
117 * This is only used on smaller machines. 117 * This is only used on smaller machines.
118 */ 118 */
119void send_IPI_mask_bitmask(const struct cpumask *cpumask, int vector) 119void default_send_IPI_mask_bitmask(const struct cpumask *cpumask, int vector)
120{ 120{
121 unsigned long mask = cpumask_bits(cpumask)[0]; 121 unsigned long mask = cpumask_bits(cpumask)[0];
122 unsigned long flags; 122 unsigned long flags;
123 123
124 local_irq_save(flags); 124 local_irq_save(flags);
125 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]); 125 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);
126 __send_IPI_dest_field(mask, vector); 126 __default_send_IPI_dest_field(mask, vector);
127 local_irq_restore(flags); 127 local_irq_restore(flags);
128} 128}
129 129
130void send_IPI_mask_sequence(const struct cpumask *mask, int vector) 130void default_send_IPI_mask_sequence(const struct cpumask *mask, int vector)
131{ 131{
132 unsigned long flags; 132 unsigned long flags;
133 unsigned int query_cpu; 133 unsigned int query_cpu;
@@ -140,11 +140,11 @@ void send_IPI_mask_sequence(const struct cpumask *mask, int vector)
140 140
141 local_irq_save(flags); 141 local_irq_save(flags);
142 for_each_cpu(query_cpu, mask) 142 for_each_cpu(query_cpu, mask)
143 __send_IPI_dest_field(apic->cpu_to_logical_apicid(query_cpu), vector); 143 __default_send_IPI_dest_field(apic->cpu_to_logical_apicid(query_cpu), vector);
144 local_irq_restore(flags); 144 local_irq_restore(flags);
145} 145}
146 146
147void send_IPI_mask_allbutself(const struct cpumask *mask, int vector) 147void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
148{ 148{
149 unsigned long flags; 149 unsigned long flags;
150 unsigned int query_cpu; 150 unsigned int query_cpu;
@@ -153,10 +153,12 @@ void send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
153 /* See Hack comment above */ 153 /* See Hack comment above */
154 154
155 local_irq_save(flags); 155 local_irq_save(flags);
156 for_each_cpu(query_cpu, mask) 156 for_each_cpu(query_cpu, mask) {
157 if (query_cpu != this_cpu) 157 if (query_cpu == this_cpu)
158 __send_IPI_dest_field(apic->cpu_to_logical_apicid(query_cpu), 158 continue;
159 vector); 159 __default_send_IPI_dest_field(
160 apic->cpu_to_logical_apicid(query_cpu), vector);
161 }
160 local_irq_restore(flags); 162 local_irq_restore(flags);
161} 163}
162 164
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 10435a120d22..b62a3811e01c 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -347,7 +347,7 @@ void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
347 */ 347 */
348void kgdb_roundup_cpus(unsigned long flags) 348void kgdb_roundup_cpus(unsigned long flags)
349{ 349{
350 send_IPI_allbutself(APIC_DM_NMI); 350 apic->send_IPI_allbutself(APIC_DM_NMI);
351} 351}
352#endif 352#endif
353 353
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index f8536fee5c12..38dace28d625 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -651,7 +651,7 @@ static int crash_nmi_callback(struct notifier_block *self,
651 651
652static void smp_send_nmi_allbutself(void) 652static void smp_send_nmi_allbutself(void)
653{ 653{
654 send_IPI_allbutself(NMI_VECTOR); 654 apic->send_IPI_allbutself(NMI_VECTOR);
655} 655}
656 656
657static struct notifier_block crash_nmi_nb = { 657static struct notifier_block crash_nmi_nb = {
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index e6faa3316bd2..c48ba6cc32aa 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -118,12 +118,12 @@ static void native_smp_send_reschedule(int cpu)
118 WARN_ON(1); 118 WARN_ON(1);
119 return; 119 return;
120 } 120 }
121 send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR); 121 apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
122} 122}
123 123
124void native_send_call_func_single_ipi(int cpu) 124void native_send_call_func_single_ipi(int cpu)
125{ 125{
126 send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR); 126 apic->send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
127} 127}
128 128
129void native_send_call_func_ipi(const struct cpumask *mask) 129void native_send_call_func_ipi(const struct cpumask *mask)
@@ -131,7 +131,7 @@ void native_send_call_func_ipi(const struct cpumask *mask)
131 cpumask_var_t allbutself; 131 cpumask_var_t allbutself;
132 132
133 if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) { 133 if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) {
134 send_IPI_mask(mask, CALL_FUNCTION_VECTOR); 134 apic->send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
135 return; 135 return;
136 } 136 }
137 137
@@ -140,9 +140,9 @@ void native_send_call_func_ipi(const struct cpumask *mask)
140 140
141 if (cpumask_equal(mask, allbutself) && 141 if (cpumask_equal(mask, allbutself) &&
142 cpumask_equal(cpu_online_mask, cpu_callout_mask)) 142 cpumask_equal(cpu_online_mask, cpu_callout_mask))
143 send_IPI_allbutself(CALL_FUNCTION_VECTOR); 143 apic->send_IPI_allbutself(CALL_FUNCTION_VECTOR);
144 else 144 else
145 send_IPI_mask(mask, CALL_FUNCTION_VECTOR); 145 apic->send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
146 146
147 free_cpumask_var(allbutself); 147 free_cpumask_var(allbutself);
148} 148}
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 22c2c7b8e4ab..4782b5547881 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -97,10 +97,10 @@ struct genapic apic_bigsmp = {
97 .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid, 97 .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid,
98 .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and, 98 .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and,
99 99
100 .send_IPI_mask = send_IPI_mask, 100 .send_IPI_mask = default_send_IPI_mask,
101 .send_IPI_mask_allbutself = NULL, 101 .send_IPI_mask_allbutself = NULL,
102 .send_IPI_allbutself = send_IPI_allbutself, 102 .send_IPI_allbutself = bigsmp_send_IPI_allbutself,
103 .send_IPI_all = send_IPI_all, 103 .send_IPI_all = bigsmp_send_IPI_all,
104 .send_IPI_self = NULL, 104 .send_IPI_self = NULL,
105 105
106 .wakeup_cpu = NULL, 106 .wakeup_cpu = NULL,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 477ebec16749..bf4670db25fe 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -78,10 +78,10 @@ struct genapic apic_default = {
78 .cpu_mask_to_apicid = default_cpu_mask_to_apicid, 78 .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
79 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and, 79 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
80 80
81 .send_IPI_mask = send_IPI_mask, 81 .send_IPI_mask = default_send_IPI_mask,
82 .send_IPI_mask_allbutself = NULL, 82 .send_IPI_mask_allbutself = NULL,
83 .send_IPI_allbutself = send_IPI_allbutself, 83 .send_IPI_allbutself = default_send_IPI_allbutself,
84 .send_IPI_all = send_IPI_all, 84 .send_IPI_all = default_send_IPI_all,
85 .send_IPI_self = NULL, 85 .send_IPI_self = NULL,
86 86
87 .wakeup_cpu = NULL, 87 .wakeup_cpu = NULL,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index d758cf65d736..d36642e6d908 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -133,10 +133,10 @@ struct genapic apic_es7000 = {
133 .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid, 133 .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
134 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and, 134 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
135 135
136 .send_IPI_mask = send_IPI_mask, 136 .send_IPI_mask = es7000_send_IPI_mask,
137 .send_IPI_mask_allbutself = NULL, 137 .send_IPI_mask_allbutself = NULL,
138 .send_IPI_allbutself = send_IPI_allbutself, 138 .send_IPI_allbutself = es7000_send_IPI_allbutself,
139 .send_IPI_all = send_IPI_all, 139 .send_IPI_all = es7000_send_IPI_all,
140 .send_IPI_self = NULL, 140 .send_IPI_self = NULL,
141 141
142 .wakeup_cpu = NULL, 142 .wakeup_cpu = NULL,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index eb7d56a521d4..135b1832ad80 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -97,10 +97,10 @@ struct genapic apic_numaq = {
97 .cpu_mask_to_apicid = numaq_cpu_mask_to_apicid, 97 .cpu_mask_to_apicid = numaq_cpu_mask_to_apicid,
98 .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and, 98 .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and,
99 99
100 .send_IPI_mask = send_IPI_mask, 100 .send_IPI_mask = numaq_send_IPI_mask,
101 .send_IPI_mask_allbutself = NULL, 101 .send_IPI_mask_allbutself = NULL,
102 .send_IPI_allbutself = send_IPI_allbutself, 102 .send_IPI_allbutself = numaq_send_IPI_allbutself,
103 .send_IPI_all = send_IPI_all, 103 .send_IPI_all = numaq_send_IPI_all,
104 .send_IPI_self = NULL, 104 .send_IPI_self = NULL,
105 105
106 .wakeup_cpu = NULL, 106 .wakeup_cpu = NULL,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 8c293055bdf0..77196a4a9d2b 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -77,10 +77,10 @@ struct genapic apic_summit = {
77 .cpu_mask_to_apicid = summit_cpu_mask_to_apicid, 77 .cpu_mask_to_apicid = summit_cpu_mask_to_apicid,
78 .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and, 78 .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and,
79 79
80 .send_IPI_mask = send_IPI_mask, 80 .send_IPI_mask = summit_send_IPI_mask,
81 .send_IPI_mask_allbutself = NULL, 81 .send_IPI_mask_allbutself = NULL,
82 .send_IPI_allbutself = send_IPI_allbutself, 82 .send_IPI_allbutself = summit_send_IPI_allbutself,
83 .send_IPI_all = send_IPI_all, 83 .send_IPI_all = summit_send_IPI_all,
84 .send_IPI_self = NULL, 84 .send_IPI_self = NULL,
85 85
86 .wakeup_cpu = NULL, 86 .wakeup_cpu = NULL,
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 72a6d4ebe34d..6348e1146925 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -196,7 +196,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
196 * We have to send the IPI only to 196 * We have to send the IPI only to
197 * CPUs affected. 197 * CPUs affected.
198 */ 198 */
199 send_IPI_mask(to_cpumask(f->flush_cpumask), 199 apic->send_IPI_mask(to_cpumask(f->flush_cpumask),
200 INVALIDATE_TLB_VECTOR_START + sender); 200 INVALIDATE_TLB_VECTOR_START + sender);
201 201
202 while (!cpumask_empty(to_cpumask(f->flush_cpumask))) 202 while (!cpumask_empty(to_cpumask(f->flush_cpumask)))