]> git.proxmox.com Git - qemu.git/commitdiff
kvm: Fix eflags corruption in kvm mode
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 19 Feb 2010 17:21:20 +0000 (18:21 +0100)
committerAvi Kivity <avi@redhat.com>
Sun, 21 Feb 2010 09:12:37 +0000 (11:12 +0200)
This should explain a lot of the weird breakages of upstream KVM we've
seen recently (actually we should have seen it much earlier):

Stop translating eflags into TCG format when in kvm mode as we never
translate it back and rather sync this broken state into the kernel.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
cpu-exec.c

index 6a290fd6cde591ba6af466ee6572d97a464f602c..4029ea25ff54983d172e8de7bd0b983f803c1b45 100644 (file)
@@ -228,11 +228,13 @@ int cpu_exec(CPUState *env1)
     env = env1;
 
 #if defined(TARGET_I386)
-    /* put eflags in CPU temporary format */
-    CC_SRC = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
-    DF = 1 - (2 * ((env->eflags >> 10) & 1));
-    CC_OP = CC_OP_EFLAGS;
-    env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
+    if (!kvm_enabled()) {
+        /* put eflags in CPU temporary format */
+        CC_SRC = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
+        DF = 1 - (2 * ((env->eflags >> 10) & 1));
+        CC_OP = CC_OP_EFLAGS;
+        env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
+    }
 #elif defined(TARGET_SPARC)
 #elif defined(TARGET_M68K)
     env->cc_op = CC_OP_FLAGS;