diff mbox series

[v2,1/2] virtio-vga: fix virtio-vga bar ordering

Message ID 20200422215455.10244-1-anthoine.bourgeois@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] virtio-vga: fix virtio-vga bar ordering | expand

Commit Message

Anthoine Bourgeois April 22, 2020, 9:54 p.m. UTC
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 <anthoine.bourgeois@gmail.com>
---
 hw/display/virtio-vga.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gerd Hoffmann April 23, 2020, 11:31 a.m. UTC | #1
On Wed, Apr 22, 2020 at 11:54:54PM +0200, Anthoine Bourgeois wrote:
> 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 <anthoine.bourgeois@gmail.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

> ---
>  hw/display/virtio-vga.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
> index 2b4c2aa126..95757a6619 100644
> --- a/hw/display/virtio-vga.c
> +++ b/hw/display/virtio-vga.c
> @@ -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)) {
>          /*
> -- 
> 2.20.1
>
Michael S. Tsirkin April 23, 2020, 12:52 p.m. UTC | #2
On Wed, Apr 22, 2020 at 11:54:54PM +0200, Anthoine Bourgeois wrote:
> 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 <anthoine.bourgeois@gmail.com>

Gerd, would you say it's required for 5.0?

> ---
>  hw/display/virtio-vga.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
> index 2b4c2aa126..95757a6619 100644
> --- a/hw/display/virtio-vga.c
> +++ b/hw/display/virtio-vga.c
> @@ -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)) {
>          /*
> -- 
> 2.20.1
Gerd Hoffmann April 23, 2020, 2:03 p.m. UTC | #3
On Thu, Apr 23, 2020 at 08:52:58AM -0400, Michael S. Tsirkin wrote:
> On Wed, Apr 22, 2020 at 11:54:54PM +0200, Anthoine Bourgeois wrote:
> > 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 <anthoine.bourgeois@gmail.com>
> 
> 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
diff mbox series

Patch

diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 2b4c2aa126..95757a6619 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -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)) {
         /*