diff options
author | Sheng Yang <sheng@linux.intel.com> | 2010-06-17 17:53:07 +0800 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-06-28 13:06:03 -0300 |
commit | f1665b21f16c5dc0ac37de60233a4975aff31193 (patch) | |
tree | 0e19f8cd7e54a5aa7dced550c52a296fddb42292 /kvm-all.c | |
parent | 51e49430c0472c9f609341e3058d47ed93dabe6e (diff) |
kvm: Enable XSAVE live migration support
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r-- | kvm-all.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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()) { |