Skip to content

Commit 9460f4b

Browse files
mbrost05lucasdemarchi
authored andcommitted
drm/xe: Do not run GPU page fault handler on a closed VM
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 <[email protected]> Reviewed-by: Himal Prasad Ghimiray <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit f96dbf7) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent ddc73c4 commit 9460f4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/xe/xe_gt_pagefault.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
212212
* TODO: Change to read lock? Using write lock for simplicity.
213213
*/
214214
down_write(&vm->lock);
215+
216+
if (xe_vm_is_closed(vm)) {
217+
err = -ENOENT;
218+
goto unlock_vm;
219+
}
220+
215221
vma = lookup_vma(vm, pf->page_addr);
216222
if (!vma) {
217223
err = -EINVAL;

0 commit comments

Comments
 (0)