]> git.itanic.dy.fi Git - linux-stable/commit
drm/xe: Invalidate userptr VMA on page pin fault
authorMatthew Brost <matthew.brost@intel.com>
Tue, 12 Mar 2024 18:39:07 +0000 (11:39 -0700)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:17:33 +0000 (18:17 -0400)
commit567d34a745d066a87b44d8c66a797aa40fcb2dea
tree854fd1d32648e31d303646b6b02d11e276a11dce
parent262da920896e2f2ab0e3947d9dbee0aa09045818
drm/xe: Invalidate userptr VMA on page pin fault

[ Upstream commit 386021394394eccef248dc5eb9c9370240821a8c ]

Rather than return an error to the user or ban the VM when userptr VMA
page pin fails with -EFAULT, invalidate VMA mappings. This supports the
UMD use case of freeing userptr while still having bindings.

Now that non-faulting VMs can invalidate VMAs, drop the usm prefix for
the tile_invalidated member.

v2:
 - Fix build error (CI)
v3:
 - Don't invalidate VMA if in fault mode, rather kill VM (Thomas)
 - Update commit message with tile_invalidated name chagne (Thomas)
 - Wait VM bookkeep slots with VM resv lock (Thomas)
v4:
 - Move list_del_init(&userptr.repin_link) after error check (Thomas)
 - Assert not in fault mode (Matthew)

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240312183907.933835-1-matthew.brost@intel.com
(cherry picked from commit 521db22a1d70dbc596a07544a738416025b1b63c)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/xe/xe_gt_pagefault.c
drivers/gpu/drm/xe/xe_trace.h
drivers/gpu/drm/xe/xe_vm.c
drivers/gpu/drm/xe/xe_vm_types.h