[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix jmp im on x86_64 when executing 32-bit code
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [PATCH] Fix jmp im on x86_64 when executing 32-bit code |
Date: |
Wed, 10 Dec 2008 16:02:40 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Tue, Dec 09, 2008 at 02:14:19PM +0100, Alexander Graf wrote:
> 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>
>
>
Thanks for your great work, it is something broken for a long time, and
it is nice to see that fixed. I have applied the patch to the SVN.
> Index: target-i386/translate.c
> ===================================================================
> --- target-i386/translate.c (revision 5959)
> +++ target-i386/translate.c (working copy)
> @@ -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 */
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' address@hidden | address@hidden
`- people.debian.org/~aurel32 | www.aurel32.net