From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XM5jH-0007UH-MV for qemu-devel@nongnu.org; Mon, 25 Aug 2014 21:39:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XM5jF-0005kW-Cb for qemu-devel@nongnu.org; Mon, 25 Aug 2014 21:39:23 -0400 Date: Tue, 26 Aug 2014 10:36:34 +1000 From: David Gibson Message-ID: <20140826003634.GD9923@voom.redhat.com> References: <1407869623-11185-1-git-send-email-tommusta@gmail.com> <1407869623-11185-4-git-send-email-tommusta@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZJcv+A0YCCLh2VIg" Content-Disposition: inline In-Reply-To: <1407869623-11185-4-git-send-email-tommusta@gmail.com> Subject: Re: [Qemu-devel] [V2 PATCH 03/12] linux-user: Properly Handle semun Structure In Cross-Endian Situations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tom Musta Cc: peter.maydell@linaro.org, riku.voipio@linaro.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de --ZJcv+A0YCCLh2VIg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 12, 2014 at 01:53:34PM -0500, Tom Musta wrote: > The semun union used in the semctl system call contains both an int (val)= and > pointers. In cross-endian situations on 64 bit targets, the value passed= to > semctl is an 8 byte (abi_long) value and thus does not have the 4-byte val > field in the correct location. In order to rectify this, the other half > of the union must be accessed. This is achieved in code by performing > a byte swap on the entire 8 byte union, followed by a 4-byte swap of the > first half. >=20 > Also, eliminate an extraneous (dead) line of code that sets target_su.val= in > the IPC_SET/IPC_GET case. >=20 > Signed-off-by: Tom Musta Reviewed-by: David Gibson --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --ZJcv+A0YCCLh2VIg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJT+9aSAAoJEGw4ysog2bOSHgQQANZkZ1scaEshZd4hFoc4g0Kc oeu3pVgQMIfbBg6iM/qPSVUi68rTUTqHvdsCg9X6DZb26sT0sTBDIoQFkWZC/Xj/ ACfIg91QsC7SGylwQ4vr6+1s6GpAfecRjZx6FrrHVtAeUO7Dvr2dndSv1PNMPs0v gTQXgaPZcoq2GQlmDV+iD733BHVBbcdYGQSkVtaPNV3DcRxGdbb1fiOmUdWjMlhU bg/NtpHOx63xXsTXs68ziQIu3u/Ll0CffrgAyH4QEhu9vcZot0i2QpRoQRZAeILl zvYPo8gEHZdqjLLMyRAz/WKH/cmYp/3LYu1sjEPnqBIz6qcRQq4FhTxLVK1tClHh 2Pb3fsIVq1XGQgYKbbrAnuJ9nev3tC/o7DN8qIY/T8LbDpF/6clj8NnFsUdqRByK WgYmrllkdAt0vQygGuJN+FeDCfSKjWQztLspOolTw9eS5kBLdm52+OzCzqneIv3E AsPAuK/EagKSZcHPI//8E2hFKtkcyXxkbv5BPJnQ4WLbweos341ebmSaimldCAMK VKjCkWchM4Ygle/rPXVaatte2+iOWILNZ1Wh63GyrAlK69nMrHGYwPXBjU5wgWHm 7L/l1ZX28bVel1S0EeFHry82xTJjE6AZuRStwkTSeJ/xt1/qcUZzUnKvvZeX6CS7 0YrXReQlsVu/Rkh7ey9J =TBzo -----END PGP SIGNATURE----- --ZJcv+A0YCCLh2VIg--