Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org,
	Akash Goel <akash.goel@intel.com>,
	stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Force wmb() on using GTT io_mapping_map_wc
Date: Tue, 26 May 2015 09:49:15 +0100	[thread overview]
Message-ID: <20150526084915.GD20703@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <20150526080124.GF12971@phenom.ffwll.local>

On Tue, May 26, 2015 at 10:01:24AM +0200, Daniel Vetter wrote:
> On Mon, May 25, 2015 at 06:48:44PM +0100, Chris Wilson wrote:
> > Since the advent of mmap(wc), where we reused the same cache domain for
> > WC and GTT paths (oh, how I regret that double-edged advice), we need to
> > be extra cautious when using GTT iomap_wc internally. Since userspace maybe
> > modifying through the mmap(wc) and we then modify modifying through an
> > aliased WC path through the GTT, those writes may overlap and not be
> > visible to the other path. Easiest to trigger appears to be write the
> > batch through mmap(wc) and then attempt to perform reloc the GTT,
> > corruption quickly ensues.
> > 
> > v2: Be stricter and do a full mb() in case we are reading through one
> > path and about to write through the second path. Also, apply the
> > barriers on transitioning into the GTT domain as well to cover the white
> > lie asychronous cases.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Akash Goel <akash.goel@intel.com>
> > Cc: stable@vger.kernel.org
> 
> There are a lot more mb() and wmb() in the gem code. I count execlist,
> legacy rings, pwrite, set_domain and finish_gtt.

You have more than I have...
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2015-05-26  8:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 15:38 [PATCH] drm/i915: Force wmb() on using GTT io_mapping_map_wc Chris Wilson
2015-05-25 17:48 ` [PATCH v2] " Chris Wilson
2015-05-26  8:01   ` [Intel-gfx] " Daniel Vetter
2015-05-26  8:49     ` Chris Wilson [this message]
2015-05-26  9:56       ` Daniel Vetter
2015-05-26  9:59         ` Chris Wilson

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=20150526084915.GD20703@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=akash.goel@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox