]> git.baikalelectronics.ru Git - kernel.git/commit
dma-buf: Restore seqlock around dma_resv updates
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 14 Aug 2019 18:24:01 +0000 (19:24 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 16 Aug 2019 11:40:58 +0000 (12:40 +0100)
commitb6d5550a8c8598ce55610133d6a52f4c5acd5eae
tree278f8b1426b40316f5744cd6155ec51ecc9dd6c7
parent3bf74586538ba12fe335f8bfe1f330c51712f857
dma-buf: Restore seqlock around dma_resv updates

This reverts
1feaccdfc17a ("dma-buf: add reservation_object_fences helper")
84551ebc52f3 ("drm/i915: use new reservation_object_fences helper")
995309a0fbea ("dma-buf: further relax reservation_object_add_shared_fence")
cfbc76fc0314 ("dma-buf: nuke reservation_object seq number")

The scenario that defeats simply grabbing a set of shared/exclusive
fences and using them blissfully under RCU is that any of those fences
may be reallocated by a SLAB_TYPESAFE_BY_RCU fence slab cache. In this
scenario, while keeping the rcu_read_lock we need to establish that no
fence was changed in the dma_resv after a read (or full) memory barrier.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190814182401.25009-1-chris@chris-wilson.co.uk
drivers/dma-buf/dma-buf.c
drivers/dma-buf/dma-resv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/i915/gem/i915_gem_busy.c
include/linux/dma-resv.h