All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915/userptr: Never allow userptr into the mappable GGTT
Date: Mon, 30 Sep 2019 12:17:39 +0100	[thread overview]
Message-ID: <156984225982.1880.15060055639771073589@skylake-alporthouse-com> (raw)
In-Reply-To: <51720124-9c90-04c4-2bff-4e067fba7ebb@linux.intel.com>

Quoting Tvrtko Ursulin (2019-09-30 11:33:22)
> 
> On 28/09/2019 09:25, Chris Wilson wrote:
> > Daniel Vetter uncovered a nasty cycle in using the mmu-notifiers to
> > invalidate userptr objects which also happen to be pulled into GGTT
> > mmaps. That is when we unbind the userptr object (on mmu invalidation),
> > we revoke all CPU mmaps, which may then recurse into mmu invalidation.
> 
> On the same object? Invalidate on userptr built from some mmap_gtt area, 
> or standard userptr object mmapped via gtt? Or one userptr object built 
> from a mmap_gtt of another userptr object?

Yup, think of the multiple partial mmaps we have on the same object. If
we invalidate the mmap_offset, we may hit the same object again in
mmu-invalidate. As far as my understanding goes, there is nothing in
the munmap/invalidate that prevents this. Although, having the same
pages mapped into different process is not unusual, so you would think
we are not alone in having device pages in multiple mappings? There
might be something more at play here, but Daniel's lockdep patch is
straightforward: no recursion allowed in mmu-invalidate.

> Will anything change here after the struct mutex removal series? AFAIR 
> you remove struct mutex from userptr invalidation there.

No. This, aiui, is purely an issue where we trigger an mmu-invalidate
from inside the mmu_invalidate_range_start.
 
[snip]

> I remember in the distant past we discussed whether or not to allow 
> this. It is indeed a quite perverse setup so I am okay with disallowing it.
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Regards,
> 
> Tvrtko
> 
> P.S. I expect there will be some IGTs to be adjusted as well.

Yup. This was to start the ball rolling as come rc1 we will have some
fire-fighting to do.
-Chris

  reply	other threads:[~2019-09-30 11:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27 16:34 [PATCH] drm/i915/userptr: Never allow userptr into the mappable GGTT Chris Wilson
2019-09-27 16:42 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-09-27 17:05 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-28  8:05 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-09-28  8:25 ` [PATCH v2] " Chris Wilson
2019-09-30 10:33   ` [Intel-gfx] " Tvrtko Ursulin
2019-09-30 11:17     ` Chris Wilson [this message]
2019-09-28  8:35 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/userptr: Never allow userptr into the mappable GGTT (rev2) Patchwork
2019-09-28  9:25 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-28 19:13 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-09-28 20:03 ` [PATCH] drm/i915/userptr: Never allow userptr into the mappable GGTT Sasha Levin
2019-10-01  9:39 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/userptr: Never allow userptr into the mappable GGTT (rev3) Patchwork
2019-10-01 10:06 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-01 13:40 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=156984225982.1880.15060055639771073589@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.