From 729c6759ff6208668cd58fb136e925004d39d8e3 Mon Sep 17 00:00:00 2001 From: aurel32 Date: Wed, 10 Dec 2008 15:02:16 +0000 Subject: [PATCH] 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 Signed-off-by: Kevin Wolf Signed-off-by: Aurelien Jarno git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5963 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-i386/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index 423fca3..0fd509a 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -6165,6 +6165,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) 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 */ -- 2.7.4