From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1LTR-0006hm-KW for qemu-devel@nongnu.org; Tue, 05 May 2009 10:18:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1LTQ-0006gG-1n for qemu-devel@nongnu.org; Tue, 05 May 2009 10:18:20 -0400 Received: from [199.232.76.173] (port=40176 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1LTP-0006g2-VZ for qemu-devel@nongnu.org; Tue, 05 May 2009 10:18:20 -0400 Received: from naru.obs2.net ([84.20.150.76]:57995) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M1LTP-0006Qb-Ar for qemu-devel@nongnu.org; Tue, 05 May 2009 10:18:19 -0400 Date: Tue, 5 May 2009 17:18:17 +0300 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH] Revived GUEST_BASE support for usermode emulation targets [v3] Message-ID: <20090505141817.GA31454@kos.to> References: <1241028203-19687-1-git-send-email-riku.voipio@iki.fi> <20090505132743.GA29021@kos.to> <200905051453.32092.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <200905051453.32092.paul@codesourcery.com> Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: mika.westerberg@iki.fi, qemu-devel@nongnu.org On Tue, May 05, 2009 at 02:53:31PM +0100, Paul Brook wrote: > On Tuesday 05 May 2009, Riku Voipio wrote: > > +++ b/tcg/x86_64/tcg-target.c > > @@ -616,15 +616,15 @@ static void tcg_out_qemu_ld(TCGContext *s, cons= t > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* movzbl */ > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0tcg_out_modrm_offset(s, 0xb6 | P_EXT, da= ta_reg, r0, 0); > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0tcg_out_modrm_offset(s, 0xb6 | P_EXT, da= ta_reg, r0, GUEST_BASE); > This breaks when GUEST_BASE is large. usually we don't set it to very large, just high enough to overcome mmap_min_addr limits. > 32-bit x86 is probably ok because GUEST_BASE is always a 32-bit value. = This is=20 > not true for x86-64. Incidentally tcg_out_modrm doesn't seem to check t= his,=20 > and silently generates broken code. Should we rather check for a mazimum size on guest_base or revert to the = lea -based version?