Skip to contentSkip to conversation

kvm stable updates for qemu 0.12.3

PATCH New Avi Kivity 1 participant 2 messages Feb 23, 2010 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

cover kvm stable updates for qemu 0.12.3

Just one patch, fixing eflags corruption. Also available from git:

git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/stable-0.12

Please pull.

Jan Kiszka (1):
kvm: Fix eflags corruption in kvm mode

 cpu-exec.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
author
#1 lore raw

PATCH 1/1 kvm: Fix eflags corruption in kvm mode

From: Jan Kiszka <[email protected]>

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.

---
 cpu-exec.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
cpu-exec.c +7 -5
index af4595b..3246c9e 100644
@@ -232,11 +232,13 @@ int cpu_exec(CPUState *env1)
 
     env_to_regs();
 #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;
Signature · 1 line
1.7.0