qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 06/12] apic_common: fixing loading vmstate


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 06/12] apic_common: fixing loading vmstate
Date: Thu, 28 Aug 2014 14:05:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Il 28/08/2014 13:18, Pavel Dovgalyuk ha scritto:
> This patch adds missed sipi_vector and wait_for_sipi fields to the new
> subsection of the vmstate of the apic_common module. Saving and loading
> of these fields makes migration of the apic state deterministic.
> 
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> ---
>  hw/intc/apic_common.c |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
> index ce3d903..2d2dfcb 100644
> --- a/hw/intc/apic_common.c
> +++ b/hw/intc/apic_common.c
> @@ -345,6 +345,23 @@ static int apic_dispatch_post_load(void *opaque, int 
> version_id)
>      return 0;
>  }
>  
> +static bool apic_common_sipi_needed(void *opaque)
> +{
> +    APICCommonState *s = APIC_COMMON(opaque);
> +    return s->wait_for_sipi != 0;
> +}

vmstate_apic_common needs a pre_load function that sets wait_for_sipi to
0 (because the default is not zero, it's !cpu_is_bsp(s->cpu)).

Paolo

> +static const VMStateDescription vmstate_apic_common_sipi = {
> +    .name = "apic_sipi",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .fields = (VMStateField[]) {
> +        VMSTATE_INT32(sipi_vector, APICCommonState),
> +        VMSTATE_INT32(wait_for_sipi, APICCommonState),
> +        VMSTATE_END_OF_LIST()
> +    }
> +};
> +
>  static const VMStateDescription vmstate_apic_common = {
>      .name = "apic",
>      .version_id = 3,
> @@ -375,6 +392,13 @@ static const VMStateDescription vmstate_apic_common = {
>          VMSTATE_INT64(timer_expiry,
>                        APICCommonState), /* open-coded timer state */
>          VMSTATE_END_OF_LIST()
> +    },
> +    .subsections = (VMStateSubsection[]) {
> +        {
> +            .vmsd = &vmstate_apic_common_sipi,
> +            .needed = apic_common_sipi_needed,
> +        },
> +        VMSTATE_END_OF_LIST()
>      }
>  };
>  
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]