drm/xe: Decrement fault mode counts in xe_vm_close_and_put
authorMatthew Brost <matthew.brost@intel.com>
Fri, 24 Mar 2023 16:33:36 +0000 (09:33 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:30:22 +0000 (18:30 -0500)
commitcf667aec0abeda839937cbd92884799b19df1ab7
tree9496152f8d78c8d010251d5c5b04bcc30c37ca7f
parentef5e3c2f703d05c9d296d8f8ad0a0f48f6c1fcc9
drm/xe: Decrement fault mode counts in xe_vm_close_and_put

Rather waiting for the VM to be destroyed (all refs to VM go to zero),
drop the fault mode counts when the VM is closed in xe_vm_close_and_put.
This avoids a window where user space can create a faulting VM, close
it, and a subsequent creation of a non-faulting VM fails.

v2 (Lucas): Drop VLK reference in commit message

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Suggested-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_vm.c