Skip to content

Commit 670c04a

Browse files
committed
x86/apic: Nuke ack_APIC_irq()
Yet another wrapper of a wrapper gone along with the outdated comment that this compiles to a single instruction. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Wei Liu <wei.liu@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Michael Kelley <mikelley@microsoft.com> Tested-by: Sohil Mehta <sohil.mehta@intel.com> Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
1 parent 185c8f3 commit 670c04a

14 files changed

Lines changed: 28 additions & 38 deletions

File tree

arch/x86/hyperv/hv_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static inline bool hv_reenlightenment_available(void)
161161

162162
DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_reenlightenment)
163163
{
164-
ack_APIC_irq();
164+
apic_eoi();
165165
inc_irq_stat(irq_hv_reenlightenment_count);
166166
schedule_delayed_work(&hv_reenlightenment_work, HZ/10);
167167
}

arch/x86/include/asm/apic.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -402,16 +402,6 @@ static inline void apic_set_eoi_cb(void (*eoi)(void)) {}
402402

403403
extern void apic_ack_irq(struct irq_data *data);
404404

405-
static inline void ack_APIC_irq(void)
406-
{
407-
/*
408-
* ack_APIC_irq() actually gets compiled as a single instruction
409-
* ... yummie.
410-
*/
411-
apic_eoi();
412-
}
413-
414-
415405
static inline bool lapic_vector_set_in_irr(unsigned int vector)
416406
{
417407
u32 irr = apic_read(APIC_IRR + (vector / 32 * 0x10));

arch/x86/kernel/apic/apic.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_apic_timer_interrupt)
10761076
{
10771077
struct pt_regs *old_regs = set_irq_regs(regs);
10781078

1079-
ack_APIC_irq();
1079+
apic_eoi();
10801080
trace_local_timer_entry(LOCAL_TIMER_VECTOR);
10811081
local_apic_timer_interrupt();
10821082
trace_local_timer_exit(LOCAL_TIMER_VECTOR);
@@ -1480,7 +1480,7 @@ static bool apic_check_and_ack(union apic_ir *irr, union apic_ir *isr)
14801480
* per set bit.
14811481
*/
14821482
for_each_set_bit(bit, isr->map, APIC_IR_BITS)
1483-
ack_APIC_irq();
1483+
apic_eoi();
14841484
return true;
14851485
}
14861486

@@ -1492,7 +1492,7 @@ static bool apic_check_and_ack(union apic_ir *irr, union apic_ir *isr)
14921492
* interrupt from previous kernel might still have ISR bit set.
14931493
*
14941494
* Most probably by now the CPU has serviced that pending interrupt and it
1495-
* might not have done the ack_APIC_irq() because it thought, interrupt
1495+
* might not have done the apic_eoi() because it thought, interrupt
14961496
* came from i8259 as ExtInt. LAPIC did not get EOI so it does not clear
14971497
* the ISR bit and cpu thinks it has already serviced the interrupt. Hence
14981498
* a vector might get locked. It was noticed for timer irq (vector
@@ -2147,7 +2147,7 @@ static noinline void handle_spurious_interrupt(u8 vector)
21472147
if (v & (1 << (vector & 0x1f))) {
21482148
pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Acked\n",
21492149
vector, smp_processor_id());
2150-
ack_APIC_irq();
2150+
apic_eoi();
21512151
} else {
21522152
pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Not pending!\n",
21532153
vector, smp_processor_id());
@@ -2198,7 +2198,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt)
21982198
if (lapic_get_maxlvt() > 3) /* Due to the Pentium erratum 3AP. */
21992199
apic_write(APIC_ESR, 0);
22002200
v = apic_read(APIC_ESR);
2201-
ack_APIC_irq();
2201+
apic_eoi();
22022202
atomic_inc(&irq_err_count);
22032203

22042204
apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x",

arch/x86/kernel/apic/io_apic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ static void ioapic_ack_level(struct irq_data *irq_data)
18231823
* We must acknowledge the irq before we move it or the acknowledge will
18241824
* not propagate properly.
18251825
*/
1826-
ack_APIC_irq();
1826+
apic_eoi();
18271827

