From: sashiko-bot@kernel.org
To: "Honglei Huang" <honghuan@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v8 3/4] drm/virtio: implement userptr support for zero-copy memory access
Date: Fri, 18 Sep 2026 08:17:03 +0000 [thread overview]
Message-ID: <20260918081704.3CDDE1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260918075600.2197253-4-honghuan@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/virtio: suspend/resume broken for userptr blobs due to missing restore_list insertion
--
commit fa2044a8302d0462020754a25069b6a6d031a3a7
Author: Honglei Huang <honghuan@amd.com>
drm/virtio: implement userptr support for zero-copy memory access
This commit adds support for userptr blob objects in the virtio-gpu driver.
It allows the guest kernel to pin existing userspace mappings and advertise
them to the host as CREATE_BLOB backing entries.
> diff --git a/drivers/gpu/drm/virtio/virtgpu_userptr.c b/drivers/gpu/drm/virtio/virtgpu_userptr.c
> new file mode 100644
> index 0000000000000..2f86a95ad2e65
> --- /dev/null
> +++ b/drivers/gpu/drm/virtio/virtgpu_userptr.c
[ ... ]
> +int virtio_gpu_userptr_create(struct virtio_gpu_device *vgdev,
> + struct drm_file *file,
> + struct virtio_gpu_object_params *params,
> + struct virtio_gpu_object **bo_ptr)
> +{
[ ... ]
> + ret = virtio_gpu_userptr_get_entries(vgdev, userptr, &ents, &nents);
> + if (ret)
> + goto err_cleanup;
> +
> + virtio_gpu_cmd_resource_create_blob(vgdev, &userptr->base, params, ents,
> + nents);
> +
> + *bo_ptr = &userptr->base;
> + return 0;
[Severity: High]
Does this code miss saving the creation parameters and adding the object to
the restore list?
If the guest suspends and resumes, virtio_gpu_object_restore_all() needs to
recreate resources on the host. Without saving params into the base object
(e.g., bo->params = *params) and calling
virtio_gpu_add_object_to_restore_list(), this userptr object might be skipped
during system resume.
This causes subsequent command submissions using this resource ID to be
rejected by the host when the guest userspace resumes and tries to access
the resource.
> +
> +err_cleanup:
> + virtio_gpu_cleanup_object(&userptr->base);
> + return ret;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260918075600.2197253-1-honghuan@amd.com?part=3
next prev parent reply other threads:[~2026-09-18 8:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 7:55 [PATCH v8 0/4] virtio-gpu: Add userptr support for compute workloads Honglei Huang
2026-09-18 7:55 ` [PATCH v8 1/4] drm/virtio-gpu: Add VIRTIO_GPU_CAPSET_ROCM capability Honglei Huang
2026-09-18 8:07 ` sashiko-bot
2026-09-18 7:55 ` [PATCH v8 2/4] drm/virtgpu api: add blob userptr resource Honglei Huang
2026-09-18 7:55 ` [PATCH v8 3/4] drm/virtio: implement userptr support for zero-copy memory access Honglei Huang
2026-09-18 8:17 ` sashiko-bot [this message]
2026-09-18 7:56 ` [PATCH v8 4/4] drm/virtio: wire blob ioctl creation to userptr objects Honglei Huang
2026-09-18 8:12 ` sashiko-bot
-- strict thread matches above, loose matches on Subject: below --
2026-09-18 9:59 [PATCH v8 0/4] virtio-gpu: Add userptr support for compute workloads Honglei Huang
2026-09-18 9:59 ` [PATCH v8 3/4] drm/virtio: implement userptr support for zero-copy memory access Honglei Huang
2026-09-18 10:21 ` sashiko-bot
2026-09-19 8:59 ` Akihiko Odaki
2026-09-24 9:25 ` Huang, Honglei
2026-09-26 10:17 ` Akihiko Odaki
2026-09-18 8:23 [PATCH v8 0/4] virtio-gpu: Add userptr support for compute workloads Honglei Huang
2026-09-18 8:23 ` [PATCH v8 3/4] drm/virtio: implement userptr support for zero-copy memory access Honglei Huang
2026-09-18 6:56 [PATCH v8 0/4] virtio-gpu: Add userptr support for compute workloads Honglei Huang
2026-09-18 6:56 ` [PATCH v8 3/4] drm/virtio: implement userptr support for zero-copy memory access Honglei Huang
2026-09-18 5:59 [PATCH v8 0/4] virtio-gpu: Add userptr support for compute workloads Honglei Huang
2026-09-18 5:59 ` [PATCH v8 3/4] drm/virtio: implement userptr support for zero-copy memory access Honglei Huang
2026-09-18 6:16 ` sashiko-bot
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=20260918081704.3CDDE1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=honghuan@amd.com \
--cc=sashiko-reviews@lists.linux.dev \
/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