[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [RFC 3/4] hw/intc/arm_gicv3_its: Implement state save/res
From: |
Juan Quintela |
Subject: |
Re: [Qemu-arm] [RFC 3/4] hw/intc/arm_gicv3_its: Implement state save/restore |
Date: |
Mon, 30 Jan 2017 10:15:13 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Eric Auger <address@hidden> wrote:
> We need to handle both registers and ITS tables. While
> register handling is standard, ITS table handling is more
> challenging since the kernel API is devised so that the
> tables are flushed into guest RAM and not in vmstate buffers.
>
> Flushing the ITS tables on device pre_save() is too late
> since the guest RAM had already been saved at this point.
>
> Table flushing needs to happen when we are sure the vcpus
> are stopped and before the last dirty page saving. The
> right point is RUN_STATE_FINISH_MIGRATE but sometimes the
> VM gets stopped before migration launch so let's simply
> flush the tables each time the VM gets stopped.
>
> For regular ITS registers we just can use vmstate pre_save
> and post_load callbacks.
>
> Signed-off-by: Eric Auger <address@hidden>
Hi
> + * vm_change_state_handler - VM change state callback aiming at flushing
> + * ITS tables into guest RAM
> + *
> + * The tables get flushed to guest RAM whenever the VM gets stopped.
> + */
> +static void vm_change_state_handler(void *opaque, int running,
> + RunState state)
> +{
> + GICv3ITSState *s = (GICv3ITSState *)opaque;
Cast is unneeded.
> +
> + if (running) {
> + return;
> + }
> + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_TABLES,
> + 0, NULL, false);
As you are adding it to do everytime that we stop the guest, how
expensive/slow is that?
Thanks, Juan.