qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org,
	Juan Quintela <quintela@redhat.com>,
	Shannon Zhao <zhaoshenglong@huawei.com>,
	Shannon Zhao <shannon.zhaosl@gmail.com>
Subject: Re: [Qemu-devel] [PATCH for-3.0 v2 4/5] hw/intc/arm_gicv3_common: Move post_load hooks to top-level VMSD
Date: Mon, 6 Aug 2018 16:32:21 +0100	[thread overview]
Message-ID: <20180806153220.GE2473@work-vm> (raw)
In-Reply-To: <20180806123445.1459-5-peter.maydell@linaro.org>

* Peter Maydell (peter.maydell@linaro.org) wrote:
> Contrary to the the impression given in docs/devel/migration.rst,
> the migration code does not run the pre_load hook for a
> subsection unless the subsection appears on the wire, and so
> this is not a place where you can set the default value for
> state for the "subsection not present" case. Instead this needs
> to be done in a pre_load hook for whatever is the parent VMSD
> of the subsection.
> 
> We got this wrong in two of the subsection definitions in
> the GICv3 migration structs; fix this.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  hw/intc/arm_gicv3_common.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
> index e1a8999cf5b..8175889f1e7 100644
> --- a/hw/intc/arm_gicv3_common.c
> +++ b/hw/intc/arm_gicv3_common.c
> @@ -73,7 +73,7 @@ static const VMStateDescription vmstate_gicv3_cpu_virt = {
>      }
>  };
>  
> -static int icc_sre_el1_reg_pre_load(void *opaque)
> +static int vmstate_gicv3_cpu_pre_load(void *opaque)
>  {
>      GICv3CPUState *cs = opaque;
>  
> @@ -97,7 +97,6 @@ const VMStateDescription vmstate_gicv3_cpu_sre_el1 = {
>      .name = "arm_gicv3_cpu/sre_el1",
>      .version_id = 1,
>      .minimum_version_id = 1,
> -    .pre_load = icc_sre_el1_reg_pre_load,
>      .needed = icc_sre_el1_reg_needed,
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT64(icc_sre_el1, GICv3CPUState),
> @@ -109,6 +108,7 @@ static const VMStateDescription vmstate_gicv3_cpu = {
>      .name = "arm_gicv3_cpu",
>      .version_id = 1,
>      .minimum_version_id = 1,
> +    .pre_load = vmstate_gicv3_cpu_pre_load,
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT32(level, GICv3CPUState),
>          VMSTATE_UINT32(gicr_ctlr, GICv3CPUState),
> @@ -139,7 +139,7 @@ static const VMStateDescription vmstate_gicv3_cpu = {
>      }
>  };
>  
> -static int gicv3_gicd_no_migration_shift_bug_pre_load(void *opaque)
> +static int gicv3_pre_load(void *opaque)
>  {
>      GICv3State *cs = opaque;
>  
> @@ -210,7 +210,6 @@ const VMStateDescription vmstate_gicv3_gicd_no_migration_shift_bug = {
>      .version_id = 1,
>      .minimum_version_id = 1,
>      .needed = needed_always,
> -    .pre_load = gicv3_gicd_no_migration_shift_bug_pre_load,
>      .post_load = gicv3_gicd_no_migration_shift_bug_post_load,
>      .fields = (VMStateField[]) {
>          VMSTATE_BOOL(gicd_no_migration_shift_bug, GICv3State),
> @@ -222,6 +221,7 @@ static const VMStateDescription vmstate_gicv3 = {
>      .name = "arm_gicv3",
>      .version_id = 1,
>      .minimum_version_id = 1,
> +    .pre_load = gicv3_pre_load,
>      .pre_save = gicv3_pre_save,
>      .post_load = gicv3_post_load,
>      .priority = MIG_PRI_GICV3,
> -- 
> 2.17.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2018-08-06 15:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06 12:34 [Qemu-devel] [PATCH for-3.0 v2 0/5] Arm migration fixes for 3.0 Peter Maydell
2018-08-06 12:34 ` [Qemu-devel] [PATCH for-3.0 v2 1/5] hw/intc/arm_gicv3_common: Give no-migration-shift-bug subsection a needed function Peter Maydell
2018-08-07 14:34   ` Juan Quintela
2018-08-06 12:34 ` [Qemu-devel] [PATCH for-3.0 v2 2/5] hw/intc/arm_gicv3_common: Combine duplicate .subsections in vmstate_gicv3_cpu Peter Maydell
2018-08-07 14:34   ` Juan Quintela
2018-08-06 12:34 ` [Qemu-devel] [PATCH for-3.0 v2 3/5] target/arm: Add dummy needed functions to M profile vmstate subsections Peter Maydell
2018-08-07 14:40   ` Juan Quintela
2018-08-07 14:45     ` Peter Maydell
2018-08-07 14:50       ` Juan Quintela
2018-08-06 12:34 ` [Qemu-devel] [PATCH for-3.0 v2 4/5] hw/intc/arm_gicv3_common: Move post_load hooks to top-level VMSD Peter Maydell
2018-08-06 15:32   ` Dr. David Alan Gilbert [this message]
2018-08-07 14:41   ` Juan Quintela
2018-08-06 12:34 ` [Qemu-devel] [PATCH for-3.0 v2 5/5] hw/intc/arm_gicv3_common: Move gicd shift bug handling to gicv3_post_load Peter Maydell
2018-08-06 15:39   ` Dr. David Alan Gilbert
2018-08-06 14:06 ` [Qemu-devel] [PATCH for-3.0 v2 0/5] Arm migration fixes for 3.0 Richard Henderson
2018-08-06 16:50   ` 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=20180806153220.GE2473@work-vm \
    --to=dgilbert@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=shannon.zhaosl@gmail.com \
    --cc=zhaoshenglong@huawei.com \
    /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).