summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-02-19 18:21:20 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-23 14:07:57 -0600
commit43fab082108fa99a1dba15501cb8580ec21365ad (patch)
treee4147718b42c60dc1d42473b42fb754dd13a0756 /cpu-exec.c
parenttarget-mips: fix ROTR and DROTR by zero (diff)
downloadqemu-kvm-43fab082108fa99a1dba15501cb8580ec21365ad.tar.gz
qemu-kvm-43fab082108fa99a1dba15501cb8580ec21365ad.tar.bz2
qemu-kvm-43fab082108fa99a1dba15501cb8580ec21365ad.zip
kvm: Fix eflags corruption in kvm mode
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>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index af4595b65..3246c9e2c 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -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;