[PATCH v4 4/9] drm/xe: Add pat_index to properties line in VM snapshot capture
Cavitt, Jonathan
jonathan.cavitt at intel.com
Wed May 7 20:36:34 UTC 2025
-----Original Message-----
From: Intel-xe <intel-xe-bounces at lists.freedesktop.org> On Behalf Of Matthew Brost
Sent: Wednesday, May 7, 2025 1:16 PM
To: intel-xe at lists.freedesktop.org
Cc: Souza, Jose <jose.souza at intel.com>; Santa, Carlos <carlos.santa at intel.com>; Venkatesh Reddy, Sushma <sushma.venkatesh.reddy at intel.com>
Subject: [PATCH v4 4/9] drm/xe: Add pat_index to properties line in VM snapshot capture
>
> Add pat index to properties line in VM snapshot capture indicating
> the VMA 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
>
> 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.
>
> Cc: José Roberto de Souza <jose.souza at intel.com>
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
LGTM.
Reviewed-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
-Jonathan Cavitt
> ---
> drivers/gpu/drm/xe/xe_vm.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index 842e482b60b2..0675c46b7c63 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -3732,6 +3732,7 @@ struct xe_vm_snapshot {
> #define XE_VM_SNAP_FLAG_IS_NULL BIT(2)
> unsigned long flags;
> int uapi_mem_region;
> + int pat_index;
> struct xe_bo *bo;
> void *data;
> struct mm_struct *mm;
> @@ -3774,6 +3775,7 @@ struct xe_vm_snapshot *xe_vm_snapshot_capture(struct xe_vm *vm)
> snap->snap[i].len = xe_vma_size(vma);
> snap->snap[i].flags = xe_vma_read_only(vma) ?
> XE_VM_SNAP_FLAG_READ_ONLY : 0;
> + snap->snap[i].pat_index = vma->pat_index;
> if (bo) {
> snap->snap[i].bo = xe_bo_get(bo);
> snap->snap[i].bo_ofs = xe_vma_bo_offset(vma);
> @@ -3875,7 +3877,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\n",
> + drm_printf(p, "[%llx].properties: %s|%s|mem_region=0x%lx|pat_index=%d\n",
> snap->snap[i].ofs,
> snap->snap[i].flags & XE_VM_SNAP_FLAG_READ_ONLY ?
> "read_only" : "read_write",
> @@ -3884,7 +3886,8 @@ void xe_vm_snapshot_print(struct xe_vm_snapshot *snap, struct drm_printer *p)
> snap->snap[i].flags & XE_VM_SNAP_FLAG_USERPTR ?
> "userptr" : "bo",
> snap->snap[i].uapi_mem_region == -1 ? 0 :
> - BIT(snap->snap[i].uapi_mem_region));
> + BIT(snap->snap[i].uapi_mem_region),
> + snap->snap[i].pat_index);
>
> 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