From: "Andreas Färber" <afaerber@suse.de>
To: Dmitry Koshelev <karaghiozis@gmail.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, paul@codesourcery.com
Subject: Re: [Qemu-devel] [PATCH] [v3] hw/arm_gic.c: Fix save/load of irq_target array
Date: Fri, 21 Oct 2011 13:42:12 +0200 [thread overview]
Message-ID: <4EA15A94.7090406@suse.de> (raw)
In-Reply-To: <1319107715.4387.11.camel@dierdre>
Am 20.10.2011 12:48, schrieb Dmitry Koshelev:
> irq_target array saving/loading is in the wrong loop.
> Version bump.
>
> Signed-off-by: Dmitry Koshelev <karaghiozis@gmail.com>
Acked-by: Andreas Färber <andreas.faerber@web.de>
Applies cleanly now.
Is there a particular use case that was broken before and works now, or
did this turn up during code review only?
Andreas
> ---
> hw/arm_gic.c | 16 ++++++++--------
> 1 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/hw/arm_gic.c b/hw/arm_gic.c
> index 83213dd..8dd8742 100644
> --- a/hw/arm_gic.c
> +++ b/hw/arm_gic.c
> @@ -658,9 +658,6 @@ static void gic_save(QEMUFile *f, void *opaque)
> qemu_put_be32(f, s->enabled);
> for (i = 0; i < NUM_CPU(s); i++) {
> qemu_put_be32(f, s->cpu_enabled[i]);
> -#ifndef NVIC
> - qemu_put_be32(f, s->irq_target[i]);
> -#endif
> for (j = 0; j < 32; j++)
> qemu_put_be32(f, s->priority1[j][i]);
> for (j = 0; j < GIC_NIRQ; j++)
> @@ -674,6 +671,9 @@ static void gic_save(QEMUFile *f, void *opaque)
> qemu_put_be32(f, s->priority2[i]);
> }
> for (i = 0; i < GIC_NIRQ; i++) {
> +#ifndef NVIC
> + qemu_put_be32(f, s->irq_target[i]);
> +#endif
> qemu_put_byte(f, s->irq_state[i].enabled);
> qemu_put_byte(f, s->irq_state[i].pending);
> qemu_put_byte(f, s->irq_state[i].active);
> @@ -689,15 +689,12 @@ static int gic_load(QEMUFile *f, void *opaque, int version_id)
> int i;
> int j;
>
> - if (version_id != 1)
> + if (version_id != 2)
> return -EINVAL;
>
> s->enabled = qemu_get_be32(f);
> for (i = 0; i < NUM_CPU(s); i++) {
> s->cpu_enabled[i] = qemu_get_be32(f);
> -#ifndef NVIC
> - s->irq_target[i] = qemu_get_be32(f);
> -#endif
> for (j = 0; j < 32; j++)
> s->priority1[j][i] = qemu_get_be32(f);
> for (j = 0; j < GIC_NIRQ; j++)
> @@ -711,6 +708,9 @@ static int gic_load(QEMUFile *f, void *opaque, int version_id)
> s->priority2[i] = qemu_get_be32(f);
> }
> for (i = 0; i < GIC_NIRQ; i++) {
> +#ifndef NVIC
> + s->irq_target[i] = qemu_get_be32(f);
> +#endif
> s->irq_state[i].enabled = qemu_get_byte(f);
> s->irq_state[i].pending = qemu_get_byte(f);
> s->irq_state[i].active = qemu_get_byte(f);
> @@ -739,5 +739,5 @@ static void gic_init(gic_state *s)
> }
> memory_region_init_io(&s->iomem, &gic_dist_ops, s, "gic_dist", 0x1000);
> gic_reset(s);
> - register_savevm(NULL, "arm_gic", -1, 1, gic_save, gic_load, s);
> + register_savevm(NULL, "arm_gic", -1, 2, gic_save, gic_load, s);
> }
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746, AG Nürnberg
next prev parent reply other threads:[~2011-10-21 11:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 10:48 [Qemu-devel] [PATCH] [v3] hw/arm_gic.c: Fix save/load of irq_target array Dmitry Koshelev
2011-10-21 11:42 ` Andreas Färber [this message]
2011-10-21 13:58 ` Dmitry Koshelev
2011-10-21 14:22 ` Andreas Färber
2011-10-21 15:08 ` andrzej zaborowski
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=4EA15A94.7090406@suse.de \
--to=afaerber@suse.de \
--cc=karaghiozis@gmail.com \
--cc=paul@codesourcery.com \
--cc=peter.maydell@linaro.org \
--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.