From: "Souza, Jose" <jose.souza@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"Maarten@mblankhorst.nl" <Maarten@mblankhorst.nl>
Cc: "dev@lankhorst.se" <dev@lankhorst.se>
Subject: Re: [Intel-xe] [PATCH 1/4] drm/xe: Add uapi for dumpable bos
Date: Mon, 13 Nov 2023 21:41:11 +0000 [thread overview]
Message-ID: <a21675dc43a85f298107f04b3e99aae84766e920.camel@intel.com> (raw)
In-Reply-To: <20231024122256.19512-2-dev@lankhorst.se>
On Tue, 2023-10-24 at 14:22 +0200, Maarten@mblankhorst.nl wrote:
> From: Maarten Lankhorst <dev@lankhorst.se>
>
> 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.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/xe/xe_vm.c | 11 ++++++++---
> include/uapi/drm/xe_drm.h | 4 ++++
> 2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index 498c0b3e1d73..dca03d8ad98e 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -2819,12 +2819,12 @@ static int vm_bind_ioctl_ops_execute(struct xe_vm *vm,
> #define SUPPORTED_FLAGS \
> (FORCE_ASYNC_OP_ERROR | XE_VM_BIND_FLAG_ASYNC | \
> XE_VM_BIND_FLAG_READONLY | XE_VM_BIND_FLAG_IMMEDIATE | \
> - XE_VM_BIND_FLAG_NULL | 0xffff)
> + XE_VM_BIND_FLAG_NULL | XE_VM_BIND_FLAG_DUMPABLE | 0xffff)
> #else
> #define SUPPORTED_FLAGS \
> (XE_VM_BIND_FLAG_ASYNC | XE_VM_BIND_FLAG_READONLY | \
> XE_VM_BIND_FLAG_IMMEDIATE | XE_VM_BIND_FLAG_NULL | \
> - 0xffff)
> + XE_VM_BIND_FLAG_DUMPABLE | 0xffff)
> #endif
> #define XE_64K_PAGE_MASK 0xffffull
>
> @@ -3036,8 +3036,13 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
> u32 obj = bind_ops[i].obj;
> u64 obj_offset = bind_ops[i].obj_offset;
>
> - if (!obj)
> + if (!obj) {
> + if (XE_IOCTL_DBG(xe, bind_ops[i].op & XE_VM_BIND_FLAG_DUMPABLE)) {
this will not allow dump user-ptr.
> + err = -EINVAL;
> + goto put_obj;
> + }
> continue;
> + }
>
> gem_obj = drm_gem_object_lookup(file, obj);
> if (XE_IOCTL_DBG(xe, !gem_obj)) {
> diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> index 24bf8f0f52e8..42f5eb95d30c 100644
> --- a/include/uapi/drm/xe_drm.h
> +++ b/include/uapi/drm/xe_drm.h
> @@ -677,6 +677,10 @@ struct drm_xe_vm_bind_op {
> * intended to implement VK sparse bindings.
> */
> #define XE_VM_BIND_FLAG_NULL (0x1 << 3)
> + /*
> + * dumpable -> contents are attempted to be included in devcoredumps.
> + */
> +#define XE_VM_BIND_FLAG_DUMPABLE (0x1 << 4)
> /** @flags: Bind flags */
> __u32 flags;
>
next prev parent reply other threads:[~2023-11-13 21:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 12:22 [Intel-xe] [PATCH 0/4] drm/xe: Implement snapshot support Maarten, Lankhorst <maarten.lankhorst
2023-10-24 12:22 ` [Intel-xe] [PATCH 1/4] drm/xe: Add uapi for dumpable bos Maarten, Lankhorst <maarten.lankhorst
2023-11-13 21:41 ` Souza, Jose [this message]
2023-10-24 12:22 ` [Intel-xe] [PATCH 2/4] drm/xe: Annotate each dumpable vma as such Maarten, Lankhorst <maarten.lankhorst
2023-10-24 12:22 ` [Intel-xe] [PATCH 3/4] drm/xe: Add vm snapshot mutex for easily taking a vm snapshot during devcoredump Maarten, Lankhorst <maarten.lankhorst
2023-10-24 12:22 ` [Intel-xe] [PATCH 4/4] drm/xe: Implement VM snapshot support Maarten, Lankhorst <maarten.lankhorst
2023-10-27 12:17 ` Thomas Hellström
2023-10-27 17:47 ` Maarten Lankhorst
2023-11-13 21:52 ` Souza, Jose
2024-01-22 18:03 ` Souza, Jose
2023-10-24 13:07 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Implement " Patchwork
2023-10-24 13:07 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-10-24 13:09 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-10-24 13:16 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-10-24 13:16 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-10-24 13:18 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-10-24 13:52 ` [Intel-xe] ✓ CI.BAT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2023-10-13 15:21 [Intel-xe] [PATCH 0/4] RFC for discussion of devcoredump uapi maarten.lankhorst
2023-10-13 15:21 ` [Intel-xe] [PATCH 1/4] drm/xe: Add uapi for dumpable bos maarten.lankhorst
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=a21675dc43a85f298107f04b3e99aae84766e920.camel@intel.com \
--to=jose.souza@intel.com \
--cc=Maarten@mblankhorst.nl \
--cc=dev@lankhorst.se \
--cc=intel-xe@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
/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