diff options
author | Matthew Brost <matthew.brost@intel.com> | 2024-09-10 18:18:20 -0700 |
---|---|---|
committer | Matthew Brost <matthew.brost@intel.com> | 2024-09-12 12:17:55 -0700 |
commit | f96dbf7c321d70834d46f3aedb75a671e839b51e (patch) | |
tree | 8f6f2a133928c472fa81d7b0e17539b41c96b151 /drivers/gpu | |
parent | 3b04c2cfd71c54117237c72f2a08ff0ae1f602e2 (diff) | |
download | lwn-f96dbf7c321d70834d46f3aedb75a671e839b51e.tar.gz lwn-f96dbf7c321d70834d46f3aedb75a671e839b51e.zip |
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 <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911011820.825127-1-matthew.brost@intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/xe/xe_gt_pagefault.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |