drm/xe: Add VM.uapi_flags to VM snapshot capture

Add VM.uapi_flags to VM snapshot capture VM snapshot capture. This is
useful information for debug and will help build a robust GPU hang
replay tool.

The current format is:

VM.uapi_flags: 0x%x

Cc: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patch.msgid.link/20251126185952.546277-7-matthew.brost@intel.com
This commit is contained in:
Matthew Brost
2025-11-26 10:59:49 -08:00
parent 066a1ddd85
commit c87f586e55

View File

@@ -4043,6 +4043,7 @@ int xe_vm_validate_protected(struct xe_vm *vm)
}
struct xe_vm_snapshot {
int uapi_flags;
unsigned long num_snaps;
struct {
u64 ofs, bo_ofs;
@@ -4082,6 +4083,13 @@ struct xe_vm_snapshot *xe_vm_snapshot_capture(struct xe_vm *vm)
goto out_unlock;
}
if (vm->flags & XE_VM_FLAG_FAULT_MODE)
snap->uapi_flags |= DRM_XE_VM_CREATE_FLAG_FAULT_MODE;
if (vm->flags & XE_VM_FLAG_LR_MODE)
snap->uapi_flags |= DRM_XE_VM_CREATE_FLAG_LR_MODE;
if (vm->flags & XE_VM_FLAG_SCRATCH_PAGE)
snap->uapi_flags |= DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE;
snap->num_snaps = num_snaps;
i = 0;
drm_gpuvm_for_each_va(gpuva, &vm->gpuvm) {
@@ -4196,6 +4204,7 @@ void xe_vm_snapshot_print(struct xe_vm_snapshot *snap, struct drm_printer *p)
return;
}
drm_printf(p, "VM.uapi_flags: 0x%x\n", snap->uapi_flags);
for (i = 0; i < snap->num_snaps; i++) {
drm_printf(p, "[%llx].length: 0x%lx\n", snap->snap[i].ofs, snap->snap[i].len);