qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 02/12] hw/pl110.c: Add post-load hook to invalidate display
Date: Wed,  4 Jan 2012 13:56:16 +0000	[thread overview]
Message-ID: <1325685386-23315-3-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1325685386-23315-1-git-send-email-peter.maydell@linaro.org>

Add a post-load hook which invalidates the display. In particular, if we
don't do this and the display size we've just reloaded is larger than
the default then we will segfault trying to read off the end of the buffer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pl110.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/pl110.c b/hw/pl110.c
index 303a9bc..0e1f415 100644
--- a/hw/pl110.c
+++ b/hw/pl110.c
@@ -60,10 +60,13 @@ typedef struct {
     qemu_irq irq;
 } pl110_state;
 
+static int vmstate_pl110_post_load(void *opaque, int version_id);
+
 static const VMStateDescription vmstate_pl110 = {
     .name = "pl110",
     .version_id = 2,
     .minimum_version_id = 1,
+    .post_load = vmstate_pl110_post_load,
     .fields = (VMStateField[]) {
         VMSTATE_INT32(version, pl110_state),
         VMSTATE_UINT32_ARRAY(timing, pl110_state, 4),
@@ -430,6 +433,14 @@ static void pl110_mux_ctrl_set(void *opaque, int line, int level)
     s->mux_ctrl = level;
 }
 
+static int vmstate_pl110_post_load(void *opaque, int version_id)
+{
+    pl110_state *s = opaque;
+    /* Make sure we redraw, and at the right size */
+    pl110_invalidate_display(s);
+    return 0;
+}
+
 static int pl110_init(SysBusDevice *dev)
 {
     pl110_state *s = FROM_SYSBUS(pl110_state, dev);
-- 
1.7.1

  parent reply	other threads:[~2012-01-04 14:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04 13:56 [Qemu-devel] [PULL 00/12] arm-devs queue Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 01/12] hw/pl181.c: Add save/load support Peter Maydell
2012-01-04 13:56 ` Peter Maydell [this message]
2012-01-04 13:56 ` [Qemu-devel] [PATCH 03/12] hw/omap1.c: omap_mpuio_init() need not be public Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 04/12] hw/omap1.c: Separate PWL from omap_mpu_state Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 05/12] hw/omap1.c: Separate PWT " Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 06/12] hw/omap1.c: Separate dpll_ctl " Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 07/12] hw/omap1.c: Drop unused includes Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 08/12] hw/omap_gpmc: Fix region map/unmap when configuring prefetch engine Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 09/12] arm: add missing scu registers Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 10/12] arm: Set frequencies for arm_timer Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 11/12] arm: add dummy gic security registers Peter Maydell
2012-01-04 13:56 ` [Qemu-devel] [PATCH 12/12] add L2x0/PL310 cache controller device Peter Maydell
2012-01-04 17:56 ` [Qemu-devel] [PULL 00/12] arm-devs queue Anthony Liguori

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=1325685386-23315-3-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=aliguori@us.ibm.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).