x86/apic: Nuke ack_APIC_irq()
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 15:16:46 +0000 (08:16 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 18:58:34 +0000 (11:58 -0700)
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)
14 files changed:
arch/x86/hyperv/hv_init.c
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/io_apic.c
arch/x86/kernel/apic/vector.c
arch/x86/kernel/cpu/acrn.c
arch/x86/kernel/cpu/mce/amd.c
arch/x86/kernel/cpu/mce/threshold.c
arch/x86/kernel/cpu/mshyperv.c
arch/x86/kernel/irq.c
arch/x86/kernel/irq_work.c
arch/x86/kernel/kvm.c
arch/x86/kernel/smp.c
arch/x86/xen/enlighten_hvm.c

index 6c04b52f139b5e54ec7e3363cdd3eba3cc3a16b8..fc56fc80712b7d8f777e3fa75b49cefa6fdd0a19 100644 (file)
@@ -161,7 +161,7 @@ static inline bool hv_reenlightenment_available(void)
 
 DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_reenlightenment)
 {
-       ack_APIC_irq();
+       apic_eoi();
        inc_irq_stat(irq_hv_reenlightenment_count);
        schedule_delayed_work(&hv_reenlightenment_work, HZ/10);
 }
index 790f15d894159e3492501d28e942d85e041315d7..6ad35741653dcfbacbbbcff6da650063b7afa989 100644 (file)
@@ -402,16 +402,6 @@ static inline void apic_set_eoi_cb(void (*eoi)(void)) {}
 
 extern void apic_ack_irq(struct irq_data *data);
 
-static inline void ack_APIC_irq(void)
-{
-       /*
-        * ack_APIC_irq() actually gets compiled as a single instruction
-        * ... yummie.
-        */
-       apic_eoi();
-}
-
-
 static inline bool lapic_vector_set_in_irr(unsigned int vector)
 {
        u32 irr = apic_read(APIC_IRR + (vector / 32 * 0x10));
index 33d5ed693f5453d2e33e1bd77adcfb21f9c02531..b8b801e1f76fffbeb6ec5181231aa0802b393ac7 100644 (file)
@@ -1076,7 +1076,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_apic_timer_interrupt)
 {
        struct pt_regs *old_regs = set_irq_regs(regs);
 
-       ack_APIC_irq();
+       apic_eoi();
        trace_local_timer_entry(LOCAL_TIMER_VECTOR);
        local_apic_timer_interrupt();
        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)
                 * per set bit.
                 */
                for_each_set_bit(bit, isr->map, APIC_IR_BITS)
-                       ack_APIC_irq();
+                       apic_eoi();
                return true;
        }
 
@@ -1492,7 +1492,7 @@ static bool apic_check_and_ack(union apic_ir *irr, union apic_ir *isr)
  * interrupt from previous kernel might still have ISR bit set.
  *
  * Most probably by now the CPU has serviced that pending interrupt and it
- * might not have done the ack_APIC_irq() because it thought, interrupt
+ * might not have done the apic_eoi() because it thought, interrupt
  * came from i8259 as ExtInt. LAPIC did not get EOI so it does not clear
  * the ISR bit and cpu thinks it has already serviced the interrupt. Hence
  * a vector might get locked. It was noticed for timer irq (vector
@@ -2147,7 +2147,7 @@ static noinline void handle_spurious_interrupt(u8 vector)
        if (v & (1 << (vector & 0x1f))) {
                pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Acked\n",
                        vector, smp_processor_id());
-               ack_APIC_irq();
+               apic_eoi();
        } else {
                pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Not pending!\n",
                        vector, smp_processor_id());
@@ -2198,7 +2198,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt)
        if (lapic_get_maxlvt() > 3)     /* Due to the Pentium erratum 3AP. */
                apic_write(APIC_ESR, 0);
        v = apic_read(APIC_ESR);
-       ack_APIC_irq();
+       apic_eoi();
        atomic_inc(&irq_err_count);
 
        apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x",
index ff2d27e2089ab5fba5e51f9c316cf337a3e1107e..00da6cf6b07dcb5551a0b2c5faeea60d0fb07307 100644 (file)
@@ -1823,7 +1823,7 @@ static void ioapic_ack_level(struct irq_data *irq_data)
         * We must acknowledge the irq before we move it or the acknowledge will
         * not propagate properly.
         */
