> This fix exchange the modern io bar with the modern memory bar,
> replacing the msix bar that is never impacted anyway.

Well, msix was placed in bar 4 intentionally.  That keeps bar 1 (default
msix location) free, so we have the option to turn bar 0 (vga compat
vram) into a 64bit bar without shuffling around things.

> -    vpci_dev->msix_bar_idx = 4;

Please don't.

> +    vpci_dev->modern_io_bar_idx = 4;

We can use bar 5 instead.

Alternatively just throw an error saying that modern-pio-notify is not
supported.

> 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

Separate patch please.  Also worth noting that the modern io bar is off
by default.

cheers,
  Gerd


Reply via email to