Received: from eggs.gnu.org ([2001:4830:134:3::10]:59426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjitS-0005jG-MX for qemu-devel@nongnu.org; Tue, 13 Sep 2016 04:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjitR-0007pO-OT for qemu-devel@nongnu.org; Tue, 13 Sep 2016 04:16:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjitR-0007op-Jc for qemu-devel@nongnu.org; Tue, 13 Sep 2016 04:16:37 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF2ED9C0D7 for ; Tue, 13 Sep 2016 08:16:36 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 13 Sep 2016 10:16:33 +0200 Message-Id: <1473754593-13527-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1473754593-13527-1-git-send-email-kraxel@redhat.com> References: <1473754593-13527-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 3/3] virtio-vga: adapt to page-per-vq=off List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , "Michael S. Tsirkin" Signed-off-by: Gerd Hoffmann Message-id: 1473319012-27560-1-git-send-email-kraxel@redhat.com --- hw/display/virtio-vga.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index 5b510a1..f77b401 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; -- 1.8.3.1