]> git.baikalelectronics.ru Git - kernel.git/commitdiff
x86/entry: Convert APIC interrupts to IDTENTRY_SYSVEC
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 May 2020 20:05:39 +0000 (22:05 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 11 Jun 2020 13:15:13 +0000 (15:15 +0200)
Convert APIC interrupts to IDTENTRY_SYSVEC:

  - Implement the C entry point with DEFINE_IDTENTRY_SYSVEC
  - Emit the ASM stub with DECLARE_IDTENTRY_SYSVEC
  - Remove the ASM idtentries in 64-bit
  - Remove the BUILD_INTERRUPT entries in 32-bit
  - Remove the old prototypes

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20200521202119.280728850@linutronix.de
arch/x86/entry/entry_64.S
arch/x86/include/asm/entry_arch.h
arch/x86/include/asm/hw_irq.h
arch/x86/include/asm/idtentry.h
arch/x86/include/asm/irq.h
arch/x86/include/asm/traps.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/idt.c
arch/x86/kernel/irq.c

index 9b7183dac202c90f6bd7487424f3e0176b5b06be..25f71a0c9d3e44dd30d92e9756af68fc2a9e90d0 100644 (file)
@@ -965,9 +965,6 @@ apicinterrupt3 REBOOT_VECTOR                        reboot_interrupt                smp_reboot_interrupt
 apicinterrupt3 UV_BAU_MESSAGE                  uv_bau_message_intr1            uv_bau_message_interrupt
 #endif
 
-apicinterrupt LOCAL_TIMER_VECTOR               apic_timer_interrupt            smp_apic_timer_interrupt
-apicinterrupt X86_PLATFORM_IPI_VECTOR          x86_platform_ipi                smp_x86_platform_ipi
-
 #ifdef CONFIG_HAVE_KVM
 apicinterrupt3 POSTED_INTR_VECTOR              kvm_posted_intr_ipi             smp_kvm_posted_intr_ipi
 apicinterrupt3 POSTED_INTR_WAKEUP_VECTOR       kvm_posted_intr_wakeup_ipi      smp_kvm_posted_intr_wakeup_ipi
@@ -992,9 +989,6 @@ apicinterrupt CALL_FUNCTION_VECTOR          call_function_interrupt         smp_call_function_i
 apicinterrupt RESCHEDULE_VECTOR                        reschedule_interrupt            smp_reschedule_interrupt
 #endif
 
-apicinterrupt ERROR_APIC_VECTOR                        error_interrupt                 smp_error_interrupt
-apicinterrupt SPURIOUS_APIC_VECTOR             spurious_apic_interrupt         smp_spurious_apic_interrupt
-
 #ifdef CONFIG_IRQ_WORK
 apicinterrupt IRQ_WORK_VECTOR                  irq_work_interrupt              smp_irq_work_interrupt
 #endif
index cd57ce6134c9121de59afd319543512664db9b45..d10d6d807e7362a2a9c82f3d5481d7628225f723 100644 (file)
@@ -33,11 +33,6 @@ BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR)
  */
 #ifdef CONFIG_X86_LOCAL_APIC
 
-BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR)
-BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
-BUILD_INTERRUPT(spurious_apic_interrupt,SPURIOUS_APIC_VECTOR)
-BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
-
 #ifdef CONFIG_IRQ_WORK
 BUILD_INTERRUPT(irq_work_interrupt, IRQ_WORK_VECTOR)
 #endif
index 3213d36b92d3379b8c2f01c1b14e704436319014..1765993360e77ca47e3300ec62c8abd49895d302 100644 (file)
 #include <asm/sections.h>
 
 /* Interrupt handlers registered during init_IRQ */
-extern asmlinkage void apic_timer_interrupt(void);
-extern asmlinkage void x86_platform_ipi(void);
 extern asmlinkage void kvm_posted_intr_ipi(void);
 extern asmlinkage void kvm_posted_intr_wakeup_ipi(void);
 extern asmlinkage void kvm_posted_intr_nested_ipi(void);
-extern asmlinkage void error_interrupt(void);
 extern asmlinkage void irq_work_interrupt(void);
 extern asmlinkage void uv_bau_message_intr1(void);
 
