Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+6
+6
drivers/gpu/drm/xe/xe_gt_pagefault.c
··· 212 212 * TODO: Change to read lock? Using write lock for simplicity. 213 213 */ 214 214 down_write(&vm->lock); 215 + 216 + if (xe_vm_is_closed(vm)) { 217 + err = -ENOENT; 218 + goto unlock_vm; 219 + } 220 + 215 221 vma = lookup_vma(vm, pf->page_addr); 216 222 if (!vma) { 217 223 err = -EINVAL;