-       ack_APIC_irq();
+       apic_eoi();
 
        /*
         * 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)
 
 static void ack_lapic_irq(struct irq_data *data)
 {
-       ack_APIC_irq();
+       apic_eoi();
 }
 
 static struct irq_chip lapic_chip __read_mostly = {
index 2ee3f5a20f3da3dd52e22fbc7f15013ffeb37eb7..4a262c61c63117328f78b2d5c79fd479bd856f98 100644 (file)
@@ -907,7 +907,7 @@ static int apic_retrigger_irq(struct irq_data *irqd)
 void apic_ack_irq(struct irq_data *irqd)
 {
        irq_move_irq(irqd);
-       ack_APIC_irq();
+       apic_eoi();
 }
 
 void apic_ack_edge(struct irq_data *irqd)
index 485441b7f03036fba446e0e0fba99f48d1addd2b..bfeb18fad63f154ef8357ef75eec1b941b6b46dd 100644 (file)
@@ -51,7 +51,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_acrn_hv_callback)
         * will block the interrupt whose vector is lower than
         * HYPERVISOR_CALLBACK_VECTOR.
         */
-       ack_APIC_irq();
+       apic_eoi();
        inc_irq_stat(irq_hv_callback_count);
 
        if (acrn_intr_handler)
index c4ec4ca47e11bff60026133c7479b975544a4553..c267f43de39eab1c549857ecc5ba7b58937ad63d 100644 (file)
@@ -759,7 +759,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_deferred_error)
        inc_irq_stat(irq_deferred_error_count);
        deferred_error_int_vector();
        trace_deferred_error_apic_exit(DEFERRED_ERROR_VECTOR);
-       ack_APIC_irq();
+       apic_eoi();
 }
 
 /*
index 6a059a035021d87a1e0dcd342663a365ed7a2ad3..ef4e7bb5fd88c60a6d1d881a31aed389e8d12f18 100644 (file)
@@ -27,5 +27,5 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_threshold)
        inc_irq_stat(irq_threshold_count);
        mce_threshold_vector();
        trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR);
-       ack_APIC_irq();
+       apic_eoi();
 }
index c7969e806c64bcf2229f091bba445c80af2daf8d..0100468e72caac2187099336d86c811b47981901 100644 (file)
@@ -119,7 +119,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_callback)
                vmbus_handler();
 
        if (ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED)
-               ack_APIC_irq();
+               apic_eoi();
 
        set_irq_regs(old_regs);
 }
@@ -147,7 +147,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_stimer0)
        if (hv_stimer0_handler)
                hv_stimer0_handler();
        add_interrupt_randomness(HYPERV_STIMER0_VECTOR);
-       ack_APIC_irq();
+       apic_eoi();
 
        set_irq_regs(old_regs);
 }
index 9f668d2f3d11996d4d378b1d8be130bf2e11aef2..11761c12454533c10159a6456c5a57aac3004777 100644 (file)
@@ -49,7 +49,7 @@ void ack_bad_irq(unsigned int irq)
         * completely.
         * But only ack when the APIC is enabled -AK
         */
-       ack_APIC_irq();
+       apic_eoi();
 }
 
 #define irq_stats(x)           (&per_cpu(irq_stat, x))
@@ -256,7 +256,7 @@ DEFINE_IDTENTRY_IRQ(common_interrupt)
        if (likely(!IS_ERR_OR_NULL(desc))) {
                handle_irq(desc, regs);
        } else {
-               ack_APIC_irq();
+               apic_eoi();
 
                if (desc == VECTOR_UNUSED) {
                        pr_emerg_ratelimited("%s: %d.%u No irq handler for vector\n",
@@ -280,7 +280,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_x86_platform_ipi)
 {
        struct pt_regs *old_regs = set_irq_regs(regs);
 
-       ack_APIC_irq();
+       apic_eoi();
        trace_x86_platform_ipi_entry(X86_PLATFORM_IPI_VECTOR);
        inc_irq_stat(x86_platform_ipis);
        if (x86_platform_ipi_callback)
@@ -310,7 +310,7 @@ EXPORT_SYMBOL_GPL(kvm_set_posted_intr_wakeup_handler);
  */
 DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_ipi)
 {
-       ack_APIC_irq();
+       apic_eoi();
        inc_irq_stat(kvm_posted_intr_ipis);
 }
 
@@ -319,7 +319,7 @@ DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_ipi)
  */
 DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_posted_intr_wakeup_ipi)
 {
-       ack_APIC_irq();
+       apic_eoi();
        inc_irq_stat(kvm_posted_intr_wakeup_ipis);
        kvm_posted_intr_wakeup_handler();
 }
