aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel')
-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
11 files changed, 91 insertions, 84 deletions
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}