Patchwork [29/49] x86: hflags is not modified at all, just save it directly

login
register
mail settings
Submitter Juan Quintela
Date Sept. 29, 2009, 8:48 p.m.
Message ID <91ca3957976b6d22a376d0de178e1157596c8604.1254255997.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/34480/
State Superseded
Headers show

Comments

Juan Quintela - Sept. 29, 2009, 8:48 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 target-i386/machine.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

Patch

diff --git a/target-i386/machine.c b/target-i386/machine.c
index ab31329..16dc4a2 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -27,7 +27,6 @@  void cpu_save(QEMUFile *f, void *opaque)
 {
     CPUState *env = opaque;
     uint16_t fptag, fpus, fpuc, fpregs_format;
-    uint32_t hflags;
     int32_t a20_mask;
     int32_t pending_irq;
     int i, bit;
@@ -38,8 +37,7 @@  void cpu_save(QEMUFile *f, void *opaque)
         qemu_put_betls(f, &env->regs[i]);
     qemu_put_betls(f, &env->eip);
     qemu_put_betls(f, &env->eflags);
-    hflags = env->hflags; /* XXX: suppress most of the redundant hflags */
-    qemu_put_be32s(f, &hflags);
+    qemu_put_be32s(f, &env->hflags);

     /* FPU */
     fpuc = env->fpuc;
@@ -201,7 +199,6 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
 {
     CPUState *env = opaque;
     int i, guess_mmx;
-    uint32_t hflags;
     uint16_t fpus, fpuc, fptag, fpregs_format;
     int32_t a20_mask;
     int32_t pending_irq;
@@ -213,7 +210,7 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
         qemu_get_betls(f, &env->regs[i]);
     qemu_get_betls(f, &env->eip);
     qemu_get_betls(f, &env->eflags);
-    qemu_get_be32s(f, &hflags);
+    qemu_get_be32s(f, &env->hflags);

     qemu_get_be16s(f, &fpuc);
     qemu_get_be16s(f, &fpus);
@@ -377,9 +374,6 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
         }
     }

-    /* XXX: ensure compatiblity for halted bit ? */
-    /* XXX: compute redundant hflags bits */
-    env->hflags = hflags;
     tlb_flush(env, 1);
     return 0;
 }