Commit 75188605 authored by Matthew Brost's avatar Matthew Brost
Browse files

drm/xe: Handle mixed mappings and existing VRAM on atomic faults



Moving to VRAM will fail if mixed mappings are present or if the page is
already located in VRAM. Atomic faults that require a move to VRAM
currently retry without attempting to evict mixed mappings or locate
existing VRAM mappings.

This patch fixes the issue by attempting to evict mixed mappings or find
existing VRAM pages when a move to VRAM fails during atomic fault
handling.

Fixes: a9ac0fa4 ("drm/xe: Strict migration policy for atomic SVM faults")
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://lore.kernel.org/r/20251009130629.3531962-1-matthew.brost@intel.com
parent 381f1ed1
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1073,6 +1073,16 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
				drm_dbg(&vm->xe->drm,
					"VRAM allocation failed, falling back to retrying fault, asid=%u, errno=%pe\n",
					vm->usm.asid, ERR_PTR(err));

				/*
				 * In the devmem-only case, mixed mappings may
				 * be found. The get_pages function will fix
				 * these up to a single location, allowing the
				 * page fault handler to make forward progress.
				 */
				if (ctx.devmem_only)
					goto get_pages;
				else
					goto retry;
			} else {
				drm_err(&vm->xe->drm,
@@ -1083,6 +1093,7 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
		}
	}

get_pages:
	get_pages_start = xe_svm_stats_ktime_get();

	range_debug(range, "GET PAGES");