From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhenyu Wang Subject: Re: [PATCH] intel: make sure VG_CLEAR() will always do memory clear Date: Wed, 20 Nov 2013 23:53:54 +0800 Message-ID: <20131120155354.GA24338@zhen-hp.sh.intel.com> References: <1384939368-17291-1-git-send-email-zhenyuw@linux.intel.com> <20131120113620.GA32765@strange.amr.corp.intel.com> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0649842104==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 3298E106B3D for ; Wed, 20 Nov 2013 07:56:12 -0800 (PST) In-Reply-To: <20131120113620.GA32765@strange.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0649842104== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013.11.20 11:36:20 +0000, Damien Lespiau wrote: > On Wed, Nov 20, 2013 at 05:22:48PM +0800, Zhenyu Wang wrote: > > If valgrind is not available, current VG_CLEAR() would just ignore > > memory clear operation which might make invalid ioctl argument. So > > make sure VG_CLEAR() will always clear memory. > > --- > > intel/intel_bufmgr_gem.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c > > index df6fcec..389f73a 100644 > > --- a/intel/intel_bufmgr_gem.c > > +++ b/intel/intel_bufmgr_gem.c > > @@ -74,7 +74,7 @@ > > #define VG(x) > > #endif > > =20 > > -#define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s))) > > +#define VG_CLEAR(s) (memset(&s, 0, sizeof(s))) >=20 > VG_CLEAR() is really just for valgrind. If you need to set some specific > variable/field to 0 then you need to set it to 0 and not rely on > VG_CLEAR() to do it for you. >=20 ok, in valgrind case it does memory clear for ioctl args which I think is good behavior in non-valgrind case too. > What's the actual issue you have? >=20 During testing on recent get reset status ioctl, if !HAVE_VALGRIND, stats argument is not cleared, which failed in kernel check. --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --5vNYLRcllDrimb99 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iEYEARECAAYFAlKM2xIACgkQsQQaM014GCf0EgCfSpcAKdc4UTvoT+Ev650nXvvy Hl4AoIN/tCXrEIFG1sbHShefBKkcvQ1W =6+12 -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- --===============0649842104== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0649842104==--