From: Damien Lespiau Subject: Re: [PATCH] intel: make sure VG_CLEAR() will always do memory clear Date: Wed, 20 Nov 2013 16:59:22 +0000 Message-ID: <20131120165922.GC32765@strange.amr.corp.intel.com> References: <1384939368-17291-1-git-send-email-zhenyuw@linux.intel.com> <20131120113620.GA32765@strange.amr.corp.intel.com> <20131120155354.GA24338@zhen-hp.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B4201059A5 for ; Wed, 20 Nov 2013 08:59:24 -0800 (PST) Content-Disposition: inline In-Reply-To: <20131120155354.GA24338@zhen-hp.sh.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: Zhenyu Wang Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Nov 20, 2013 at 11:53:54PM +0800, Zhenyu Wang wrote: > > 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. > > > > ok, in valgrind case it does memory clear for ioctl args which I think is > good behavior in non-valgrind case too. Ian just submitted a patch that memset the whole structure. > > What's the actual issue you have? > > > > During testing on recent get reset status ioctl, if !HAVE_VALGRIND, stats > argument is not cleared, which failed in kernel check. Right, so the fix is (was) to zero the fields checked by the kernel explicitely, not change the VG() macro, which is just used in testing (and it should this way). HTH, -- Damien