All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH v5 4/9] drm/xe: Add pat_index to properties line in VM snapshot capture
Date: Wed, 26 Nov 2025 10:59:47 -0800	[thread overview]
Message-ID: <20251126185952.546277-5-matthew.brost@intel.com> (raw)
In-Reply-To: <20251126185952.546277-1-matthew.brost@intel.com>

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@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
---
 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 f2cf95d23bd0..b298953d2eed 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -4052,6 +4052,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;
@@ -4094,6 +4095,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->attr.pat_index;
 		if (bo) {
 			snap->snap[i].bo = xe_bo_get(bo);
 			snap->snap[i].bo_ofs = xe_vma_bo_offset(vma);
@@ -4195,7 +4197,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",
@@ -4204,7 +4206,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


  parent reply	other threads:[~2025-11-26 19:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 18:59 [PATCH v5 0/9] Add support for Mesa GPU hang replay tool Matthew Brost
2025-11-26 18:59 ` [PATCH v5 1/9] drm/xe: Add properties line to VM snapshot capture Matthew Brost
2025-11-26 18:59 ` [PATCH v5 2/9] drm/xe: Add "null_sparse" type to VM snap properties Matthew Brost
2025-11-26 18:59 ` [PATCH v5 3/9] drm/xe: Add mem_region to properties line in VM snapshot capture Matthew Brost
2025-11-26 18:59 ` Matthew Brost [this message]
2025-11-26 18:59 ` [PATCH v5 5/9] drm/xe: Add cpu_caching " Matthew Brost
2025-11-26 18:59 ` [PATCH v5 6/9] drm/xe: Add VM.uapi_flags to " Matthew Brost
2025-11-26 18:59 ` [PATCH v5 7/9] drm/xe/uapi: Add DRM_XE_EXEC_QUEUE_SET_HANG_REPLAY_STATE Matthew Brost
2025-11-26 20:44   ` Souza, Jose
2025-12-01 17:59     ` Rodrigo Vivi
2025-11-26 18:59 ` [PATCH v5 8/9] drm/xe: Add replay_offset and replay_length lines to LRC HWCTX snapshot Matthew Brost
2025-11-26 18:59 ` [PATCH v5 9/9] drm/xe: Implement DRM_XE_EXEC_QUEUE_SET_HANG_REPLAY_STATE Matthew Brost
2025-11-26 19:06 ` ✗ CI.checkpatch: warning for Add support for Mesa GPU hang replay tool (rev5) Patchwork
2025-11-26 19:07 ` ✓ CI.KUnit: success " Patchwork
2025-11-26 20:59 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-27  6:02 ` ✗ CI.checkpatch: warning for Add support for Mesa GPU hang replay tool (rev6) Patchwork
2025-11-27  6:04 ` ✓ CI.KUnit: success " Patchwork
2025-11-27  7:16 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-11-27  8:18 ` ✗ Xe.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251126185952.546277-5-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.