mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 05:51:53 -06:00
kvm: x86: Save/restore KVM-specific CPU states
Save and restore all so far neglected KVM-specific CPU states. Handling the TSC stabilizes migration in KVM mode. The interrupt_bitmap and mp_state are currently unused, but will become relevant for in-kernel irqchip support. By including proper saving/restoring already, we avoid having to increment CPU_SAVE_VERSION later on once again. v2: - initialize mp_state runnable (for the boot CPU) Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
d33a1810d7
commit
f8d926e9cd
5 changed files with 49 additions and 3 deletions
20
kvm-all.c
20
kvm-all.c
|
@ -181,6 +181,26 @@ err:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int kvm_put_mp_state(CPUState *env)
|
||||
{
|
||||
struct kvm_mp_state mp_state = { .mp_state = env->mp_state };
|
||||
|
||||
return kvm_vcpu_ioctl(env, KVM_SET_MP_STATE, &mp_state);
|
||||
}
|
||||
|
||||
int kvm_get_mp_state(CPUState *env)
|
||||
{
|
||||
struct kvm_mp_state mp_state;
|
||||
int ret;
|
||||
|
||||
ret = kvm_vcpu_ioctl(env, KVM_GET_MP_STATE, &mp_state);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
env->mp_state = mp_state.mp_state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kvm_sync_vcpus(void)
|
||||
{
|
||||
CPUState *env;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue