Commit 720909a7 authored by Thomas Gleixner's avatar Thomas Gleixner

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: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20200521202119.464812973@linutronix.de
parent 582f9191
...@@ -956,9 +956,6 @@ apicinterrupt3 \num \sym \do_sym ...@@ -956,9 +956,6 @@ apicinterrupt3 \num \sym \do_sym
POP_SECTION_IRQENTRY POP_SECTION_IRQENTRY
.endm .endm
#ifdef CONFIG_X86_UV
apicinterrupt3 UV_BAU_MESSAGE uv_bau_message_intr1 uv_bau_message_interrupt
#endif
#ifdef CONFIG_HAVE_KVM #ifdef CONFIG_HAVE_KVM
apicinterrupt3 POSTED_INTR_VECTOR kvm_posted_intr_ipi smp_kvm_posted_intr_ipi apicinterrupt3 POSTED_INTR_VECTOR kvm_posted_intr_ipi smp_kvm_posted_intr_ipi
...@@ -966,26 +963,10 @@ apicinterrupt3 POSTED_INTR_WAKEUP_VECTOR kvm_posted_intr_wakeup_ipi smp_kvm_post ...@@ -966,26 +963,10 @@ apicinterrupt3 POSTED_INTR_WAKEUP_VECTOR kvm_posted_intr_wakeup_ipi smp_kvm_post
apicinterrupt3 POSTED_INTR_NESTED_VECTOR kvm_posted_intr_nested_ipi smp_kvm_posted_intr_nested_ipi apicinterrupt3 POSTED_INTR_NESTED_VECTOR kvm_posted_intr_nested_ipi smp_kvm_posted_intr_nested_ipi
#endif #endif
#ifdef CONFIG_X86_MCE_THRESHOLD
apicinterrupt THRESHOLD_APIC_VECTOR threshold_interrupt smp_threshold_interrupt
#endif
#ifdef CONFIG_X86_MCE_AMD
apicinterrupt DEFERRED_ERROR_VECTOR deferred_error_interrupt smp_deferred_error_interrupt
#endif
#ifdef CONFIG_X86_THERMAL_VECTOR
apicinterrupt THERMAL_APIC_VECTOR thermal_interrupt smp_thermal_interrupt
#endif
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
apicinterrupt RESCHEDULE_VECTOR reschedule_interrupt smp_reschedule_interrupt apicinterrupt RESCHEDULE_VECTOR reschedule_interrupt smp_reschedule_interrupt
#endif #endif
#ifdef CONFIG_IRQ_WORK
apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
#endif
/* /*
* Reload gs selector with exception handling * Reload gs selector with exception handling
* edi: new selector * edi: new selector
......
...@@ -534,24 +534,11 @@ static inline void entering_ack_irq(void) ...@@ -534,24 +534,11 @@ static inline void entering_ack_irq(void)
ack_APIC_irq(); ack_APIC_irq();
} }
static inline void ipi_entering_ack_irq(void)
{
irq_enter();
ack_APIC_irq();
kvm_set_cpu_l1tf_flush_l1d();
}
static inline void exiting_irq(void) static inline void exiting_irq(void)
{ {
irq_exit(); irq_exit();
} }
static inline void exiting_ack_irq(void)
{
ack_APIC_irq();
irq_exit();
}
extern void ioapic_zap_locks(void); extern void ioapic_zap_locks(void);
#endif /* _ASM_X86_APIC_H */ #endif /* _ASM_X86_APIC_H */
...@@ -20,28 +20,3 @@ BUILD_INTERRUPT(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR) ...@@ -20,28 +20,3 @@ BUILD_INTERRUPT(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR)
BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR) BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR)
#endif #endif
/*
* every pentium local APIC has two 'local interrupts', with a
* soft-definable vector attached to both interrupts, one of
* which is a timer interrupt, the other one is error counter
* overflow. Linux uses the local APIC timer interrupt to get
* a much simpler SMP time architecture:
*/
#ifdef CONFIG_X86_LOCAL_APIC
#ifdef CONFIG_IRQ_WORK
BUILD_INTERRUPT(irq_work_interrupt, IRQ_WORK_VECTOR)
#endif
#ifdef CONFIG_X86_THERMAL_VECTOR
BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
#endif
#ifdef CONFIG_X86_MCE_THRESHOLD
BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR)
#endif
#ifdef CONFIG_X86_MCE_AMD
BUILD_INTERRUPT(deferred_error_interrupt, DEFERRED_ERROR_VECTOR)
#endif
#endif
...@@ -32,15 +32,9 @@ ...@@ -32,15 +32,9 @@
extern asmlinkage void kvm_posted_intr_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_wakeup_ipi(void);
extern asmlinkage void kvm_posted_intr_nested_ipi(void); extern asmlinkage void kvm_posted_intr_nested_ipi(void);
extern asmlinkage void irq_work_interrupt(void);
extern asmlinkage void uv_bau_message_intr1(void);
extern asmlinkage void thermal_interrupt(void);
extern asmlinkage void reschedule_interrupt(void); extern asmlinkage void reschedule_interrupt(void);
extern asmlinkage void threshold_interrupt(void);
extern asmlinkage void deferred_error_interrupt(void);
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
struct irq_data; struct irq_data;
struct pci_dev; struct pci_dev;
......
...@@ -606,6 +606,28 @@ DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_SINGLE_VECTOR, sysvec_call_function_single ...@@ -606,6 +606,28 @@ DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_SINGLE_VECTOR, sysvec_call_function_single
DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_VECTOR, sysvec_call_function); DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_VECTOR, sysvec_call_function);
#endif #endif
#ifdef CONFIG_X86_LOCAL_APIC
# ifdef CONFIG_X86_UV
DECLARE_IDTENTRY_SYSVEC(UV_BAU_MESSAGE, sysvec_uv_bau_message);
# endif
# ifdef CONFIG_X86_MCE_THRESHOLD
DECLARE_IDTENTRY_SYSVEC(THRESHOLD_APIC_VECTOR, sysvec_threshold);
# endif
# ifdef CONFIG_X86_MCE_AMD
DECLARE_IDTENTRY_SYSVEC(DEFERRED_ERROR_VECTOR, sysvec_deferred_error);
# endif
# ifdef CONFIG_X86_THERMAL_VECTOR
DECLARE_IDTENTRY_SYSVEC(THERMAL_APIC_VECTOR, sysvec_thermal);
# endif
# ifdef CONFIG_IRQ_WORK
DECLARE_IDTENTRY_SYSVEC(IRQ_WORK_VECTOR, sysvec_irq_work);
# endif
#endif
#undef X86_TRAP_OTHER #undef X86_TRAP_OTHER
#endif #endif
...@@ -10,7 +10,6 @@ static inline bool arch_irq_work_has_interrupt(void) ...@@ -10,7 +10,6 @@ static inline bool arch_irq_work_has_interrupt(void)
return boot_cpu_has(X86_FEATURE_APIC); return boot_cpu_has(X86_FEATURE_APIC);
} }
extern void arch_irq_work_raise(void); extern void arch_irq_work_raise(void);
extern __visible void smp_irq_work_interrupt(struct pt_regs *regs);
#else #else
static inline bool arch_irq_work_has_interrupt(void) static inline bool arch_irq_work_has_interrupt(void)
{ {
......
...@@ -34,11 +34,6 @@ static inline int get_si_code(unsigned long condition) ...@@ -34,11 +34,6 @@ static inline int get_si_code(unsigned long condition)
extern int panic_on_unrecovered_nmi; extern int panic_on_unrecovered_nmi;
void math_emulate(struct math_emu_info *); void math_emulate(struct math_emu_info *);
#ifndef CONFIG_X86_32
asmlinkage void smp_thermal_interrupt(struct pt_regs *regs);
asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
#endif
#ifdef CONFIG_VMAP_STACK #ifdef CONFIG_VMAP_STACK
void __noreturn handle_stack_overflow(const char *message, void __noreturn handle_stack_overflow(const char *message,
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#define _ASM_X86_UV_UV_BAU_H #define _ASM_X86_UV_UV_BAU_H
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <asm/idtentry.h>
#define BITSPERBYTE 8 #define BITSPERBYTE 8
/* /*
...@@ -799,12 +801,6 @@ static inline void bau_cpubits_clear(struct bau_local_cpumask *dstp, int nbits) ...@@ -799,12 +801,6 @@ static inline void bau_cpubits_clear(struct bau_local_cpumask *dstp, int nbits)
bitmap_zero(&dstp->bits, nbits); bitmap_zero(&dstp->bits, nbits);
} }
extern void uv_bau_message_intr1(void);
#ifdef CONFIG_TRACING
#define trace_uv_bau_message_intr1 uv_bau_message_intr1
#endif
extern void uv_bau_timeout_intr1(void);
struct atomic_short { struct atomic_short {
short counter; short counter;
}; };
......
...@@ -907,14 +907,13 @@ static void __log_error(unsigned int bank, u64 status, u64 addr, u64 misc) ...@@ -907,14 +907,13 @@ static void __log_error(unsigned int bank, u64 status, u64 addr, u64 misc)
mce_log(&m); mce_log(&m);
} }
asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(struct pt_regs *regs) DEFINE_IDTENTRY_SYSVEC(sysvec_deferred_error)
{ {
entering_irq();
trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR); trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR);
inc_irq_stat(irq_deferred_error_count); inc_irq_stat(irq_deferred_error_count);
deferred_error_int_vector(); deferred_error_int_vector();
trace_deferred_error_apic_exit(DEFERRED_ERROR_VECTOR); trace_deferred_error_apic_exit(DEFERRED_ERROR_VECTOR);
exiting_ack_irq(); ack_APIC_irq();
} }
/* /*
......
...@@ -614,14 +614,13 @@ static void unexpected_thermal_interrupt(void) ...@@ -614,14 +614,13 @@ static void unexpected_thermal_interrupt(void)
static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt; static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt;
asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *regs) DEFINE_IDTENTRY_SYSVEC(sysvec_thermal)
{ {
entering_irq();
trace_thermal_apic_entry(THERMAL_APIC_VECTOR); trace_thermal_apic_entry(THERMAL_APIC_VECTOR);
inc_irq_stat(irq_thermal_count); inc_irq_stat(irq_thermal_count);
smp_thermal_vector(); smp_thermal_vector();
trace_thermal_apic_exit(THERMAL_APIC_VECTOR); trace_thermal_apic_exit(THERMAL_APIC_VECTOR);
exiting_ack_irq(); ack_APIC_irq();
} }
/* Thermal monitoring depends on APIC, ACPI and clock modulation */ /* Thermal monitoring depends on APIC, ACPI and clock modulation */
......
...@@ -21,12 +21,11 @@ static void default_threshold_interrupt(void) ...@@ -21,12 +21,11 @@ static void default_threshold_interrupt(void)
void (*mce_threshold_vector)(void) = default_threshold_interrupt; void (*mce_threshold_vector)(void) = default_threshold_interrupt;
asmlinkage __visible void __irq_entry smp_threshold_interrupt(struct pt_regs *regs) DEFINE_IDTENTRY_SYSVEC(sysvec_threshold)
{ {
entering_irq();
trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR);
inc_irq_stat(irq_threshold_count); inc_irq_stat(irq_threshold_count);
mce_threshold_vector(); mce_threshold_vector();
trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR); trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR);
exiting_ack_irq(); ack_APIC_irq();
} }
...@@ -120,33 +120,33 @@ static const __initconst struct idt_data apic_idts[] = { ...@@ -120,33 +120,33 @@ static const __initconst struct idt_data apic_idts[] = {
#endif #endif
#ifdef CONFIG_X86_THERMAL_VECTOR #ifdef CONFIG_X86_THERMAL_VECTOR
INTG(THERMAL_APIC_VECTOR, thermal_interrupt), INTG(THERMAL_APIC_VECTOR, asm_sysvec_thermal),
#endif #endif
#ifdef CONFIG_X86_MCE_THRESHOLD #ifdef CONFIG_X86_MCE_THRESHOLD
INTG(THRESHOLD_APIC_VECTOR, threshold_interrupt), INTG(THRESHOLD_APIC_VECTOR, asm_sysvec_threshold),
#endif #endif
#ifdef CONFIG_X86_MCE_AMD #ifdef CONFIG_X86_MCE_AMD
INTG(DEFERRED_ERROR_VECTOR, deferred_error_interrupt), INTG(DEFERRED_ERROR_VECTOR, asm_sysvec_deferred_error),
#endif #endif
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
INTG(LOCAL_TIMER_VECTOR, asm_sysvec_apic_timer_interrupt), INTG(LOCAL_TIMER_VECTOR, asm_sysvec_apic_timer_interrupt),
INTG(X86_PLATFORM_IPI_VECTOR, asm_sysvec_x86_platform_ipi), INTG(X86_PLATFORM_IPI_VECTOR, asm_sysvec_x86_platform_ipi),
# ifdef CONFIG_HAVE_KVM # ifdef CONFIG_HAVE_KVM
INTG(POSTED_INTR_VECTOR, kvm_posted_intr_ipi), INTG(POSTED_INTR_VECTOR, kvm_posted_intr_ipi),
INTG(POSTED_INTR_WAKEUP_VECTOR, kvm_posted_intr_wakeup_ipi), INTG(POSTED_INTR_WAKEUP_VECTOR, kvm_posted_intr_wakeup_ipi),
INTG(POSTED_INTR_NESTED_VECTOR, kvm_posted_intr_nested_ipi), INTG(POSTED_INTR_NESTED_VECTOR, kvm_posted_intr_nested_ipi),
# endif # endif
# ifdef CONFIG_IRQ_WORK # ifdef CONFIG_IRQ_WORK
INTG(IRQ_WORK_VECTOR, irq_work_interrupt), INTG(IRQ_WORK_VECTOR, asm_sysvec_irq_work),
# endif # endif
#ifdef CONFIG_X86_UV # ifdef CONFIG_X86_UV
INTG(UV_BAU_MESSAGE, uv_bau_message_intr1), INTG(UV_BAU_MESSAGE, asm_sysvec_uv_bau_message),
#endif # endif
INTG(SPURIOUS_APIC_VECTOR, asm_sysvec_spurious_apic_interrupt), INTG(SPURIOUS_APIC_VECTOR, asm_sysvec_spurious_apic_interrupt),
INTG(ERROR_APIC_VECTOR, asm_sysvec_error_interrupt), INTG(ERROR_APIC_VECTOR, asm_sysvec_error_interrupt),
#endif #endif
}; };
......
...@@ -9,18 +9,18 @@ ...@@ -9,18 +9,18 @@
#include <linux/irq_work.h> #include <linux/irq_work.h>
#include <linux/hardirq.h> #include <linux/hardirq.h>
#include <asm/apic.h> #include <asm/apic.h>
#include <asm/idtentry.h>
#include <asm/trace/irq_vectors.h> #include <asm/trace/irq_vectors.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
__visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs) DEFINE_IDTENTRY_SYSVEC(sysvec_irq_work)
{ {
ipi_entering_ack_irq(); ack_APIC_irq();
trace_irq_work_entry(IRQ_WORK_VECTOR); trace_irq_work_entry(IRQ_WORK_VECTOR);
inc_irq_stat(apic_irq_work_irqs); inc_irq_stat(apic_irq_work_irqs);
irq_work_run(); irq_work_run();
trace_irq_work_exit(IRQ_WORK_VECTOR); trace_irq_work_exit(IRQ_WORK_VECTOR);
exiting_irq();
} }
void arch_irq_work_raise(void) void arch_irq_work_raise(void)
......
...@@ -1272,7 +1272,7 @@ static void process_uv2_message(struct msg_desc *mdp, struct bau_control *bcp) ...@@ -1272,7 +1272,7 @@ static void process_uv2_message(struct msg_desc *mdp, struct bau_control *bcp)
* (the resource will not be freed until noninterruptable cpus see this * (the resource will not be freed until noninterruptable cpus see this
* interrupt; hardware may timeout the s/w ack and reply ERROR) * interrupt; hardware may timeout the s/w ack and reply ERROR)
*/ */
void uv_bau_message_interrupt(struct pt_regs *regs) DEFINE_IDTENTRY_SYSVEC(sysvec_uv_bau_message)
{ {
int count = 0; int count = 0;
cycles_t time_start; cycles_t time_start;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment