drm/xe/userptr: Misc fixes
Fix a couple of outstanding bugs and / or inconsistencies:
- In compute- and fault mode, A userptr may become unmapped before the rebind worker / fault handler runs. Rather than failing the userptr rebind, point the missing pages to a per-vm userptr scratch page.
- Since we don't keep userptr pages pinned while bound to GPU, use get_user_pages_fast() rather than pin_user_pages_fast().
- Lock instead of trylock when dirtying userptr pages. The deadlock condition motivating the trylock as detailed in i915 doesn't exist in xe.
- Don't offer any shortcuts out of the mmu_notifier when the process is exiting or the vma is about to be destroyed. Again, since we don't pin userptr pages while bound, we must idle the vm or zapping the GPU PTEs in the mmu_notifier. The only thing gating pages from being handed back to the system as part of shrinking, for example, is the completion of the mmu_notifier. This is different from i915 where we keep pages pinned.
This all should prevent a number of hangs and timeouts when terminating an application with a running compute mode VM.
Signed-off-by: Thomas Hellström thomas.hellstrom@linux.intel.com