From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XM5jH-0007UF-BZ 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-0005kP-BV for qemu-devel@nongnu.org; Mon, 25 Aug 2014 21:39:23 -0400 Date: Tue, 26 Aug 2014 10:39:34 +1000 From: David Gibson Message-ID: <20140826003934.GE9923@voom.redhat.com> References: <1407869623-11185-1-git-send-email-tommusta@gmail.com> <1407869623-11185-5-git-send-email-tommusta@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IU5/I01NYhRvwH70" Content-Disposition: inline In-Reply-To: <1407869623-11185-5-git-send-email-tommusta@gmail.com> Subject: Re: [Qemu-devel] [V2 PATCH 04/12] linux-user: Make ipc syscall's third argument an abi_long 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 --IU5/I01NYhRvwH70 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 12, 2014 at 01:53:35PM -0500, Tom Musta wrote: > For those target ABIs that use the ipc system call (e.g. POWER), > the third argument is used in the shmat path as a pointer. It > therefore must be declared as an abi_long (versus int) so that > the address bits are not lost in truncation. In fact, all arguments > to do_ipc should be declared as abit_long. >=20 > In fact, it makes more sense for all of the arguments to be declaried > as abi_long (except call). >=20 > Signed-off-by: Tom Musta > --- > V2: Changed all do_ipc arguments (except "call") to abi_long per Peter > Maydell's review. So, that certainly makes sense for second and third. But 'first' really is defined as 'int' in the kernel source; what's the reason for using a long here? >=20 > linux-user/syscall.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index bee1f4e..3a4f432 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -3125,8 +3125,8 @@ static inline abi_long do_shmdt(abi_ulong shmaddr) > #ifdef TARGET_NR_ipc > /* ??? This only works with linear mappings. */ > /* do_ipc() must return target values and target errnos. */ > -static abi_long do_ipc(unsigned int call, int first, > - int second, int third, > +static abi_long do_ipc(unsigned int call, abi_long first, > + abi_long second, abi_long third, > abi_long ptr, abi_long fifth) > { > int version; > @@ -3148,9 +3148,9 @@ static abi_long do_ipc(unsigned int call, int first, > /* The semun argument to semctl is passed by value, so dereferen= ce the > * ptr argument. */ > abi_ulong atptr; > - get_user_ual(atptr, (abi_ulong)ptr); > + get_user_ual(atptr, ptr); > ret =3D do_semctl(first, second, third, > - (union target_semun)(abi_ulong) atptr); > + (union target_semun) atptr); > break; > } > =20 --=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 --IU5/I01NYhRvwH70 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJT+9dGAAoJEGw4ysog2bOS9tsQAJJxRnBLHZj3bdQYXbLu7ZuT f/5vQMp/y5DTef/cO9wL4DDswAlquP8TeX7Y/V44qa0QUqnBtsGw6POLzkh+rUCW k4i6lSGSSiN80D1QLsuSTHABKzJSGzatYVaH3TgsrVoVgwuqJTlBGixwbVlnD/Ib VYsLVhS00Myim2kpENEUlJ9LVfGnJQi9fakUTfISxKFIYRBNqgDshGwod91iKJaQ QqlcJTCLE5MKtjSzNKbfUoz2/hBWbx/Zlp19jGXzat3wTlLOszYL/FqMPYtcuFHB DKZpyJPKlKgkNEsznyi2I+yyFPtHG3+KvIb4iU/cgKUmaAbxjlLc16pYP5wR5Huz MS28IGOF3FNZ1TSpCT3lP9q+t6/LB78XnIfyShC6szJ5kysDe4sgu0Ea+DZTJK28 9NYinqjXq1x0nOY4iBSgAPHcb38fxrPTY83hwM6PH/fb2WVZnilbYeufYiNRbHht gE12gsIsJfrn73UbEe8n162znYBj0kaMHZovORXA6x+f/g7XhUsPNylluU/aOLzM SUvC/iD1Co9Sr7GITHvKZIpwtnErwP5b1DC+Z+lNOiEeR3Tcj07jnkDY5vL2Z3Xr FhScNmrkz8E/RBWmQZIuJxtGB3l+eKOKle7yb1BVFdcv2eZ2dbyNeKOs2wr/zcx0 IWiZJZdgUM4ugguLTIql =25ek -----END PGP SIGNATURE----- --IU5/I01NYhRvwH70--