From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitry V. Levin" Subject: Re: [PATCH 3/4] drm: Add decoding of i915 ioctls Date: Sat, 13 Jun 2015 02:48:54 +0300 Message-ID: <20150612234854.GB17226@altlinux.org> References: <1433849204-4125-1-git-send-email-patrik.jakobsson@linux.intel.com> <1433849204-4125-4-git-send-email-patrik.jakobsson@linux.intel.com> <20150609223535.GB3210@altlinux.org> <20150610124524.GB18221@rpjakobs-ThinkCentre-E73> <20150610232711.GB19231@altlinux.org> <20150611133414.GA2939@rpjakobs-ThinkCentre-E73> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0208217762==" Return-path: Received: from pegasus3.altlinux.org (pegasus3.altlinux.org [194.107.17.103]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BB8C6EB40 for ; Fri, 12 Jun 2015 16:48:55 -0700 (PDT) In-Reply-To: <20150611133414.GA2939@rpjakobs-ThinkCentre-E73> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: strace-devel@lists.sourceforge.net, intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0208217762== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aM3YZ0Iwxop3KEKx" Content-Disposition: inline --aM3YZ0Iwxop3KEKx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 11, 2015 at 03:34:14PM +0200, Patrik Jakobsson wrote: > On Thu, Jun 11, 2015 at 02:27:12AM +0300, Dmitry V. Levin wrote: > > On Wed, Jun 10, 2015 at 02:45:24PM +0200, Patrik Jakobsson wrote: > > > On Wed, Jun 10, 2015 at 01:35:35AM +0300, Dmitry V. Levin wrote: > > > > On Tue, Jun 09, 2015 at 01:26:43PM +0200, Patrik Jakobsson wrote: > > [...] > > > > > +static int i915_setparam(struct tcb *tcp, const unsigned int cod= e, long arg) > > > > > +{ > > > > > + struct drm_i915_setparam param; > > > > > + > > > > > + if (exiting(tcp) || umove(tcp, arg, ¶m)) > > > > > + return 0; > > > >=20 > > > > In this and other ioctl printers that unconditionally return 0 on e= xit, > > > > wouldn't the caller treat it as an ioctl that hasn't been printed? > > >=20 > > > Yes, seems like the exiting phase should return 1 if already handled = in the > > > entering phase. But changing it produces the same output for some rea= son. Not > > > sure what's going on here. > >=20 > > Isn't tcp->u_arg[2] printed twice, the first time decoded, > > and the second time in hex? >=20 > My mistake, it does print u_arg[2] in hex as well. Luckily they could all= be > moved to the exiting phase instead. Fixed in v2. The common rule is to decode as early as possible, consequently, all syscall arguments that could be decoded on entering syscall should be decoded on entering rather than on exiting. All syscall arguments of _IOW ioctl commands could be fully decoded on entering syscall. --=20 ldv --aM3YZ0Iwxop3KEKx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlV7b+YACgkQfKvmrJ41Nh5llgCeI6VN898LseCpuhsMPLE/8mZr u4cAoKqAF0rmlCdKSuwA/dHdY/BD1McK =P4hD -----END PGP SIGNATURE----- --aM3YZ0Iwxop3KEKx-- --===============0208217762== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0208217762==--