mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
kvm: Enable XSAVE live migration support
Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
51e49430c0
commit
f1665b21f1
5 changed files with 186 additions and 3 deletions
21
kvm-all.c
21
kvm-all.c
|
@ -71,6 +71,7 @@ struct KVMState
|
|||
#endif
|
||||
int irqchip_in_kernel;
|
||||
int pit_in_kernel;
|
||||
int xsave, xcrs;
|
||||
};
|
||||
|
||||
static KVMState *kvm_state;
|
||||
|
@ -686,6 +687,16 @@ int kvm_init(int smp_cpus)
|
|||
s->debugregs = kvm_check_extension(s, KVM_CAP_DEBUGREGS);
|
||||
#endif
|
||||
|
||||
s->xsave = 0;
|
||||
#ifdef KVM_CAP_XSAVE
|
||||
s->xsave = kvm_check_extension(s, KVM_CAP_XSAVE);
|
||||
#endif
|
||||
|
||||
s->xcrs = 0;
|
||||
#ifdef KVM_CAP_XCRS
|
||||
s->xcrs = kvm_check_extension(s, KVM_CAP_XCRS);
|
||||
#endif
|
||||
|
||||
ret = kvm_arch_init(s, smp_cpus);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
@ -1014,6 +1025,16 @@ int kvm_has_debugregs(void)
|
|||
return kvm_state->debugregs;
|
||||
}
|
||||
|
||||
int kvm_has_xsave(void)
|
||||
{
|
||||
return kvm_state->xsave;
|
||||
}
|
||||
|
||||
int kvm_has_xcrs(void)
|
||||
{
|
||||
return kvm_state->xcrs;
|
||||
}
|
||||
|
||||
void kvm_setup_guest_memory(void *start, size_t size)
|
||||
{
|
||||
if (!kvm_has_sync_mmu()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue