From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 04/12] drm/i915: Don't unconditionally try to deref aliasing ppgtt Date: Mon, 25 Nov 2013 10:10:28 -0800 Message-ID: <20131125181028.GB8797@bwidawsk.net> References: <1385402083-8719-1-git-send-email-benjamin.widawsky@intel.com> <1385402083-8719-5-git-send-email-benjamin.widawsky@intel.com> <20131125180618.GI21316@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id B38A4FAFC2 for ; Mon, 25 Nov 2013 10:10:31 -0800 (PST) Content-Disposition: inline In-Reply-To: <20131125180618.GI21316@nuc-i3427.alporthouse.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: Chris Wilson , Ben Widawsky , Intel GFX List-Id: intel-gfx@lists.freedesktop.org On Mon, Nov 25, 2013 at 06:06:18PM +0000, Chris Wilson wrote: > On Mon, Nov 25, 2013 at 09:54:35AM -0800, Ben Widawsky wrote: > > Since the beginning, the functions which try to properly reference the > > aliasing PPGTT have deferences a potentially null aliasing_ppgtt member. > > Since the accessors are meant to be global, this will not do. > > > > Introduced originally in: > > commit a70a3148b0c61cb7c588ea650db785b261b378a3 > > Author: Ben Widawsky > > Date: Wed Jul 31 16:59:56 2013 -0700 > > > > drm/i915: Make proper functions for VMs > > > > Signed-off-by: Ben Widawsky > > --- > > drivers/gpu/drm/i915/i915_gem.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > > index 40d9dcf..bc5c865 100644 > > --- a/drivers/gpu/drm/i915/i915_gem.c > > +++ b/drivers/gpu/drm/i915/i915_gem.c > > @@ -4971,7 +4971,8 @@ unsigned long i915_gem_obj_offset(struct drm_i915_gem_object *o, > > struct drm_i915_private *dev_priv = o->base.dev->dev_private; > > struct i915_vma *vma; > > > > - if (vm == &dev_priv->mm.aliasing_ppgtt->base) > > + if (!dev_priv->mm.aliasing_ppgtt || > > + vm == &dev_priv->mm.aliasing_ppgtt->base) > > Where's the dereference? gcc is smarter than your average bear. > -Chris I had assumed: dev_priv->mm.aliasing_ppgtt->base in cases when aliasing_ppgtt was NULL. Given that I never actually hit this, I agree GCC must be doing something. Is such behavior documented somewhere? (forgive the lazy) > > -- > Chris Wilson, Intel Open Source Technology Centre -- Ben Widawsky, Intel Open Source Technology Center