-extern asmlinkage void spurious_apic_interrupt(void);
 extern asmlinkage void thermal_interrupt(void);
 extern asmlinkage void reschedule_interrupt(void);
 
index 63f7b99703cf879d17d5913737a04c487ae6506a..b95f36276c6c537d5dee2bfad54812af1f727853 100644 (file)
@@ -591,6 +591,14 @@ DECLARE_IDTENTRY_IRQ(X86_TRAP_OTHER,       common_interrupt);
 DECLARE_IDTENTRY_IRQ(X86_TRAP_OTHER,   spurious_interrupt);
 #endif
 
+/* System vector entry points */
+#ifdef CONFIG_X86_LOCAL_APIC
+DECLARE_IDTENTRY_SYSVEC(ERROR_APIC_VECTOR,             sysvec_error_interrupt);
+DECLARE_IDTENTRY_SYSVEC(SPURIOUS_APIC_VECTOR,          sysvec_spurious_apic_interrupt);
+DECLARE_IDTENTRY_SYSVEC(LOCAL_TIMER_VECTOR,            sysvec_apic_timer_interrupt);
+DECLARE_IDTENTRY_SYSVEC(X86_PLATFORM_IPI_VECTOR,       sysvec_x86_platform_ipi);
+#endif
+
 #undef X86_TRAP_OTHER
 
 #endif
index 67aa1e2a5b4aeb1fdcc50daae55fe2a9eba3bda0..c7c43e86805a619da2579ea71c5257649c2dd6c4 100644 (file)
@@ -46,7 +46,6 @@ extern void __init init_IRQ(void);
 void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
                                    bool exclude_self);
 
-extern __visible void smp_x86_platform_ipi(struct pt_regs *regs);
 #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
 #endif
 
index 97e6945bfce8e7fb63a667a411357d997092be4f..933934c3e1735185b617625d8ea0d09c3b4cac7e 100644 (file)
@@ -40,9 +40,6 @@ asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
 asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
 #endif
 
-void smp_apic_timer_interrupt(struct pt_regs *regs);
-void smp_error_interrupt(struct pt_regs *regs);
-void smp_spurious_apic_interrupt(struct pt_regs *regs);
 asmlinkage void smp_irq_move_cleanup_interrupt(void);
 
 #ifdef CONFIG_VMAP_STACK
index b7bfd3a1abb763f45f23756f0085a5c78355e767..9244377ed454b2df3e36b286c1ba96abe0974daa 100644 (file)
@@ -1088,23 +1088,14 @@ static void local_apic_timer_interrupt(void)
  * [ if a single-CPU system runs an SMP kernel then we call the local
  *   interrupt as well. Thus we cannot inline the local irq ... ]
  */
-__visible void __irq_entry smp_apic_timer_interrupt(struct pt_regs *regs)
+DEFINE_IDTENTRY_SYSVEC(sysvec_apic_timer_interrupt)
 {
        struct pt_regs *old_regs = set_irq_regs(regs);
 
-       /*
-        * NOTE! We'd better ACK the irq immediately,
-        * because timer handling can be slow.
-        *
-        * update_process_times() expects us to have done irq_enter().
-        * Besides, if we don't timer interrupts ignore the global
-        * interrupt lock, which is the WrongThing (tm) to do.
-        */
-       entering_ack_irq();
+       ack_APIC_irq();
        trace_local_timer_entry(LOCAL_TIMER_VECTOR);
        local_apic_timer_interrupt();
        trace_local_timer_exit(LOCAL_TIMER_VECTOR);
-       exiting_irq();
 
        set_irq_regs(old_regs);
 }
@@ -2129,7 +2120,7 @@ void __init register_lapic_address(unsigned long address)
  * trigger on an entry which is routed to the common_spurious idtentry
  * point.
  *
- * Also called from smp_spurious_apic_interrupt().
+ * Also called from sysvec_spurious_apic_interrupt().
  */
 DEFINE_IDTENTRY_IRQ(spurious_interrupt)
 {
@@ -2166,17 +2157,15 @@ out:
        trace_spurious_apic_exit(vector);
 }
 
