[PATCH 5/8] lift mmap restriction

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Jul 27 11:25:55 UTC 2023


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_mman.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index cd7f8ded0d6f..9aa6ecf68432 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -382,17 +382,9 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
 		goto err_reset;
 	}
 
-	/*
-	 * For objects created by userspace through GEM_CREATE with pat_index
-	 * set by set_pat extension, coherency is managed by userspace, make
-	 * sure we don't fail handling the vm fault by calling
-	 * i915_gem_object_has_cache_level() which always return true for such
-	 * objects. Otherwise this helper function would fall back to checking
-	 * whether the object is un-cached.
-	 */
-	if (!((obj->pat_set_by_user ||
-	       i915_gem_object_has_cache_mode(obj, I915_CACHE_MODE_UC)) ||
-	      HAS_LLC(i915))) {
+	/* Access to snoopable pages through the GTT is incoherent. */
+	if (!i915_gem_object_has_cache_mode(obj, I915_CACHE_MODE_UC) &&
+	    !HAS_LLC(i915)) {
 		ret = -EFAULT;
 		goto err_unpin;
 	}
-- 
2.39.2



More information about the Intel-gfx-trybot mailing list