@@ -329,7 +329,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_posted_intr_wakeup_ipi)
  */
 DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_nested_ipi)
 {
-       ack_APIC_irq();
+       apic_eoi();
        inc_irq_stat(kvm_posted_intr_nested_ipis);
 }
 #endif
@@ -401,6 +401,6 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_thermal)
        inc_irq_stat(irq_thermal_count);
        smp_thermal_vector();
        trace_thermal_apic_exit(THERMAL_APIC_VECTOR);
-       ack_APIC_irq();
+       apic_eoi();
 }
 #endif
index 890d4778cd352c69866464001e5ee16f414bf621..ee53419f825e563d60ab13e964b33a9cbd12fdfa 100644 (file)
@@ -16,7 +16,7 @@
 #ifdef CONFIG_X86_LOCAL_APIC
 DEFINE_IDTENTRY_SYSVEC(sysvec_irq_work)
 {
-       ack_APIC_irq();
+       apic_eoi();
        trace_irq_work_entry(IRQ_WORK_VECTOR);
        inc_irq_stat(apic_irq_work_irqs);
        irq_work_run();
index c2e3e7aabb6a6a84bb36dbd228009b99241b3256..f5339e31b440ac2e95bbfe0d5988bfeb2a7aeaea 100644 (file)
@@ -291,7 +291,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_asyncpf_interrupt)
        struct pt_regs *old_regs = set_irq_regs(regs);
        u32 token;
 
-       ack_APIC_irq();
+       apic_eoi();
 
        inc_irq_stat(irq_hv_callback_count);
 
index 7eb18ca7bd45beea76839871edce64a5fba69b2b..6299bf8a4d7fbfc48ce2925f65221fd18c1f3b16 100644 (file)
@@ -135,7 +135,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)
  */
 DEFINE_IDTENTRY_SYSVEC(sysvec_reboot)
 {
-       ack_APIC_irq();
+       apic_eoi();
        cpu_emergency_disable_virtualization();
        stop_this_cpu(NULL);
 }
@@ -268,7 +268,7 @@ done:
  */
 DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_reschedule_ipi)
 {
-       ack_APIC_irq();
+       apic_eoi();
        trace_reschedule_entry(RESCHEDULE_VECTOR);
        inc_irq_stat(irq_resched_count);
        scheduler_ipi();
@@ -277,7 +277,7 @@ DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_reschedule_ipi)
 
 DEFINE_IDTENTRY_SYSVEC(sysvec_call_function)
 {
-       ack_APIC_irq();
+       apic_eoi();
        trace_call_function_entry(CALL_FUNCTION_VECTOR);
        inc_irq_stat(irq_call_count);
        generic_smp_call_function_interrupt();
@@ -286,7 +286,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_call_function)
 
 DEFINE_IDTENTRY_SYSVEC(sysvec_call_function_single)
 {
-       ack_APIC_irq();
+       apic_eoi();
        trace_call_function_single_entry(CALL_FUNCTION_SINGLE_VECTOR);
        inc_irq_stat(irq_call_count);
        generic_smp_call_function_single_interrupt();
index a6820ca940bf072930a604e2cdaee12c74ef9895..9a192f51f1b0216dd4e0f8cb101d49f58326fbeb 100644 (file)
@@ -132,7 +132,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_xen_hvm_callback)
        struct pt_regs *old_regs = set_irq_regs(regs);
 
        if (xen_percpu_upcall)
-               ack_APIC_irq();
+               apic_eoi();
 
        inc_irq_stat(irq_hv_callback_count);