drm/xe: Make VMA tile_present, tile_invalidated access rules clear
authorMatthew Brost <matthew.brost@intel.com>
Mon, 2 Jun 2025 16:44:12 +0000 (09:44 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Wed, 4 Jun 2025 14:38:53 +0000 (07:38 -0700)
commit99e80508980583b1c0150b953b64a629211c4e23
tree6d1d251b811b003a37fc3489ae66fe691699028d
parent531bef26d189b28bf0d694878c0e064b30990b6c
drm/xe: Make VMA tile_present, tile_invalidated access rules clear

Document VMA tile_invalidated access rules, use READ_ONCE / WRITE_ONCE
for opportunistic checks of tile_present and tile_invalidated, move
tile_invalidated state change from page fault handler to PT code under
the correct locks, and add lockdep asserts to TLB invalidation paths.

v2:
 - Assert VM dma-resv lock rather than BO in zap PTEs
v3:
 - Back to BO's dma-resv lock, adjust documentation
v4:
 - Add WRITE_ONCE in xe_vm_invalidate_vma (Thomas)
 - Change lockdep assert for userptr in xe_vm_invalidate_vma (CI)
 - Take userptr notifier lock in read mode in xe_vm_userptr_pin before
   calling xe_vm_invalidate_vma (CI)
v5:
 - Fix typos (Thomas)

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://lore.kernel.org/r/20250602164412.1912293-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_gt_pagefault.c
drivers/gpu/drm/xe/xe_pt.c
drivers/gpu/drm/xe/xe_vm.c
drivers/gpu/drm/xe/xe_vm_types.h