]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe: Fix fault mode invalidation with unbind
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Fri, 28 Feb 2025 07:30:57 +0000 (08:30 +0100)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Wed, 5 Mar 2025 08:09:30 +0000 (09:09 +0100)
commit100a5b8dadfca50d91d9a4c9fc01431b42a25cab
treeff71c2d670eb2fd129a4cce46a469b9ed10f8131
parentfcc20a4c752214b3e25632021c57d7d1d71ee1dd
drm/xe: Fix fault mode invalidation with unbind

Fix fault mode invalidation racing with unbind leading to the
PTE zapping potentially traversing an invalid page-table tree.
Do this by holding the notifier lock across PTE zapping. This
might transfer any contention waiting on the notifier seqlock
read side to the notifier lock read side, but that shouldn't be
a major problem.

At the same time get rid of the open-coded invalidation in the bind
code by relying on the notifier even when the vma bind is not
yet committed.

Finally let userptr invalidation call a dedicated xe_vm function
performing a full invalidation.

Fixes: e8babb280b5e ("drm/xe: Convert multiple bind ops into single job")
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: <stable@vger.kernel.org> # v6.12+
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228073058.59510-4-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/xe/xe_pt.c
drivers/gpu/drm/xe/xe_vm.c
drivers/gpu/drm/xe/xe_vm.h
drivers/gpu/drm/xe/xe_vm_types.h