diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-09-08 09:16:52 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-09-13 09:28:10 +0200 |
commit | c2843e93907a4084e91573994486e810cec248a0 (patch) | |
tree | f6c83826071484007e9d0c5a7b09f55086a1125c /hw | |
parent | 597966d1100ab507382da75d50a798bbb5f79977 (diff) |
virtio-vga: adapt to page-per-vq=off
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1473319012-27560-1-git-send-email-kraxel@redhat.com
Diffstat (limited to 'hw')
-rw-r--r-- | hw/display/virtio-vga.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index 5b510a17fd..f77b401264 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -122,6 +122,17 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp) */ vpci_dev->modern_mem_bar = 2; vpci_dev->msix_bar = 4; + + if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) { + /* + * with page-per-vq=off there is no padding space we can use + * for the stdvga registers. Make the common and isr regions + * smaller then. + */ + vpci_dev->common.size /= 2; + vpci_dev->isr.size /= 2; + } + offset = memory_region_size(&vpci_dev->modern_bar); offset -= vpci_dev->notify.size; vpci_dev->notify.offset = offset; |