[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 53/87] hw/i386: De-duplicate gsi_handler() to remove kvm_pc_gsi_ha
From: |
Paolo Bonzini |
Subject: |
[PULL 53/87] hw/i386: De-duplicate gsi_handler() to remove kvm_pc_gsi_handler() |
Date: |
Wed, 18 Dec 2019 13:02:19 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
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é <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/kvm/ioapic.c | 12 ------------
hw/i386/pc.c | 4 +---
hw/i386/x86.c | 1 +
include/sysemu/kvm.h | 1 -
4 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index 8703f19..973e2b2 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -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 {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index dff09e4..ea7320b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -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;
}
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 80e33be..d18a3ef 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -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);
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index aaf2a50..141342d 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -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);
--
1.8.3.1
- [PULL 44/87] i386: conditionally compile more files, (continued)
- [PULL 44/87] i386: conditionally compile more files, Paolo Bonzini, 2019/12/18
- [PULL 42/87] configure: set $PYTHON to a full path, Paolo Bonzini, 2019/12/18
- [PULL 45/87] fw_cfg: allow building without other devices, Paolo Bonzini, 2019/12/18
- [PULL 47/87] pci-stub: add more MSI functions, Paolo Bonzini, 2019/12/18
- [PULL 48/87] x86: move SMM property to X86MachineState, Paolo Bonzini, 2019/12/18
- [PULL 46/87] hw: replace hw/i386/pc.h with a header just for the i8259, Paolo Bonzini, 2019/12/18
- [PULL 49/87] hw/i386/pc: Convert DPRINTF() to trace events, Paolo Bonzini, 2019/12/18
- [PULL 50/87] x86: move more x86-generic functions out of PC files, Paolo Bonzini, 2019/12/18
- [PULL 51/87] acpi: move PC stubs out of stubs/, Paolo Bonzini, 2019/12/18
- [PULL 52/87] pc: stubify x86 iommu, Paolo Bonzini, 2019/12/18
- [PULL 53/87] hw/i386: De-duplicate gsi_handler() to remove kvm_pc_gsi_handler(),
Paolo Bonzini <=
- [PULL 55/87] hw/isa/isa-bus: cleanup irq functions, Paolo Bonzini, 2019/12/18
- [PULL 54/87] hw/i386: Simplify ioapic_init_gsi(), Paolo Bonzini, 2019/12/18
- [PULL 57/87] hw/i386/pc: Inline port92_init(), Paolo Bonzini, 2019/12/18
- [PULL 56/87] hw/i386/pc: Use TYPE_PORT92 instead of hardcoded string, Paolo Bonzini, 2019/12/18
- [PULL 58/87] hw/i386/pc: Extract the port92 device, Paolo Bonzini, 2019/12/18
- [PULL 59/87] hyperv: Use auto rcu_read macros, Paolo Bonzini, 2019/12/18
- [PULL 60/87] qsp: Use WITH_RCU_READ_LOCK_GUARD, Paolo Bonzini, 2019/12/18
- [PULL 61/87] memory: use RCU_READ_LOCK_GUARD, Paolo Bonzini, 2019/12/18
- [PULL 62/87] colo: fix return without releasing RCU, Paolo Bonzini, 2019/12/18
- [PULL 63/87] build: rename CONFIG_LIBCAP to CONFIG_LIBCAP_NG, Paolo Bonzini, 2019/12/18