]> git.proxmox.com Git - qemu.git/commitdiff
x86: fix migration from pre-version 12
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 13 Sep 2013 13:55:57 +0000 (15:55 +0200)
committerGleb Natapov <gleb@redhat.com>
Wed, 2 Oct 2013 15:58:23 +0000 (18:58 +0300)
On KVM, the KVM_SET_XSAVE would be executed with a 0 xstate_bv,
and not restore anything.

Since FP and SSE data are always valid, set them in xstate_bv at reset
time.  In fact, that value is the same that KVM_GET_XSAVE returns on
pre-XSAVE hosts.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
target-i386/cpu.c
target-i386/cpu.h

index b6828022bc26ec62b8ac7a23128b1bf42173d4b4..ea99b2692d97dad51ec6fa982e54d7cb4cf85c30 100644 (file)
@@ -2405,6 +2405,7 @@ static void x86_cpu_reset(CPUState *s)
     env->fpuc = 0x37f;
 
     env->mxcsr = 0x1f80;
+    env->xstate_bv = XSTATE_FP | XSTATE_SSE;
 
     env->pat = 0x0007040600070406ULL;
     env->msr_ia32_misc_enable = MSR_IA32_MISC_ENABLE_DEFAULT;
index 5723eff9a8fb344ef0db35fdc671f4ea9baebecf..ea373e82dc8cad81177dba7659d5fe7a825dec46 100644 (file)
 
 #define MSR_VM_HSAVE_PA                 0xc0010117
 
+#define XSTATE_FP                       1
+#define XSTATE_SSE                      2
+#define XSTATE_YMM                      4
+
 /* CPUID feature words */
 typedef enum FeatureWord {
     FEAT_1_EDX,         /* CPUID[1].EDX */