All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL for-2.9 3/7] cirrus: switch to 4 MB video memory by default
Date: Thu, 16 Mar 2017 10:30:38 +0100	[thread overview]
Message-ID: <1489656642-12925-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1489656642-12925-1-git-send-email-kraxel@redhat.com>

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 <kraxel@redhat.com>
Message-id: 1489494514-15606-1-git-send-email-kraxel@redhat.com
---
 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 c90a4a3..6ffe64f 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -3023,7 +3023,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp)
 
 static Property isa_cirrus_vga_properties[] = {
     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(),
 };
 
@@ -3092,7 +3092,7 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
 
 static Property pci_vga_cirrus_properties[] = {
     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(),
 };
 
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   = "pci-bridge",\
         .property = "shpc",\
         .value    = "on",\
+    },{\
+        .driver   = "cirrus-vga",\
+        .property = "vgamem_mb",\
+        .value    = "8",\
+    },{\
+        .driver   = "isa-cirrus-vga",\
+        .property = "vgamem_mb",\
+        .value    = "8",\
     },
 
 #define HW_COMPAT_2_7 \
-- 
1.8.3.1

  parent reply	other threads:[~2017-03-16  9:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  9:30 [Qemu-devel] [PULL for-2.9 0/7] cirrus: more blitter security fixes Gerd Hoffmann
2017-03-16  9:30 ` [Qemu-devel] [PULL for-2.9 1/7] fix :cirrus_vga fix OOB read case qemu Segmentation fault Gerd Hoffmann
2017-03-16  9:30 ` [Qemu-devel] [PULL for-2.9 2/7] cirrus/vnc: zap bitblit support from console code Gerd Hoffmann
2017-03-16  9:30 ` Gerd Hoffmann [this message]
2017-03-16  9:30 ` [Qemu-devel] [PULL for-2.9 4/7] cirrus: add option to disable blitter Gerd Hoffmann
2017-03-16  9:51   ` 李强
2017-03-16 11:07     ` Thomas Huth
2017-03-16 14:00     ` Gerd Hoffmann
2017-03-16  9:30 ` [Qemu-devel] [PULL for-2.9 5/7] cirrus: fix cirrus_invalidate_region Gerd Hoffmann
2017-03-16  9:30 ` [Qemu-devel] [PULL for-2.9 6/7] cirrus: stop passing around dst pointers in the blitter Gerd Hoffmann
2017-03-16  9:30 ` [Qemu-devel] [PULL for-2.9 7/7] cirrus: stop passing around src " Gerd Hoffmann
2017-03-16 17:53 ` [Qemu-devel] [PULL for-2.9 0/7] cirrus: more blitter security fixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489656642-12925-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.