From: "Radim Krčmář" <rkrcmar@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] qxl: surface0 and ram_header should fit into vram
Date: Mon, 16 Feb 2015 22:23:08 +0100 [thread overview]
Message-ID: <1424121788-24560-3-git-send-email-rkrcmar@redhat.com> (raw)
In-Reply-To: <1424121788-24560-1-git-send-email-rkrcmar@redhat.com>
The solution is not perfect, but won't let us do the same error again
and has no overhead.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
hw/display/qxl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 61df47726481..d5e85d033080 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -367,6 +367,8 @@ static void init_qxl_rom(PCIQXLDevice *d)
num_pages -= surface0_area_size;
num_pages = num_pages / QXL_PAGE_SIZE;
+ assert(surface0_area_size + ram_header_size <= d->vga.vram_size);
+
rom->draw_area_offset = cpu_to_le32(0);
rom->surface0_area_size = cpu_to_le32(surface0_area_size);
rom->pages_offset = cpu_to_le32(surface0_area_size);
--
2.3.0
next prev parent reply other threads:[~2015-02-16 21:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-16 21:23 [Qemu-devel] [PATCH 0/2] vga: assert to "solve" qxl bug Radim Krčmář
2015-02-16 21:23 ` [Qemu-devel] [PATCH 1/2] vga: abort instead of shrinking memory Radim Krčmář
2015-02-17 8:00 ` Gerd Hoffmann
2015-02-17 10:29 ` Radim Krčmář
2015-02-17 10:37 ` Gerd Hoffmann
2015-02-17 10:48 ` Radim Krčmář
2015-02-17 10:51 ` Gerd Hoffmann
2015-02-17 11:15 ` Radim Krčmář
2015-02-16 21:23 ` Radim Krčmář [this message]
2015-02-17 8:02 ` [Qemu-devel] [PATCH 2/2] qxl: surface0 and ram_header should fit into vram Gerd Hoffmann
2015-02-17 10:31 ` Radim Krčmář
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=1424121788-24560-3-git-send-email-rkrcmar@redhat.com \
--to=rkrcmar@redhat.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).