Commit 9460f4bd authored by Matthew Brost's avatar Matthew Brost Committed by Lucas De Marchi

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: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911011820.825127-1-matthew.brost@intel.com
(cherry picked from commit f96dbf7c321d70834d46f3aedb75a671e839b51e)
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent ddc73c46
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment