Comment 5 for bug 1897481

Revision history for this message
Alex Williamson (alex-l-williamson) wrote :

There are definitely resource allocation issues on the host in the crashing case. The quirks currently enumerate the device BARs without testing them, we identify a device and know what the resources should be, which is why I think QEMU crashes. Are you able to test if the patch below is sufficient to resolve the crash? I'd expect the GPU not to work in the guest as it doesn't have enough resources, but the goal would be to resolve the crash; QEMU cannot fix the device mappings on the host.

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 0d83eb0e47bb..10477af9fc14 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2921,7 +2921,9 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
     }

     for (i = 0; i < PCI_ROM_SLOT; i++) {
- vfio_bar_quirk_setup(vdev, i);
+ if (vdev->bars[i].size) {
+ vfio_bar_quirk_setup(vdev, i);
+ }
     }

     if (!vdev->igd_opregion &&