From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvBqi-0003lz-8L for qemu-devel@nongnu.org; Wed, 29 Oct 2008 10:16:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvBqg-0003lH-MI for qemu-devel@nongnu.org; Wed, 29 Oct 2008 10:16:39 -0400 Received: from [199.232.76.173] (port=55053 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvBqg-0003lA-EE for qemu-devel@nongnu.org; Wed, 29 Oct 2008 10:16:38 -0400 Received: from savannah.gnu.org ([199.232.41.3]:50768 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KvBqf-00050O-Nw for qemu-devel@nongnu.org; Wed, 29 Oct 2008 10:16:37 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KvBqb-0001v1-Ng for qemu-devel@nongnu.org; Wed, 29 Oct 2008 14:16:34 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KvBqb-0001ux-3g for qemu-devel@nongnu.org; Wed, 29 Oct 2008 14:16:33 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Wed, 29 Oct 2008 14:16:33 +0000 Subject: [Qemu-devel] [5570] Fix restore of older snapshots for target-i386 on big endian hosts Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/target-i386/machine.c Modified: trunk/target-i386/machine.c =================================================================== --- trunk/target-i386/machine.c 2008-10-28 18:22:59 UTC (rev 5569) +++ trunk/target-i386/machine.c 2008-10-29 14:16:31 UTC (rev 5570) @@ -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]);