Skip to contentSkip to conversation

msix: fix irqchip breakage

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Oct 20, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 msix: fix irqchip breakage

msix.c doesn't include linux kvm header anymore, so IRQCHIP macro is never defined, which resulted in a broken msix support. As a fix, stub out kvm_set_irq and remove the remaining ifdefs.

---
 hw/msix.c  |    2 --
 kvm-stub.c |    6 ++++++
 kvm.h      |    2 ++
 qemu-kvm.h |    1 -
 4 files changed, 8 insertions(+), 3 deletions(-)
hw/msix.c +0 -2
index f12e4aa..4b6133d 100644
@@ -509,12 +509,10 @@ void msix_notify(PCIDevice *dev, unsigned vector)
         return;
     }
 
-#ifdef KVM_CAP_IRQCHIP
     if (kvm_enabled() && kvm_irqchip_in_kernel()) {
         kvm_set_irq(dev->msix_irq_entries[vector].gsi, 1, NULL);
         return;
     }
-#endif
 
     address = pci_get_long(table_entry + MSIX_MSG_UPPER_ADDR);
     address = (address << 32) | pci_get_long(table_entry + MSIX_MSG_ADDR);
kvm-stub.c +6 -0
index 3c2deec..aeee3c0 100644
@@ -176,3 +176,9 @@ int kvm_commit_irq_routes(void)
 {
     return -ENOSYS;
 }
+
+int kvm_set_irq(int irq, int level, int *status)
+{
+    assert(0);
+    return -ENOSYS;
+}
kvm.h +2 -0
index d484a3f..74dfa48 100644
@@ -214,4 +214,6 @@ int kvm_commit_irq_routes(void);
 
 int kvm_irqchip_in_kernel(void);
 
+int kvm_set_irq(int irq, int level, int *status);
+
 #endif
qemu-kvm.h +0 -1
index 9c08ab4..c6f5632 100644
@@ -785,7 +785,6 @@ void kvm_load_lapic(CPUState *env);
 
 void kvm_hpet_enable_kpit(void);
 void kvm_hpet_disable_kpit(void);
-int kvm_set_irq(int irq, int level, int *status);
 
 int kvm_physical_memory_set_dirty_tracking(int enable);
 
Signature · 1 line
1.7.3-rc1
#1 lore raw
Quoted 5 lines · Michael S. Tsirkin

msix.c doesn't include linux kvm header anymore, so IRQCHIP macro is never defined, which resulted in a broken msix support. As a fix, stub out kvm_set_irq and remove the remaining ifdefs.

Quoted 7 lines
---
 hw/msix.c  |    2 --
 kvm-stub.c |    6 ++++++
 kvm.h      |    2 ++
 qemu-kvm.h |    1 -
 4 files changed, 8 insertions(+), 3 deletions(-)

Applied both, thanks.