-__visible void smp_spurious_apic_interrupt(struct pt_regs *regs)
+DEFINE_IDTENTRY_SYSVEC(sysvec_spurious_apic_interrupt)
 {
-       entering_irq();
        __spurious_interrupt(regs, SPURIOUS_APIC_VECTOR);
-       exiting_irq();
 }
 
 /*
  * This interrupt should never happen with our APIC/SMP architecture
  */
-__visible void __irq_entry smp_error_interrupt(struct pt_regs *regs)
+DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt)
 {
        static const char * const error_interrupt_reason[] = {
                "Send CS error",                /* APIC Error Bit 0 */
@@ -2190,7 +2179,6 @@ __visible void __irq_entry smp_error_interrupt(struct pt_regs *regs)
        };
        u32 v, i = 0;
 
-       entering_irq();
        trace_error_apic_entry(ERROR_APIC_VECTOR);
 
        /* First tickle the hardware, only then report what went on. -- REW */
@@ -2214,7 +2202,6 @@ __visible void __irq_entry smp_error_interrupt(struct pt_regs *regs)
        apic_printk(APIC_DEBUG, KERN_CONT "\n");
 
        trace_error_apic_exit(ERROR_APIC_VECTOR);
-       exiting_irq();
 }
 
 /**
index 20408e31c18de3b11c9c757067751ce2bf8f27b8..93c1b27f40f41f9d0a13132856ae8efa14ac6503 100644 (file)
@@ -132,8 +132,8 @@ static const __initconst struct idt_data apic_idts[] = {
 #endif
 
 #ifdef CONFIG_X86_LOCAL_APIC
-       INTG(LOCAL_TIMER_VECTOR,        apic_timer_interrupt),
-       INTG(X86_PLATFORM_IPI_VECTOR,   x86_platform_ipi),
+       INTG(LOCAL_TIMER_VECTOR,        asm_sysvec_apic_timer_interrupt),
+       INTG(X86_PLATFORM_IPI_VECTOR,   asm_sysvec_x86_platform_ipi),
 # ifdef CONFIG_HAVE_KVM
        INTG(POSTED_INTR_VECTOR,        kvm_posted_intr_ipi),
        INTG(POSTED_INTR_WAKEUP_VECTOR, kvm_posted_intr_wakeup_ipi),
@@ -145,8 +145,8 @@ static const __initconst struct idt_data apic_idts[] = {
 #ifdef CONFIG_X86_UV
        INTG(UV_BAU_MESSAGE,            uv_bau_message_intr1),
 #endif
-       INTG(SPURIOUS_APIC_VECTOR,      spurious_apic_interrupt),
-       INTG(ERROR_APIC_VECTOR,         error_interrupt),
+       INTG(SPURIOUS_APIC_VECTOR,      asm_sysvec_spurious_apic_interrupt),
+       INTG(ERROR_APIC_VECTOR,         asm_sysvec_error_interrupt),
 #endif
 };
 
index c449b84340363011740a6d149dabdb2784bc66a0..7e3005274f83271d7e46a1f41c6b05cd60d1b783 100644 (file)
@@ -268,17 +268,16 @@ void (*x86_platform_ipi_callback)(void) = NULL;
 /*
  * Handler for X86_PLATFORM_IPI_VECTOR.
  */
-__visible void __irq_entry smp_x86_platform_ipi(struct pt_regs *regs)
+DEFINE_IDTENTRY_SYSVEC(sysvec_x86_platform_ipi)
 {
        struct pt_regs *old_regs = set_irq_regs(regs);
 
-       entering_ack_irq();
+       ack_APIC_irq();
        trace_x86_platform_ipi_entry(X86_PLATFORM_IPI_VECTOR);
        inc_irq_stat(x86_platform_ipis);
        if (x86_platform_ipi_callback)
                x86_platform_ipi_callback();
        trace_x86_platform_ipi_exit(X86_PLATFORM_IPI_VECTOR);
-       exiting_irq();
        set_irq_regs(old_regs);
 }
 #endif