[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] virtio-vga: fix virtio-vga bar ordering
From: |
Anthoine Bourgeois |
Subject: |
Re: [PATCH] virtio-vga: fix virtio-vga bar ordering |
Date: |
Thu, 23 Apr 2020 00:02:58 +0200 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Wed, Apr 22, 2020 at 12:46:57PM +0200, Gerd Hoffmann wrote:
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.
That's a really good reason I didn't think of.
Just a question, why didn't we choose the virtio-vga order to avoid
shuffling from the beginning? Vga came after and we keep the
compatibility ?
- 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.
As you like. I sent a v2 with modern_io_bar_idx to 5 but I can do a v3
with an error thrown.
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.
Done.
Thank you,
Anthoine