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

The two empty stub handlers which only increment the stats counter do no
need to run on the interrupt stack. Use IDTENTRY_SYSVEC_SIMPLE for them.

The wakeup handler does more work and runs on the interrupt stack.

None of these handlers need to save and restore the irq_regs pointer.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20200521202119.555715519@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/kernel/idt.c
arch/x86/kernel/irq.c

index 2301f62d08e6ddde651028ec7bf3bdee9778a9cf..ea1f2930876c4c18550dfd625fb2f48120148124 100644 (file)
@@ -956,13 +956,6 @@ apicinterrupt3 \num \sym \do_sym
 POP_SECTION_IRQENTRY
 .endm
 
-
-#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
-apicinterrupt3 POSTED_INTR_NESTED_VECTOR       kvm_posted_intr_nested_ipi      smp_kvm_posted_intr_nested_ipi
-#endif
-
 #ifdef CONFIG_SMP
 apicinterrupt RESCHEDULE_VECTOR                        reschedule_interrupt            smp_reschedule_interrupt
 #endif
index 69a5320a46735e1692b76f21fbdc9f3590efe8e7..a01bb74244ac17ae7ba1421c65249ea3ce5c262d 100644 (file)
 #ifdef CONFIG_SMP
 BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
 #endif
-
-#ifdef CONFIG_HAVE_KVM
-BUILD_INTERRUPT(kvm_posted_intr_ipi, POSTED_INTR_VECTOR)
-BUILD_INTERRUPT(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR)
-BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR)
-#endif
-
index 7281c7e3a0f6ec0a320474b9443aef24bdc57e96..fd5e7c8825e18e2967229f593e892aa705fe364d 100644 (file)
 #include <asm/sections.h>
 
 /* Interrupt handlers registered during init_IRQ */
-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 reschedule_interrupt(void);
 
 #ifdef CONFIG_X86_LOCAL_APIC
index cd752e6cf5af04a07dce0dc8f6410e8d67d27a39..7f7c80bd272c69cd45ac03a2f3d76dc6825967cb 100644 (file)
@@ -628,6 +628,12 @@ DECLARE_IDTENTRY_SYSVEC(IRQ_WORK_VECTOR,           sysvec_irq_work);
 # endif
 #endif
 
+#ifdef CONFIG_HAVE_KVM
+DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_VECTOR,            sysvec_kvm_posted_intr_ipi);
+DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_WAKEUP_VECTOR,     sysvec_kvm_posted_intr_wakeup_ipi);
+DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_NESTED_VECTOR,     sysvec_kvm_posted_intr_nested_ipi);
+#endif
+
 #undef X86_TRAP_OTHER
 
 #endif
index c7c43e86805a619da2579ea71c5257649c2dd6c4..f73dd3f8b043f4a17ccdac2a76b1ac0d776afd51 100644 (file)
@@ -26,9 +26,6 @@ extern void fixup_irqs(void);
 
 #ifdef CONFIG_HAVE_KVM
 extern void kvm_set_posted_intr_wakeup_handler(void (*handler)(void));
-extern __visible void smp_kvm_posted_intr_ipi(struct pt_regs *regs);
-extern __visible void smp_kvm_posted_intr_wakeup_ipi(struct pt_regs *regs);
-extern __visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs);
 #endif
 
 extern void (*x86_platform_ipi_callback)(void);
index 3d811d058f2eec76baa66b2b6f29276e7142e948..faaadd430882d7bc37c69fcc60b3b7b4c6ddd727 100644 (file)
@@ -135,9 +135,9 @@ static const __initconst struct idt_data apic_idts[] = {
        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),
-       INTG(POSTED_INTR_NESTED_VECTOR,         kvm_posted_intr_nested_ipi),
+       INTG(POSTED_INTR_VECTOR,                asm_sysvec_kvm_posted_intr_ipi),
+       INTG(POSTED_INTR_WAKEUP_VECTOR,         asm_sysvec_kvm_posted_intr_wakeup_ipi),
+       INTG(POSTED_INTR_NESTED_VECTOR,         asm_sysvec_kvm_posted_intr_nested_ipi),
 # endif
 # ifdef CONFIG_IRQ_WORK
        INTG(IRQ_WORK_VECTOR,                   asm_sysvec_irq_work),
index 7e3005274f83271d7e46a1f41c6b05cd60d1b783..181060247e3cb75789d7522b0b0be0d6483c3596 100644 (file)
@@ -298,41 +298,29 @@ EXPORT_SYMBOL_GPL(kvm_set_posted_intr_wakeup_handler);
 /*
  * Handler for POSTED_INTERRUPT_VECTOR.
  */
-__visible void smp_kvm_posted_intr_ipi(struct pt_regs *regs)
+DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_ipi)
 {
-       struct pt_regs *old_regs = set_irq_regs(regs);
-
-       entering_ack_irq();
+       ack_APIC_irq();
        inc_irq_stat(kvm_posted_intr_ipis);
-       exiting_irq();
-       set_irq_regs(old_regs);
 }
 
 /*
  * Handler for POSTED_INTERRUPT_WAKEUP_VECTOR.
  */
-__visible void smp_kvm_posted_intr_wakeup_ipi(struct pt_regs *regs)
+DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_posted_intr_wakeup_ipi)
 {
-       struct pt_regs *old_regs = set_irq_regs(regs);
-
-       entering_ack_irq();
+       ack_APIC_irq();
        inc_irq_stat(kvm_posted_intr_wakeup_ipis);
        kvm_posted_intr_wakeup_handler();
-       exiting_irq();
-       set_irq_regs(old_regs);
 }
 
 /*
  * Handler for POSTED_INTERRUPT_NESTED_VECTOR.
  */
-__visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs)
+DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_nested_ipi)
 {
-       struct pt_regs *old_regs = set_irq_regs(regs);
-
-       entering_ack_irq();
+       ack_APIC_irq();
        inc_irq_stat(kvm_posted_intr_nested_ipis);
-       exiting_irq();
-       set_irq_regs(old_regs);
 }
 #endif