18281828
/*
18291829
* Tail end of clearing remote IRR bit (either by delivering the EOI
@@ -2046,7 +2046,7 @@ static void unmask_lapic_irq(struct irq_data *data)
20462046

20472047
static void ack_lapic_irq(struct irq_data *data)
20482048
{
2049-
ack_APIC_irq();
2049+
apic_eoi();
20502050
}
20512051

20522052
static struct irq_chip lapic_chip __read_mostly = {

arch/x86/kernel/apic/vector.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ static int apic_retrigger_irq(struct irq_data *irqd)
907907
void apic_ack_irq(struct irq_data *irqd)
908908
{
909909
irq_move_irq(irqd);
910-
ack_APIC_irq();
910+
apic_eoi();
911911
}
912912

913913
void apic_ack_edge(struct irq_data *irqd)

arch/x86/kernel/cpu/acrn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_acrn_hv_callback)
5151
* will block the interrupt whose vector is lower than
5252
* HYPERVISOR_CALLBACK_VECTOR.
5353
*/
54-
ack_APIC_irq();
54+
apic_eoi();
5555
inc_irq_stat(irq_hv_callback_count);
5656

5757
if (acrn_intr_handler)

arch/x86/kernel/cpu/mce/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_deferred_error)
759759
inc_irq_stat(irq_deferred_error_count);
760760
deferred_error_int_vector();
761761
trace_deferred_error_apic_exit(DEFERRED_ERROR_VECTOR);
762-
ack_APIC_irq();
762+
apic_eoi();
763763
}
764764

765765
/*

arch/x86/kernel/cpu/mce/threshold.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_threshold)
2727
inc_irq_stat(irq_threshold_count);
2828
mce_threshold_vector();
2929
trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR);
30-
ack_APIC_irq();
30+
apic_eoi();
3131
}

arch/x86/kernel/cpu/mshyperv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_callback)
119119
vmbus_handler();
120120

121121
if (ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED)
122-
ack_APIC_irq();
122+
apic_eoi();
123123

124124
set_irq_regs(old_regs);
125125
}
@@ -147,7 +147,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_stimer0)
147147
if (hv_stimer0_handler)
148148
hv_stimer0_handler();
149149
add_interrupt_randomness(HYPERV_STIMER0_VECTOR);
150-
ack_APIC_irq();
150+
apic_eoi();
151151

152152
set_irq_regs(old_regs);
153153
}

arch/x86/kernel/irq.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void ack_bad_irq(unsigned int irq)
4949
* completely.
5050
* But only ack when the APIC is enabled -AK
5151
*/
52-
ack_APIC_irq();
52+
apic_eoi();
5353
}
5454

5555
#define irq_stats(x) (&per_cpu(irq_stat, x))
@@ -256,7 +256,7 @@ DEFINE_IDTENTRY_IRQ(common_interrupt)
256256
if (likely(!IS_ERR_OR_NULL(desc))) {
257257
handle_irq(desc, regs);
258258
} else {
259-
ack_APIC_irq();
259+
apic_eoi();
260260

261261
if (desc == VECTOR_UNUSED) {
262262
pr_emerg_ratelimited("%s: %d.%u No irq handler for vector\n",
@@ -280,7 +280,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_x86_platform_ipi)
280280
{
281281
struct pt_regs *old_regs = set_irq_regs(regs);
282282

283-
ack_APIC_irq();
283+
apic_eoi();
284284
trace_x86_platform_ipi_entry(X86_PLATFORM_IPI_VECTOR);
285285
inc_irq_stat(x86_platform_ipis);
286286
if (x86_platform_ipi_callback)
@@ -310,7 +310,7 @@ EXPORT_SYMBOL_GPL(kvm_set_posted_intr_wakeup_handler);
310310
*/
311311
DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_ipi)
312312
{
313-
ack_APIC_irq();
313+
apic_eoi();
314314
inc_irq_stat(kvm_posted_intr_ipis);
315315
}
316316

@@ -319,7 +319,7 @@ DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_ipi)
319319
*/
320320
DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_posted_intr_wakeup_ipi)
321321
{
322-
ack_APIC_irq();
322+
apic_eoi();
323323
inc_irq_stat(kvm_posted_intr_wakeup_ipis);
324324
kvm_posted_intr_wakeup_handler();
325325
}
@@ -329,7 +329,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_posted_intr_wakeup_ipi)
329329
*/
330330
DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_nested_ipi)
331331
{
332-
ack_APIC_irq();
332+
apic_eoi();
333333
inc_irq_stat(kvm_posted_intr_nested_ipis);
334334
}
335335
#endif
@@ -401,6 +401,6 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_thermal)
401401
inc_irq_stat(irq_thermal_count);
402402
smp_thermal_vector();
403403
trace_thermal_apic_exit(THERMAL_APIC_VECTOR);
404-
ack_APIC_irq();
404+
apic_eoi();
405405
}
406406
#endif

0 commit comments

Comments
 (0)