[PATCH 3/4] qemu-kvm: msi: Drop redundant support tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The presence of QEMU_PCI_CAP_MSIX implies msi_supported. And
msi_supported is not set if KVM cannot handle it properly. So drop all
redundant tests.

Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
---
 hw/msi.c  |    4 ----
 hw/msix.c |   10 +---------
 2 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/hw/msi.c b/hw/msi.c
index 7bb3e2f..4fcf769 100644
--- a/hw/msi.c
+++ b/hw/msi.c
@@ -218,10 +218,6 @@ int msi_init(struct PCIDevice *dev, uint8_t offset,
                    " 64bit %d mask %d\n",
                    offset, nr_vectors, msi64bit, msi_per_vector_mask);
 
-    if (kvm_enabled() && kvm_irqchip_in_kernel() && !kvm_has_gsi_routing()) {
-        return -ENOTSUP;
-    }
-
     assert(!(nr_vectors & (nr_vectors - 1)));   /* power of 2 */
     assert(nr_vectors > 0);
     assert(nr_vectors <= PCI_MSI_VECTORS_MAX);
diff --git a/hw/msix.c b/hw/msix.c
index 7955221..60a6d86 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -349,8 +349,7 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
     int ret;
 
     /* Nothing to do if MSI is not supported by interrupt controller */
-    if (!msi_supported ||
-        (kvm_enabled() && kvm_irqchip_in_kernel() && !kvm_has_gsi_routing())) {
+    if (!msi_supported) {
         return -ENOTSUP;
     }
     if (nentries > MSIX_MAX_ENTRIES)
@@ -429,10 +428,6 @@ void msix_save(PCIDevice *dev, QEMUFile *f)
 {
     unsigned n = dev->msix_entries_nr;
 
-    if (!msi_supported) {
-        return;
-    }
-
     if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) {
         return;
     }
@@ -445,9 +440,6 @@ void msix_load(PCIDevice *dev, QEMUFile *f)
 {
     unsigned n = dev->msix_entries_nr;
 
-    if (!msi_supported)
-        return;
-
     if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) {
         return;
     }
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux