Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Do not run GPU page fault handler on a closed VM
@ 2024-09-11  1:18 Matthew Brost
  2024-09-11  1:23 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Matthew Brost @ 2024-09-11  1:18 UTC (permalink / raw)
  To: intel-xe; +Cc: himal.prasad.ghimiray

Closing a VM removes page table memory thus we shouldn't touch page
tables when a VM is closed. Do not run the GPU page fault handler once
the VM is closed to avoid touching page tables.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_pagefault.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index 730eec07795e..00af059a8971 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
@@ -212,6 +212,12 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
 	 * TODO: Change to read lock? Using write lock for simplicity.
 	 */
 	down_write(&vm->lock);
+
+	if (xe_vm_is_closed(vm)) {
+		err = -ENOENT;
+		goto unlock_vm;
+	}
+
 	vma = lookup_vma(vm, pf->page_addr);
 	if (!vma) {
 		err = -EINVAL;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-09-11  6:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11  1:18 [PATCH] drm/xe: Do not run GPU page fault handler on a closed VM Matthew Brost
2024-09-11  1:23 ` ✓ CI.Patch_applied: success for " Patchwork
2024-09-11  1:23 ` ✓ CI.checkpatch: " Patchwork
2024-09-11  1:24 ` ✓ CI.KUnit: " Patchwork
2024-09-11  1:36 ` ✓ CI.Build: " Patchwork
2024-09-11  1:39 ` ✓ CI.Hooks: " Patchwork
2024-09-11  1:40 ` ✓ CI.checksparse: " Patchwork
2024-09-11  2:23 ` ✓ CI.BAT: " Patchwork
2024-09-11  4:18 ` ✗ CI.FULL: failure " Patchwork
2024-09-11  6:25 ` [PATCH] " Ghimiray, Himal Prasad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox