Skip to contentSkip to conversation

kvm-x86: Remove eflags conversion into emulator format

PATCH Applied Jan Kiszka 2 participants 2 messages Jan 26, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 kvm-x86: Remove eflags conversion into emulator format

It seems that the conversion of the kernel-delivered eflags state into qemu's internal split representation was once needed in an older kvm design (register read-back may have taken place from inside cpu_exec). Today it is plain wrong and causes incorrect cpu state reporting (gdb, monitor) and should also corrupt its saving (savevm, migration). Drop the related lines.

---

 target-i386/kvm.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
target-i386/kvm.c +0 -4
index 88c3137..47723f2 100644
@@ -446,10 +446,6 @@ static int kvm_get_sregs(CPUState *env)
             }
     }
     env->hflags = (env->hflags & HFLAG_COPY_MASK) | hflags;
-    env->cc_src = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
-    env->df = 1 - (2 * ((env->eflags >> 10) & 1));
-    env->cc_op = CC_OP_EFLAGS;
-    env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
 
     return 0;
 }
#1 lore raw
Quoted 9 lines · Jan Kiszka

It seems that the conversion of the kernel-delivered eflags state into qemu's internal split representation was once needed in an older kvm design (register read-back may have taken place from inside cpu_exec). Today it is plain wrong and causes incorrect cpu state reporting (gdb, monitor) and should also corrupt its saving (savevm, migration). Drop the related lines.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 24 lines

---

 target-i386/kvm.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
target-i386/kvm.c +0 -4
index 88c3137..47723f2 100644
@@ -446,10 +446,6 @@ static int kvm_get_sregs(CPUState *env)
             }
     }
     env->hflags = (env->hflags & HFLAG_COPY_MASK) | hflags;
-    env->cc_src = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
-    env->df = 1 - (2 * ((env->eflags >> 10) & 1));
-    env->cc_op = CC_OP_EFLAGS;
-    env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
 
     return 0;
 }