OSDN Git Service

hw/intc/arm_gicv3_its: Implement state save/restore
authorEric Auger <eric.auger@redhat.com>
Tue, 13 Jun 2017 13:57:00 +0000 (14:57 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 13 Jun 2017 13:57:00 +0000 (14:57 +0100)
commitcddafd8f353d2d251b1a5c6c948a577a85838582
treef64a21cb63138655a5e5b7616ea84da7a537296e
parent556969e938a97e98eec9df039944741ed74ce049
hw/intc/arm_gicv3_its: Implement state save/restore

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 is already 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 <eric.auger@redhat.com>
Message-id: 1497023553-18411-3-git-send-email-eric.auger@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/arm_gicv3_its_common.c
hw/intc/arm_gicv3_its_kvm.c
include/hw/intc/arm_gicv3_its_common.h