aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-06-17 17:53:07 +0800
committerMarcelo Tosatti <mtosatti@redhat.com>2010-06-28 13:06:03 -0300
commitf1665b21f16c5dc0ac37de60233a4975aff31193 (patch)
tree0e19f8cd7e54a5aa7dced550c52a296fddb42292 /kvm-all.c
parentEnable XSAVE related CPUID (diff)
downloadqemu-kvm-f1665b21f16c5dc0ac37de60233a4975aff31193.tar.gz
qemu-kvm-f1665b21f16c5dc0ac37de60233a4975aff31193.tar.bz2
qemu-kvm-f1665b21f16c5dc0ac37de60233a4975aff31193.zip
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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 5684e515a..938030230 100644
--- a/kvm-all.c
+++ b/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()) {