]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
drm/i915: Evict CS TLBs between batches
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 8 Sep 2014 13:25:41 +0000 (14:25 +0100)
committerJani Nikula <jani.nikula@intel.com>
Mon, 8 Sep 2014 13:45:03 +0000 (16:45 +0300)
commitc4d69da167fa967749aeb70bc0e94a457e5d00c1
tree35362ec52e7b0a60940906db30e6a8b3c251e3b2
parent4868b45de11483d5b307a406d7f1a707699b1702
drm/i915: Evict CS TLBs between batches

Running igt, I was encountering the invalid TLB bug on my 845g, despite
that it was using the CS workaround. Examining the w/a buffer in the
error state, showed that the copy from the user batch into the
workaround itself was suffering from the invalid TLB bug (the first
cacheline was broken with the first two words reversed). Time to try a
fresh approach. This extends the workaround to write into each page of
our scratch buffer in order to overflow the TLB and evict the invalid
entries. This could be refined to only do so after we update the GTT,
but for simplicity, we do it before each batch.

I suspect this supersedes our current workaround, but for safety keep
doing both.

v2: The magic number shall be 2.

This doesn't conclusively prove that it is the mythical TLB bug we've
been trying to workaround for so long, that it requires touching a number
of pages to prevent the corruption indicates to me that it is TLB
related, but the corruption (the reversed cacheline) is more subtle than
a TLB bug, where we would expect it to read the wrong page entirely.

Oh well, it prevents a reliable hang for me and so probably for others
as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_ringbuffer.c