Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CRUGP-0000tn-2l for qemu-devel@nongnu.org; Tue, 09 Nov 2004 06:34:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CRUGO-0000tb-MM for qemu-devel@nongnu.org; Tue, 09 Nov 2004 06:34:16 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRUGO-0000tY-J5 for qemu-devel@nongnu.org; Tue, 09 Nov 2004 06:34:16 -0500 Received: from [213.95.27.120] (helo=ganesha.gnumonks.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CRU7U-0007Jm-JV for qemu-devel@nongnu.org; Tue, 09 Nov 2004 06:25:04 -0500 Received: from dsl-082-083-224-157.arcor-ip.net ([82.83.224.157] helo=sunbeam.gnumonks.org) by ganesha.gnumonks.org with asmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1CRU7R-0003KT-G6 for qemu-devel@nongnu.org; Tue, 09 Nov 2004 12:25:01 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.34) id 1CRU7P-0008R4-OM for qemu-devel@nongnu.org; Tue, 09 Nov 2004 12:24:59 +0100 Date: Tue, 9 Nov 2004 12:24:59 +0100 From: Harald Welte Message-ID: <20041109112459.GV22257@sunbeam.de.gnumonks.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2uzDqHpccQJpqF2n" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] fix bug in host_to_target_bitmask 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 --2uzDqHpccQJpqF2n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! While running software in i386 user mode emulation on my PPC box, I discovered that fcntl(F_GETFL) always returned (O_RDWR|O_WRONLY) instead of just O_RDWR. Some debugging code inside syscall.c confirmed that 0x02 was erroneously converted to 0x03. After some reading through the code, I found that host_to_target_bitmask() erroneously uses x86_mask instead of x86_bits. Please apply the following fix: diff -u -r1.4 thunk.c --- qemu/thunk.c 15 Jun 2003 19:52:54 -0000 1.4 +++ qemu/thunk.c 9 Nov 2004 11:24:34 -0000 @@ -236,7 +236,7 @@ =20 for(btp =3D trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) { if((alpha_mask & btp->alpha_mask) =3D=3D btp->alpha_bits) { - x86_mask |=3D btp->x86_mask; + x86_mask |=3D btp->x86_bits; } } return(x86_mask); --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --2uzDqHpccQJpqF2n Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBkKkLXaXGVTD0i/8RAgfcAJ0Tr9BbFd+CfVxAg5JO7JLSSaiUxQCeI+8G zDJHkBpIdt/s8abMjNVLJ8c= =eZ3a -----END PGP SIGNATURE----- --2uzDqHpccQJpqF2n--