The PCI MSI-X support for aarch64 is unfortunately not fully
functional (please see arch/aarch64/msi.cc for details). This causes
OSv to hang when running on QEMU in aarch64 emulated mode in both
virtio-blk and virtio-net waiting to receive PCI interrupt from
the hypervisor.

So for now this patch forces OSv to enable regular PCI
interrupt regardless if QEMU advertises a PCI device in MSI-X mode.
This actually makes both virtio-blk and virtio-net function properly
on QEMU with PCI devices. This means that OSv finally gets an IP address
and is able to mount a ROFS disk (ZFS has not been tested yet) and execute
an app from it.

Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
---
 drivers/virtio-pci-device.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/virtio-pci-device.cc b/drivers/virtio-pci-device.cc
index 378332ff..c7420747 100644
--- a/drivers/virtio-pci-device.cc
+++ b/drivers/virtio-pci-device.cc
@@ -44,11 +44,17 @@ void virtio_pci_device::init()
 
 void virtio_pci_device::register_interrupt(interrupt_factory irq_factory)
 {
+#ifdef AARCH64_PORT_STUB
+    // Currently MSI-X support for aach64 is stubbed (please see 
arch/aarch64/msi.cc)
+    // so until it becomes functional we register regular PCI interrupt
+    _irq.reset(irq_factory.create_pci_interrupt(*_dev));
+#else  
     if (irq_factory.register_msi_bindings && _dev->is_msix()) {
         irq_factory.register_msi_bindings(_msi);
     } else {
         _irq.reset(irq_factory.create_pci_interrupt(*_dev));
     }
+#endif    
 }
 
 virtio_legacy_pci_device::virtio_legacy_pci_device(pci::device *dev)
-- 
2.26.2

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/20200704051814.4742-1-jwkozaczuk%40gmail.com.

Reply via email to