virtio-vga: fix virtio-vga bar ordering
PATCH v2 1/2 virtio-vga: fix virtio-vga bar ordering
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 sets the modern io bar to the bar #5 to avoid conflict.
--- hw/display/virtio-vga.c | 1 + 1 file changed, 1 insertion(+)
hw/display/virtio-vga.c +1 -0
@@ -114,6 +114,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)*/ vpci_dev->modern_mem_bar_idx =2 ; vpci_dev->msix_bar_idx =4 ; + vpci_dev->modern_io_bar_idx =5 ;if (!(vpci_dev->flags &VIRTIO_PCI_FLAG_PAGE_PER_VQ )) {/*
Signature · 1 line
2.20.1
PATCH v2 2/2 virtio-pci: update virtio pci bar layout documentation
The modern io bar was never documented.
--- hw/virtio/virtio-pci.c | 1 + 1 file changed, 1 insertion(+)
hw/virtio/virtio-pci.c +1 -0
@@ -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 (off by default) * region 4+5 -- virtio modern memory (64bit) bar * */
Signature · 1 line
2.20.1
Re: [PATCH v2 2/2] virtio-pci: update virtio pci bar layout documentation
Quoted 12 lines · Anthoine Bourgeois
The modern io bar was never documented.
Signed-off-by Anthoine Bourgeois <[email protected]>--- hw/virtio/virtio-pci.c | 1 + 1 file changed, 1 insertion(+)hw/virtio/virtio-pci.c +0
-0
hw/virtio/virtio-pci.c static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp) · line 1709
Quoted 5 lines
hw/virtio/virtio-pci.c +1
-0@@ -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 (off by default) * region 4+5 -- virtio modern memory (64bit) bar
Quoted 5 lines
hw/virtio/virtio-pci.c +0
-0* */ Signature · 1 line
2.20.1
Quoted 10 lines · Anthoine Bourgeois
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 sets the modern io bar to the bar #5 to avoid conflict.
Signed-off-by Anthoine Bourgeois <[email protected]>
Quoted 19 lines
--- hw/display/virtio-vga.c | 1 + 1 file changed, 1 insertion(+)hw/display/virtio-vga.c +1
-0@@ -114,6 +114,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)*/ vpci_dev->modern_mem_bar_idx =2 ; vpci_dev->msix_bar_idx =4 ; + vpci_dev->modern_io_bar_idx =5 ;if (!(vpci_dev->flags &VIRTIO_PCI_FLAG_PAGE_PER_VQ )) {/* Signature · 1 line
2.20.1
Quoted 10 lines · Anthoine Bourgeois
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 sets the modern io bar to the bar #5 to avoid conflict.
Signed-off-by Anthoine Bourgeois <[email protected]>
Gerd, would you say it's required for 5.0?
Quoted 18 lines
--- hw/display/virtio-vga.c | 1 + 1 file changed, 1 insertion(+)hw/display/virtio-vga.c +1
-0@@ -114,6 +114,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)*/ vpci_dev->modern_mem_bar_idx =2 ; vpci_dev->msix_bar_idx =4 ; + vpci_dev->modern_io_bar_idx =5 ;if (!(vpci_dev->flags &VIRTIO_PCI_FLAG_PAGE_PER_VQ )) {/* Signature · 1 line
2.20.1
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Anthoine Bourgeois
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.
Quoted 5 lines
Quoted 3 lines
This fix sets the modern io bar to the bar #5 to avoid conflict.
Signed-off-by Anthoine Bourgeois <[email protected]>Gerd, would you say it's required for 5.0?
Given that modern-pio-notify is off by default I wouldn't classify this as release blocker, i.e. I wouldn't delay the release for that.
We are at -rc4 (last rc) already, so I'd tend to say no. Maybe if we need -rc5 for other reasons.
cheers,
Gerd