Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAQaL-0006mh-Cn for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:02:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAQaK-0006kl-D8 for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:02:44 -0500 Received: from [199.232.76.173] (port=58871 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAQaK-0006kM-6a for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:02:44 -0500 Received: from hall.aurel32.net ([88.191.82.174]:57763) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAQaJ-0007H9-GI for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:02:43 -0500 Date: Wed, 10 Dec 2008 16:02:40 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Fix jmp im on x86_64 when executing 32-bit code Message-ID: <20081210150240.GB19379@volta.aurel32.net> References: <493E6F2B.5090300@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <493E6F2B.5090300@suse.de> 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 Cc: kwolf@suse.de 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 > Signed-off-by: Kevin Wolf > > 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 `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net