[PATCH 2/2] virtio-pci: fallback to userspace when there is no enough available ioeventfd

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

 



Qemu already supported multiple function devices, pci-bridge
would support more pci devices. But iobus dev in kernel are
limited. If there is no enough available ioeventfd, then
clean VIRTIO_PCI_FLAG_USE_IOEVENTFD bit, virtio-pci would
fallback to userspace.

Signed-off-by: Amos Kong <akong@xxxxxxxxxx>
---
 hw/virtio-pci.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index d63f303..d15b11b 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -322,6 +322,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
         virtio_set_status(vdev, val & 0xFF);
 
         if (val & VIRTIO_CONFIG_S_DRIVER_OK) {
+            if (kvm_has_many_ioeventfds() == 0) {
+                proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
+            }
             virtio_pci_start_ioeventfd(proxy);
         }
 

--
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