qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [5963] target-i386: Fix jmp im on x86_64 when executing 32-


From: Aurelien Jarno
Subject: [Qemu-devel] [5963] target-i386: Fix jmp im on x86_64 when executing 32-bit code
Date: Wed, 10 Dec 2008 15:02:16 +0000

Revision: 5963
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5963
Author:   aurel32
Date:     2008-12-10 15:02:16 +0000 (Wed, 10 Dec 2008)

Log Message:
-----------
target-i386: Fix jmp im on x86_64 when executing 32-bit code

When running grub-install (32-bit) on an x86_64 Linux system in qemu, it
hangs on a pagefault forever, because an integer overflow occurs on the
IP on "jmp im". This patch masks overflows for 32 bit IPs on a 64 bit
system, just like it is done for 16 bit IPs already.

Using this patch, x86_64 openSUSE installation works again.

Signed-off-by: Alexander Graf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>

Modified Paths:
--------------
    trunk/target-i386/translate.c

Modified: trunk/target-i386/translate.c
===================================================================
--- trunk/target-i386/translate.c       2008-12-10 15:02:07 UTC (rev 5962)
+++ trunk/target-i386/translate.c       2008-12-10 15:02:16 UTC (rev 5963)
@@ -6165,6 +6165,8 @@
         tval += s->pc - s->cs_base;
         if (s->dflag == 0)
             tval &= 0xffff;
+        else if(!CODE64(s))
+            tval &= 0xffffffff;
         gen_jmp(s, tval);
         break;
     case 0xea: /* ljmp im */






reply via email to

[Prev in Thread] Current Thread [Next in Thread]