With virtio-vga, pci bar are reordered. Bar #2 is used for compatibility with stdvga. By default, bar #2 is used by virtio modern io bar. This bar is the last one introduce in the virtio pci bar layout and it's crushed by the virtio-vga reordering. So virtio-vga and modern-pio-notify are incompatible because virtio-vga failed to initialize with this option.
This fix exchange the modern io bar with the modern memory bar, replacing the msix bar that is never impacted anyway. Signed-off-by: Anthoine Bourgeois <anthoine.bourge...@gmail.com> --- hw/display/virtio-vga.c | 2 +- hw/virtio/virtio-pci.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index 2b4c2aa126..f5f8737c60 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -113,7 +113,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp) * the stdvga mmio registers at the start of bar #2. */ vpci_dev->modern_mem_bar_idx = 2; - vpci_dev->msix_bar_idx = 4; + vpci_dev->modern_io_bar_idx = 4; if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) { /* diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 4cb784389c..9c5efaa06e 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1705,6 +1705,7 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp) * * region 0 -- virtio legacy io bar * region 1 -- msi-x bar + * region 2 -- virtio modern io bar * region 4+5 -- virtio modern memory (64bit) bar * */ -- 2.20.1