From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Prevent context obj from being corrupted Date: Wed, 26 Mar 2014 08:04:38 +0100 Message-ID: <20140326070438.GQ26878@phenom.ffwll.local> References: <1395799310-21412-1-git-send-email-benjamin.widawsky@linux.intel.com> <20140326062416.GP26878@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f46.google.com (mail-ee0-f46.google.com [74.125.83.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E4366E1C5 for ; Wed, 26 Mar 2014 00:04:45 -0700 (PDT) Received: by mail-ee0-f46.google.com with SMTP id t10so1241067eei.5 for ; Wed, 26 Mar 2014 00:04:43 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140326062416.GP26878@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Ben Widawsky Cc: Intel GFX List-Id: intel-gfx@lists.freedesktop.org On Wed, Mar 26, 2014 at 07:24:16AM +0100, Daniel Vetter wrote: > On Tue, Mar 25, 2014 at 07:01:50PM -0700, Ben Widawsky wrote: > > While the context is not being used, we can make the PTEs invalid, so > > nothing can accidentally corrupt it. Systems tend to have a lot of > > trouble when the context gets corrupted. > > > > NOTE: This is a slightly different patch than what I posted to Bugzilla. > > > > References: https://bugs.freedesktop.org/show_bug.cgi?id=75724 > > Signed-off-by: Ben Widawsky > > We could stop the aliasing ppgtt binder from always binding into the > ppgtt. Which is the bug I'm signed up to fix, and which probably curbs 99% > of all potential corruption. The last 1% is the kernel getting his > kmapping wrong ... Actually your patch doesn't accomplish much, since MI_UPDATE_GTT only updates the global gtt, not the aliasing ppgtt. Which means that userspace batches can still happily stomp all over your precious context objects. See comment #5 in that bug report: https://bugs.freedesktop.org/show_bug.cgi?id=75724#c5 Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch