linux/drivers/gpu/drm/i915/gem
Tvrtko Ursulin 7938d61591 drm/i915: Flush TLBs before releasing backing store
We need to flush TLBs before releasing backing store otherwise userspace
is able to encounter stale entries if a) it is not declaring access to
certain buffers and b) it races with the backing store release from a
such undeclared execution already executing on the GPU in parallel.

The approach taken is to mark any buffer objects which were ever bound
to the GPU and to trigger a serialized TLB flush when their backing
store is released.

Alternatively the flushing could be done on VMA unbind, at which point
we would be able to ascertain whether there is potential a parallel GPU
execution (which could race), but essentially it boils down to paying
the cost of TLB flushes potentially needlessly at VMA unbind time (when
the backing store is not known to be going away so not needed for
safety), versus potentially needlessly at backing store relase time
(since we at that point cannot tell whether there is anything executing
on the GPU which uses that object).

Thereforce simplicity of implementation has been chosen for now with
scope to benchmark and refine later as required.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-01-25 20:06:06 +02:00
..
selftests drm/i915/ttm: add unmap_virtual callback 2022-01-10 13:55:07 +00:00
i915_gem_busy.c drm/i915: use the new iterator in i915_gem_busy_ioctl v2 2021-11-17 14:23:09 +01:00
i915_gem_clflush.c drm/i915: stop setting cache_dirty on discrete 2021-11-02 09:44:10 +00:00
i915_gem_clflush.h
i915_gem_context_types.h drm/i915/guc: Connect UAPI to GuC multi-lrc interface 2021-10-15 10:45:50 -07:00
i915_gem_context.c drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
i915_gem_context.h drm/i915/pxp: interfaces for using protected objects 2021-10-04 13:11:00 -04:00
i915_gem_create.c drm/i915/gem: Use to_gt() helper 2021-12-17 21:50:32 -08:00
i915_gem_dmabuf.c Revert "drm/i915/dmabuf: fix broken build" 2021-11-24 09:22:53 +00:00
i915_gem_domain.c drm/i915: stop setting cache_dirty on discrete 2021-11-02 09:44:10 +00:00
i915_gem_execbuffer.c drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
i915_gem_internal.c drm/i915: Create a dummy object for gen6 ppgtt 2021-11-19 17:38:03 +00:00
i915_gem_ioctls.h drm/i915/uapi: introduce drm_i915_gem_create_ext 2021-05-04 10:58:56 +01:00
i915_gem_lmem.c drm/i915/gem: Fix a lockdep warning the __i915_gem_is_lmem() function 2021-09-24 08:17:39 +02:00
i915_gem_lmem.h drm/i915/guc: put all guc objects in lmem when available 2021-09-20 12:35:41 -07:00
i915_gem_mman.c drm/i915/ttm: add unmap_virtual callback 2022-01-10 13:55:07 +00:00
i915_gem_mman.h
i915_gem_object_types.h drm/i915: Flush TLBs before releasing backing store 2022-01-25 20:06:06 +02:00
i915_gem_object.c drm/i915: Use trylock instead of blocking lock for __i915_gem_free_objects. 2021-12-23 12:30:27 +01:00
i915_gem_object.h drm/i915: Add ww ctx to i915_gem_object_trylock 2021-12-21 13:27:29 +01:00
i915_gem_pages.c drm/i915: Flush TLBs before releasing backing store 2022-01-25 20:06:06 +02:00
i915_gem_phys.c drm/i915/gem: Use to_gt() helper 2021-12-17 21:50:32 -08:00
i915_gem_pm.c drm/i915/gem: Use to_gt() helper 2021-12-17 21:50:32 -08:00
i915_gem_pm.h drm/i915 Implement LMEM backup and restore for suspend / resume 2021-09-24 08:19:11 +02:00
i915_gem_region.c drm/i915/ttm: Drop region reference counting 2021-11-25 09:36:16 +01:00
i915_gem_region.h drm/i915/gem: Implement a function to process all gem objects of a region 2021-09-24 08:19:09 +02:00
i915_gem_shmem.c drm/i915/ttm: Drop region reference counting 2021-11-25 09:36:16 +01:00
i915_gem_shrinker.c drm/i915: Add ww ctx to i915_gem_object_trylock 2021-12-21 13:27:29 +01:00
i915_gem_shrinker.h
i915_gem_stolen.c drm/i915: Add ww ctx to i915_gem_object_trylock 2021-12-21 13:27:29 +01:00
i915_gem_stolen.h drm/i915/ttm Initialize the ttm device and memory managers 2021-06-02 13:21:24 +01:00
i915_gem_throttle.c drm/i915/gem: Use to_gt() helper 2021-12-17 21:50:32 -08:00
i915_gem_tiling.c drm/i915/gem: replace IS_GEN and friends with GRAPHICS_VER 2021-06-05 15:09:43 -07:00
i915_gem_ttm_move.c drm/i915: Break out the i915_deps utility 2021-12-22 08:52:57 +01:00
i915_gem_ttm_move.h drm/i915: Break out the i915_deps utility 2021-12-22 08:52:57 +01:00
i915_gem_ttm_pm.c drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous 2021-11-25 09:36:20 +01:00
i915_gem_ttm_pm.h drm/i915 Implement LMEM backup and restore for suspend / resume 2021-09-24 08:19:11 +02:00
i915_gem_ttm.c drm/i915/ttm: ensure we unmap when purging 2022-01-10 14:00:47 +00:00
i915_gem_ttm.h drm/i915/ttm: Implement asynchronous TTM moves 2021-11-25 09:36:19 +01:00
i915_gem_userptr.c drm/i915/gem: Use to_gt() helper 2021-12-17 21:50:32 -08:00
i915_gem_wait.c drm/i915: Remove dma_resv_prune 2021-11-30 15:59:17 +01:00
i915_gemfs.c drm/i915: Use per device iommu check 2021-12-01 09:21:47 +00:00
i915_gemfs.h