]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/i386: De-duplicate gsi_handler() to remove kvm_pc_gsi_handler()
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Fri, 13 Dec 2019 11:07:36 +0000 (12:07 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Dec 2019 18:33:51 +0000 (19:33 +0100)
Both gsi_handler() and kvm_pc_gsi_handler() have the same content,
except one comment. Move the comment, and de-duplicate the code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/kvm/ioapic.c
hw/i386/pc.c
hw/i386/x86.c
include/sysemu/kvm.h

index 8703f19b4332b2698b993ec184e7185146211f90..973e2b2af198dd7fa5d5dcda6df75838294aaa14 100644 (file)
@@ -48,18 +48,6 @@ void kvm_pc_setup_irq_routing(bool pci_enabled)
     }
 }
 
-void kvm_pc_gsi_handler(void *opaque, int n, int level)
-{
-    GSIState *s = opaque;
-
-    if (n < ISA_NUM_IRQS) {
-        /* Kernel will forward to both PIC and IOAPIC */
-        qemu_set_irq(s->i8259_irq[n], level);
-    } else {
-        qemu_set_irq(s->ioapic_irq[n], level);
-    }
-}
-
 typedef struct KVMIOAPICState KVMIOAPICState;
 
 struct KVMIOAPICState {
index dff09e473a755f42439f217673fcb35df17df3c8..ea7320b91b993efa0b697bbc13e13c2b7c91c6a0 100644 (file)
@@ -344,10 +344,8 @@ GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
     s = g_new0(GSIState, 1);
     if (kvm_ioapic_in_kernel()) {
         kvm_pc_setup_irq_routing(pci_enabled);
-        *irqs = qemu_allocate_irqs(kvm_pc_gsi_handler, s, GSI_NUM_PINS);
-    } else {
-        *irqs = qemu_allocate_irqs(gsi_handler, s, GSI_NUM_PINS);
     }
+    *irqs = qemu_allocate_irqs(gsi_handler, s, GSI_NUM_PINS);
 
     return s;
 }
index 80e33be1a2a1ab790a8248f842e4d3a3b66d78c1..d18a3ef03d9dd2545408c458a46b44abbdcfa590 100644 (file)
@@ -295,6 +295,7 @@ void gsi_handler(void *opaque, int n, int level)
 
     trace_x86_gsi_interrupt(n, level);
     if (n < ISA_NUM_IRQS) {
+        /* Under KVM, Kernel will forward to both PIC and IOAPIC */
         qemu_set_irq(s->i8259_irq[n], level);
     }
     qemu_set_irq(s->ioapic_irq[n], level);
index aaf2a502e8f9dde0b679841cd3b83183dd962af3..141342de982b3a2e49df34b99d8cd512de69c895 100644 (file)
@@ -515,7 +515,6 @@ int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n,
 int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n,
                                       qemu_irq irq);
 void kvm_irqchip_set_qemuirq_gsi(KVMState *s, qemu_irq irq, int gsi);
-void kvm_pc_gsi_handler(void *opaque, int n, int level);
 void kvm_pc_setup_irq_routing(bool pci_enabled);
 void kvm_init_irq_routing(KVMState *s);