mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
spapr/xive: add migration support for KVM
When the VM is stopped, the VM state handler stabilizes the XIVE IC and marks the EQ pages dirty. These are then transferred to destination before the transfer of the device vmstates starts. The SpaprXive interrupt controller model captures the XIVE internal tables, EAT and ENDT and the XiveTCTX model does the same for the thread interrupt context registers. At restart, the SpaprXive 'post_load' method restores all the XIVE states. It is called by the sPAPR machine 'post_load' method, when all XIVE states have been transferred and loaded. Finally, the source states are restored in the VM change state handler when the machine reaches the running state. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20190513084245.25755-7-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
9b88cd7673
commit
277dd3d771
6 changed files with 140 additions and 2 deletions
|
@ -582,10 +582,27 @@ static void xive_tctx_unrealize(DeviceState *dev, Error **errp)
|
|||
qemu_unregister_reset(xive_tctx_reset, dev);
|
||||
}
|
||||
|
||||
static int vmstate_xive_tctx_pre_save(void *opaque)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (kvm_irqchip_in_kernel()) {
|
||||
kvmppc_xive_cpu_get_state(XIVE_TCTX(opaque), &local_err);
|
||||
if (local_err) {
|
||||
error_report_err(local_err);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_xive_tctx = {
|
||||
.name = TYPE_XIVE_TCTX,
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.pre_save = vmstate_xive_tctx_pre_save,
|
||||
.post_load = NULL, /* handled by the sPAPRxive model */
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_BUFFER(regs, XiveTCTX),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue