From patchwork Thu Sep 8 07:16:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9320529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28D6C60231 for ; Thu, 8 Sep 2016 07:21:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0304229619 for ; Thu, 8 Sep 2016 07:21:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBFEB2961D; Thu, 8 Sep 2016 07:21:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A950A29619 for ; Thu, 8 Sep 2016 07:21:38 +0000 (UTC) Received: from localhost ([::1]:45778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhteT-0005H2-Mp for patchwork-qemu-devel@patchwork.kernel.org; Thu, 08 Sep 2016 03:21:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhtaI-0000op-Cp for qemu-devel@nongnu.org; Thu, 08 Sep 2016 03:17:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhtaE-0002iw-Dz for qemu-devel@nongnu.org; Thu, 08 Sep 2016 03:17:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhtaE-0002is-7u for qemu-devel@nongnu.org; Thu, 08 Sep 2016 03:17:14 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 E02E110F06 for ; Thu, 8 Sep 2016 07:17:13 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u887HDha023051; Thu, 8 Sep 2016 03:17:13 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 241A7806AA; Thu, 8 Sep 2016 09:17:12 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 8 Sep 2016 09:16:52 +0200 Message-Id: <1473319012-27560-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 08 Sep 2016 07:17:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] virtio-vga: adapt to page-per-vq=off X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, Gerd Hoffmann , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Gerd Hoffmann --- 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;