From nobody Mon Apr 29 23:26:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 148949459133310.529254013242735; Tue, 14 Mar 2017 05:29:51 -0700 (PDT) Received: from localhost ([::1]:58452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnlaH-0000AC-NL for importer@patchew.org; Tue, 14 Mar 2017 08:29:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnlZH-000083-Me for qemu-devel@nongnu.org; Tue, 14 Mar 2017 08:28:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnlZD-0008FM-Qb for qemu-devel@nongnu.org; Tue, 14 Mar 2017 08:28:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnlZD-0008EC-LY for qemu-devel@nongnu.org; Tue, 14 Mar 2017 08:28:43 -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 D529E4DD6D for ; Tue, 14 Mar 2017 12:28:43 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ECShrc013759; Tue, 14 Mar 2017 08:28:43 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 7DB3E80959; Tue, 14 Mar 2017 13:28:41 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 14 Mar 2017 13:28:34 +0100 Message-Id: <1489494514-15606-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]); Tue, 14 Mar 2017 12:28:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] cirrus: switch to 4 MB video memory by default 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Quoting cirrus source code: Follow real hardware, cirrus card emulated has 4 MB video memory. Also accept 8 MB/16 MB for backward compatibility. So just use 4MB by default. We decided to leave that at 8MB by default a while ago, for live migration compatibility reasons. But we have compat properties to handle that, so that isn't a compeling reason. This also removes some sanity check inconsistencies in the cirrus code. Some places check against the allocated video memory, some places check against the 4MB physical hardware has. Guest code can trigger asserts because of that. Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c | 4 ++-- include/hw/compat.h | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index b9e7cb1..efbd2c1 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -3029,7 +3029,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev= , Error **errp) =20 static Property isa_cirrus_vga_properties[] =3D { DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState, - cirrus_vga.vga.vram_size_mb, 8), + cirrus_vga.vga.vram_size_mb, 4), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -3098,7 +3098,7 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Er= ror **errp) =20 static Property pci_vga_cirrus_properties[] =3D { DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState, - cirrus_vga.vga.vram_size_mb, 8), + cirrus_vga.vga.vram_size_mb, 4), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/compat.h b/include/hw/compat.h index b7db438..b7e0e9f 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -18,6 +18,14 @@ .driver =3D "pci-bridge",\ .property =3D "shpc",\ .value =3D "on",\ + },{\ + .driver =3D "cirrus-vga",\ + .property =3D "vgamem_mb",\ + .value =3D "8",\ + },{\ + .driver =3D "isa-cirrus-vga",\ + .property =3D "vgamem_mb",\ + .value =3D "8",\ }, =20 #define HW_COMPAT_2_7 \ --=20 1.8.3.1