[PATCH v3 5/9] drm/xe: Add cpu_caching to properties line in VM snapshot capture
Matthew Brost
matthew.brost at intel.com
Thu Mar 20 19:28:27 UTC 2025
Add CPU caching to properties line in VM snapshot capture indicating
the BO caching properites. This is useful information for debug and
will help build a robust GPU hang replay tool.
The current format is:
[<vma address>]: <permissions>|<type>|mem_region=0x%x|pat_index=%d|cpu_caching=%d
Permissions has two options, either "read_only" or "read_write".
Type has three options, either "userptr", "null_sparse", or "bo".
Memory region is a bit mask of where the memory is located.
Pat index corresponds to the value setup upon VM bind.
CPU caching corresponds to the value of BO setup upon creation.
Cc: José Roberto de Souza <jose.souza at intel.com>
Signed-off-by: Matthew Brost <matthew.brost at intel.com>
---
drivers/gpu/drm/xe/xe_vm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 34bec27a5f45..94bf056da5b9 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -3859,7 +3859,7 @@ void xe_vm_snapshot_print(struct xe_vm_snapshot *snap, struct drm_printer *p)
for (i = 0; i < snap->num_snaps; i++) {
drm_printf(p, "[%llx].length: 0x%lx\n", snap->snap[i].ofs, snap->snap[i].len);
- drm_printf(p, "[%llx].properties: %s|%s|mem_region=0x%lx|pat_index=%d\n",
+ drm_printf(p, "[%llx].properties: %s|%s|mem_region=0x%lx|pat_index=%d|cpu_caching=%d\n",
snap->snap[i].ofs,
snap->snap[i].flags & XE_VM_SNAP_FLAG_READ_ONLY ?
"read_only" : "read_write",
@@ -3869,7 +3869,8 @@ void xe_vm_snapshot_print(struct xe_vm_snapshot *snap, struct drm_printer *p)
"userptr" : "bo",
snap->snap[i].uapi_mem_region == -1 ? 0 :
BIT(snap->snap[i].uapi_mem_region),
- snap->snap[i].pat_index);
+ snap->snap[i].pat_index,
+ snap->snap[i].bo ? snap->snap[i].bo->cpu_caching : 0);
if (IS_ERR(snap->snap[i].data)) {
drm_printf(p, "[%llx].error: %li\n", snap->snap[i].ofs,
--
2.34.1
More information about the Intel-xe
mailing list