Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/entry: Convert various system vectors

Convert various system vectors 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.464812973@linutronix.de


+48 -102
-19
arch/x86/entry/entry_64.S
··· 956 956 POP_SECTION_IRQENTRY 957 957 .endm 958 958 959 - #ifdef CONFIG_X86_UV 960 - apicinterrupt3 UV_BAU_MESSAGE uv_bau_message_intr1 uv_bau_message_interrupt 961 - #endif 962 959 963 960 #ifdef CONFIG_HAVE_KVM 964 961 apicinterrupt3 POSTED_INTR_VECTOR kvm_posted_intr_ipi smp_kvm_posted_intr_ipi ··· 963 966 apicinterrupt3 POSTED_INTR_NESTED_VECTOR kvm_posted_intr_nested_ipi smp_kvm_posted_intr_nested_ipi 964 967 #endif 965 968 966 - #ifdef CONFIG_X86_MCE_THRESHOLD 967 - apicinterrupt THRESHOLD_APIC_VECTOR threshold_interrupt smp_threshold_interrupt 968 - #endif 969 - 970 - #ifdef CONFIG_X86_MCE_AMD 971 - apicinterrupt DEFERRED_ERROR_VECTOR deferred_error_interrupt smp_deferred_error_interrupt 972 - #endif 973 - 974 - #ifdef CONFIG_X86_THERMAL_VECTOR 975 - apicinterrupt THERMAL_APIC_VECTOR thermal_interrupt smp_thermal_interrupt 976 - #endif 977 - 978 969 #ifdef CONFIG_SMP 979 970 apicinterrupt RESCHEDULE_VECTOR reschedule_interrupt smp_reschedule_interrupt 980 - #endif 981 - 982 - #ifdef CONFIG_IRQ_WORK 983 - apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt 984 971 #endif 985 972 986 973 /*
-13
arch/x86/include/asm/apic.h
··· 534 534 ack_APIC_irq(); 535 535 } 536 536 537 - static inline void ipi_entering_ack_irq(void) 538 - { 539 - irq_enter(); 540 - ack_APIC_irq(); 541 - kvm_set_cpu_l1tf_flush_l1d(); 542 - } 543 - 544 537 static inline void exiting_irq(void) 545 538 { 546 - irq_exit(); 547 - } 548 - 549 - static inline void exiting_ack_irq(void) 550 - { 551 - ack_APIC_irq(); 552 539 irq_exit(); 553 540 } 554 541
-25
arch/x86/include/asm/entry_arch.h
··· 20 20 BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR) 21 21 #endif 22 22 23 - /* 24 - * every pentium local APIC has two 'local interrupts', with a 25 - * soft-definable vector attached to both interrupts, one of 26 - * which is a timer interrupt, the other one is error counter 27 - * overflow. Linux uses the local APIC timer interrupt to get 28 - * a much simpler SMP time architecture: 29 - */ 30 - #ifdef CONFIG_X86_LOCAL_APIC 31 - 32 - #ifdef CONFIG_IRQ_WORK 33 - BUILD_INTERRUPT(irq_work_interrupt, IRQ_WORK_VECTOR) 34 - #endif 35 - 36 - #ifdef CONFIG_X86_THERMAL_VECTOR 37 - BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR) 38 - #endif 39 - 40 - #ifdef CONFIG_X86_MCE_THRESHOLD 41 - BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR) 42 - #endif 43 - 44 - #ifdef CONFIG_X86_MCE_AMD 45 - BUILD_INTERRUPT(deferred_error_interrupt, DEFERRED_ERROR_VECTOR) 46 - #endif 47 - #endif
-6
arch/x86/include/asm/hw_irq.h
··· 32 32 extern asmlinkage void kvm_posted_intr_ipi(void); 33 33 extern asmlinkage void kvm_posted_intr_wakeup_ipi(void); 34 34 extern asmlinkage void kvm_posted_intr_nested_ipi(void); 35 - extern asmlinkage void irq_work_interrupt(void); 36 - extern asmlinkage void uv_bau_message_intr1(void); 37 35 38 - extern asmlinkage void thermal_interrupt(void); 39 36 extern asmlinkage void reschedule_interrupt(void); 40 - 41 - extern asmlinkage void threshold_interrupt(void); 42 - extern asmlinkage void deferred_error_interrupt(void); 43 37 44 38 #ifdef CONFIG_X86_LOCAL_APIC 45 39 struct irq_data;
+22
arch/x86/include/asm/idtentry.h
··· 606 606 DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_VECTOR, sysvec_call_function); 607 607 #endif 608 608 609 + #ifdef CONFIG_X86_LOCAL_APIC 610 + # ifdef CONFIG_X86_UV 611 + DECLARE_IDTENTRY_SYSVEC(UV_BAU_MESSAGE, sysvec_uv_bau_message); 612 + # endif 613 + 614 + # ifdef CONFIG_X86_MCE_THRESHOLD 615 + DECLARE_IDTENTRY_SYSVEC(THRESHOLD_APIC_VECTOR, sysvec_threshold); 616 + # endif 617 + 618 + # ifdef CONFIG_X86_MCE_AMD 619 + DECLARE_IDTENTRY_SYSVEC(DEFERRED_ERROR_VECTOR, sysvec_deferred_error); 620 + # endif 621 + 622 + # ifdef CONFIG_X86_THERMAL_VECTOR 623 + DECLARE_IDTENTRY_SYSVEC(THERMAL_APIC_VECTOR, sysvec_thermal); 624 + # endif 625 + 626 + # ifdef CONFIG_IRQ_WORK 627 + DECLARE_IDTENTRY_SYSVEC(IRQ_WORK_VECTOR, sysvec_irq_work); 628 + # endif 629 + #endif 630 + 609 631 #undef X86_TRAP_OTHER 610 632 611 633 #endif
-1
arch/x86/include/asm/irq_work.h
··· 10 10 return boot_cpu_has(X86_FEATURE_APIC); 11 11 } 12 12 extern void arch_irq_work_raise(void); 13 - extern __visible void smp_irq_work_interrupt(struct pt_regs *regs); 14 13 #else 15 14 static inline bool arch_irq_work_has_interrupt(void) 16 15 {
-5
arch/x86/include/asm/traps.h
··· 34 34 extern int panic_on_unrecovered_nmi; 35 35 36 36 void math_emulate(struct math_emu_info *); 37 - #ifndef CONFIG_X86_32 38 - asmlinkage void smp_thermal_interrupt(struct pt_regs *regs); 39 - asmlinkage void smp_threshold_interrupt(struct pt_regs *regs); 40 - asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs); 41 - #endif 42 37 43 38 #ifdef CONFIG_VMAP_STACK 44 39 void __noreturn handle_stack_overflow(const char *message,
+2 -6
arch/x86/include/asm/uv/uv_bau.h
··· 12 12 #define _ASM_X86_UV_UV_BAU_H 13 13 14 14 #include <linux/bitmap.h> 15 + #include <asm/idtentry.h> 16 + 15 17 #define BITSPERBYTE 8 16 18 17 19 /* ··· 800 798 { 801 799 bitmap_zero(&dstp->bits, nbits); 802 800 } 803 - 804 - extern void uv_bau_message_intr1(void); 805 - #ifdef CONFIG_TRACING 806 - #define trace_uv_bau_message_intr1 uv_bau_message_intr1 807 - #endif 808 - extern void uv_bau_timeout_intr1(void); 809 801 810 802 struct atomic_short { 811 803 short counter;
+2 -3
arch/x86/kernel/cpu/mce/amd.c
··· 907 907 mce_log(&m); 908 908 } 909 909 910 - asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(struct pt_regs *regs) 910 + DEFINE_IDTENTRY_SYSVEC(sysvec_deferred_error) 911 911 { 912 - entering_irq(); 913 912 trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR); 914 913 inc_irq_stat(irq_deferred_error_count); 915 914 deferred_error_int_vector(); 916 915 trace_deferred_error_apic_exit(DEFERRED_ERROR_VECTOR); 917 - exiting_ack_irq(); 916 + ack_APIC_irq(); 918 917 } 919 918 920 919 /*
+2 -3
arch/x86/kernel/cpu/mce/therm_throt.c
··· 614 614 615 615 static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt; 616 616 617 - asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *regs) 617 + DEFINE_IDTENTRY_SYSVEC(sysvec_thermal) 618 618 { 619 - entering_irq(); 620 619 trace_thermal_apic_entry(THERMAL_APIC_VECTOR); 621 620 inc_irq_stat(irq_thermal_count); 622 621 smp_thermal_vector(); 623 622 trace_thermal_apic_exit(THERMAL_APIC_VECTOR); 624 - exiting_ack_irq(); 623 + ack_APIC_irq(); 625 624 } 626 625 627 626 /* Thermal monitoring depends on APIC, ACPI and clock modulation */
+2 -3
arch/x86/kernel/cpu/mce/threshold.c
··· 21 21 22 22 void (*mce_threshold_vector)(void) = default_threshold_interrupt; 23 23 24 - asmlinkage __visible void __irq_entry smp_threshold_interrupt(struct pt_regs *regs) 24 + DEFINE_IDTENTRY_SYSVEC(sysvec_threshold) 25 25 { 26 - entering_irq(); 27 26 trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); 28 27 inc_irq_stat(irq_threshold_count); 29 28 mce_threshold_vector(); 30 29 trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR); 31 - exiting_ack_irq(); 30 + ack_APIC_irq(); 32 31 }
+14 -14
arch/x86/kernel/idt.c
··· 120 120 #endif 121 121 122 122 #ifdef CONFIG_X86_THERMAL_VECTOR 123 - INTG(THERMAL_APIC_VECTOR, thermal_interrupt), 123 + INTG(THERMAL_APIC_VECTOR, asm_sysvec_thermal), 124 124 #endif 125 125 126 126 #ifdef CONFIG_X86_MCE_THRESHOLD 127 - INTG(THRESHOLD_APIC_VECTOR, threshold_interrupt), 127 + INTG(THRESHOLD_APIC_VECTOR, asm_sysvec_threshold), 128 128 #endif 129 129 130 130 #ifdef CONFIG_X86_MCE_AMD 131 - INTG(DEFERRED_ERROR_VECTOR, deferred_error_interrupt), 131 + INTG(DEFERRED_ERROR_VECTOR, asm_sysvec_deferred_error), 132 132 #endif 133 133 134 134 #ifdef CONFIG_X86_LOCAL_APIC 135 - INTG(LOCAL_TIMER_VECTOR, asm_sysvec_apic_timer_interrupt), 136 - INTG(X86_PLATFORM_IPI_VECTOR, asm_sysvec_x86_platform_ipi), 135 + INTG(LOCAL_TIMER_VECTOR, asm_sysvec_apic_timer_interrupt), 136 + INTG(X86_PLATFORM_IPI_VECTOR, asm_sysvec_x86_platform_ipi), 137 137 # ifdef CONFIG_HAVE_KVM 138 - INTG(POSTED_INTR_VECTOR, kvm_posted_intr_ipi), 139 - INTG(POSTED_INTR_WAKEUP_VECTOR, kvm_posted_intr_wakeup_ipi), 140 - INTG(POSTED_INTR_NESTED_VECTOR, kvm_posted_intr_nested_ipi), 138 + INTG(POSTED_INTR_VECTOR, kvm_posted_intr_ipi), 139 + INTG(POSTED_INTR_WAKEUP_VECTOR, kvm_posted_intr_wakeup_ipi), 140 + INTG(POSTED_INTR_NESTED_VECTOR, kvm_posted_intr_nested_ipi), 141 141 # endif 142 142 # ifdef CONFIG_IRQ_WORK 143 - INTG(IRQ_WORK_VECTOR, irq_work_interrupt), 143 + INTG(IRQ_WORK_VECTOR, asm_sysvec_irq_work), 144 144 # endif 145 - #ifdef CONFIG_X86_UV 146 - INTG(UV_BAU_MESSAGE, uv_bau_message_intr1), 147 - #endif 148 - INTG(SPURIOUS_APIC_VECTOR, asm_sysvec_spurious_apic_interrupt), 149 - INTG(ERROR_APIC_VECTOR, asm_sysvec_error_interrupt), 145 + # ifdef CONFIG_X86_UV 146 + INTG(UV_BAU_MESSAGE, asm_sysvec_uv_bau_message), 147 + # endif 148 + INTG(SPURIOUS_APIC_VECTOR, asm_sysvec_spurious_apic_interrupt), 149 + INTG(ERROR_APIC_VECTOR, asm_sysvec_error_interrupt), 150 150 #endif 151 151 }; 152 152
+3 -3
arch/x86/kernel/irq_work.c
··· 9 9 #include <linux/irq_work.h> 10 10 #include <linux/hardirq.h> 11 11 #include <asm/apic.h> 12 + #include <asm/idtentry.h> 12 13 #include <asm/trace/irq_vectors.h> 13 14 #include <linux/interrupt.h> 14 15 15 16 #ifdef CONFIG_X86_LOCAL_APIC 16 - __visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs) 17 + DEFINE_IDTENTRY_SYSVEC(sysvec_irq_work) 17 18 { 18 - ipi_entering_ack_irq(); 19 + ack_APIC_irq(); 19 20 trace_irq_work_entry(IRQ_WORK_VECTOR); 20 21 inc_irq_stat(apic_irq_work_irqs); 21 22 irq_work_run(); 22 23 trace_irq_work_exit(IRQ_WORK_VECTOR); 23 - exiting_irq(); 24 24 } 25 25 26 26 void arch_irq_work_raise(void)
+1 -1
arch/x86/platform/uv/tlb_uv.c
··· 1272 1272 * (the resource will not be freed until noninterruptable cpus see this 1273 1273 * interrupt; hardware may timeout the s/w ack and reply ERROR) 1274 1274 */ 1275 - void uv_bau_message_interrupt(struct pt_regs *regs) 1275 + DEFINE_IDTENTRY_SYSVEC(sysvec_uv_bau_message) 1276 1276 { 1277 1277 int count = 0; 1278 1278 cycles_t time_start;