Skip to contentSkip to conversation

virtio-pci: pass real with_irqfd to virtio_pci_set_guest_notifier()

PATCH New Stefan Hajnoczi 1 participant 1 message Mar 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-pci: pass real with_irqfd to virtio_pci_set_guest_notifier()

virtio_pci_set_guest_notifiers() checks whether irqfd can be used and whether MSI-X is enabled for the PCI adapter. But then it calls virtio_pci_set_guest_notifier() and passes kvm_msi_via_irqfd_enabled() instead of with_irqfd.

When MSI-X is disabled but irqfd is allowed this means that guest_notifier has neither irqfd nor a virtio_queue_guest_notifier_read() handler. Therefore the guest cannot receive notifications.

This issue is triggered by a Windows 7 Professional 64-bit guest with -device virtio-blk-pci,x-data-plane=on. The guest driver does not enable MSI-X and the guest gets stuck at the Windows boot screen since it does not receive notifications.

---
 hw/virtio-pci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/virtio-pci.c +1 -2
index 736a9bf..84ece51 100644
@@ -798,8 +798,7 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign)
             break;
         }
 
-        r = virtio_pci_set_guest_notifier(d, n, assign,
-                                          kvm_msi_via_irqfd_enabled());
+        r = virtio_pci_set_guest_notifier(d, n, assign, with_irqfd);
         if (r < 0) {
             goto assign_error;
         }
Signature · 1 line
1.8.1.4