Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 1/4] drm/xe: Add uapi for dumpable bos, v2.
Date: Wed, 24 Jan 2024 17:52:42 +0100	[thread overview]
Message-ID: <20240124165245.2660-1-maarten.lankhorst@linux.intel.com> (raw)

Add the flag XE_VM_BIND_FLAG_DUMPABLE to notify devcoredump that this
mapping should be dumped.

This is not hooked up, but the uapi should be ready before merging.

It's likely easier to dump the contents of the bo's at devcoredump
readout time, so it's better if the bos will stay unmodified after
a hang. The NEEDS_CPU_MAPPING flag is removed as requirement.

Changes since v1:
- Remove unrelated and erroneous chunk.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
There was a discussion on whether to include a flag to query support,
I think attempting to bind once with DUMPABLE and checking for -EINVAL
is enough to find out, adding a flag would be way too much effort.

 drivers/gpu/drm/xe/xe_vm.c | 5 +++--
 include/uapi/drm/xe_drm.h  | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index d096a8c00bd4..66b7d6124a37 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -2692,12 +2692,13 @@ static int vm_bind_ioctl_ops_execute(struct xe_vm *vm,
 #ifdef TEST_VM_ASYNC_OPS_ERROR
 #define SUPPORTED_FLAGS	\
 	(FORCE_ASYNC_OP_ERROR | DRM_XE_VM_BIND_FLAG_READONLY | \
-	 DRM_XE_VM_BIND_FLAG_IMMEDIATE | DRM_XE_VM_BIND_FLAG_NULL | 0xffff)
+	 DRM_XE_VM_BIND_FLAG_IMMEDIATE | DRM_XE_VM_BIND_FLAG_NULL | \
+	 DRM_XE_VM_BIND_FLAG_DUMPABLE | 0xffff)
 #else
 #define SUPPORTED_FLAGS	\
 	(DRM_XE_VM_BIND_FLAG_READONLY | \
 	 DRM_XE_VM_BIND_FLAG_IMMEDIATE | DRM_XE_VM_BIND_FLAG_NULL | \
-	 0xffff)
+	 DRM_XE_VM_BIND_FLAG_DUMPABLE | 0xffff)
 #endif
 #define XE_64K_PAGE_MASK 0xffffull
 #define ALL_DRM_XE_SYNCS_FLAGS (DRM_XE_SYNCS_FLAG_WAIT_FOR_OP)
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 50bbea0992d9..0f975f57f3e5 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -930,6 +930,7 @@ struct drm_xe_vm_bind_op {
 #define DRM_XE_VM_BIND_FLAG_READONLY	(1 << 0)
 #define DRM_XE_VM_BIND_FLAG_IMMEDIATE	(1 << 1)
 #define DRM_XE_VM_BIND_FLAG_NULL	(1 << 2)
+#define DRM_XE_VM_BIND_FLAG_DUMPABLE	(1 << 3)
 	/** @flags: Bind flags */
 	__u32 flags;
 
-- 
2.43.0


             reply	other threads:[~2024-01-24 17:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 16:52 Maarten Lankhorst [this message]
2024-01-24 16:52 ` [PATCH 2/4] drm/xe: Annotate each dumpable vma as such Maarten Lankhorst
2024-01-24 16:52 ` [PATCH 3/4] drm/xe: Add vm snapshot mutex for easily taking a vm snapshot during devcoredump Maarten Lankhorst
2024-01-24 16:52 ` [PATCH 4/4] drm/xe: Implement VM snapshot support for BO's and userptr, v2 Maarten Lankhorst
2024-01-25 18:39   ` Souza, Jose
2024-01-25 18:49     ` Souza, Jose
2024-01-25 18:57   ` Souza, Jose
2024-01-25 19:01   ` Souza, Jose
2024-01-24 17:07 ` ✓ CI.Patch_applied: success for series starting with [1/4] drm/xe: Add uapi for dumpable bos, v2 Patchwork
2024-01-24 17:07 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-24 17:08 ` ✓ CI.KUnit: success " Patchwork
2024-01-24 17:15 ` ✓ CI.Build: " Patchwork
2024-01-24 17:16 ` ✓ CI.Hooks: " Patchwork
2024-01-24 17:17 ` ✓ CI.checksparse: " Patchwork
2024-01-24 17:40 ` ✓ CI.BAT: " 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=20240124165245.2660-1-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox