Skip to contentSkip to conversation

[5570] Fix restore of older snapshots for target-i386 on big endian hosts

Qemu-devel Anthony Liguori 1 participant 1 message Oct 29, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5570

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5570
Author:   aliguori
Date:     2008-10-29 14:16:31 +0000 (Wed, 29 Oct 2008)

Log Message:
-----------
Fix restore of older snapshots for target-i386 on big endian hosts

A target_ulong may be 64-bit. Passing it to a function expecting a 32-bit pointer is wrong and unfortunately happens to work for x86. It won't work on big endian hosts though. Change the code to work properly on all hosts.

Modified Paths:
--------------

    trunk/target-i386/machine.c

Modified: trunk/target-i386/machine.c
===================================================================

target-i386/machine.c +2 -2
@@ -248,8 +248,8 @@
         qemu_get_betls(f, &env->sysenter_esp);
         qemu_get_betls(f, &env->sysenter_eip);
     } else {
-        qemu_get_be32s(f, &env->sysenter_esp);
-        qemu_get_be32s(f, &env->sysenter_eip);
+        env->sysenter_esp = qemu_get_be32(f);
+        env->sysenter_eip = qemu_get_be32(f);
     }
 
     qemu_get_betls(f, &env->cr[0]);