From: sashiko-bot@kernel.org
To: "Honglei Huang" <honghuan@amd.com>
Cc: "Eugenio Perez" <eperezma@redhat.com>,
virtualization@lists.linux.dev, dri-devel@lists.freedesktop.org,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [RFC PATCH v9 3/4] drm/virtio: implement userptr resource support
Date: Thu, 24 Sep 2026 10:07:57 +0000 [thread overview]
Message-ID: <20260924100758.1ABB01F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260924095556.1326164-4-honghuan@amd.com>
> Add userptr blob objects so the guest kernel can pin an existing
> userspace mapping and advertise it as CREATE_BLOB backing entries.
>
> - New virtio_gpu_object_userptr type for userptr resources
> - Pin pages with pin_user_pages_fast() and FOLL_LONGTERM
> - Omit FOLL_WRITE when VIRTGPU_BLOB_FLAG_USE_READONLY is set
> - Charge FOLL_LONGTERM pins against RLIMIT_MEMLOCK
> - DMA-map the scatterlist only when virtio_gpu_use_dma_api() is
> required; use DMA_TO_DEVICE for USE_READONLY blobs
> - Mark writable pages dirty when unpinning
> - Keep pages pinned until RESOURCE_UNREF is queued; drop them from
> cleanup_object() on the unref response or on create failure
> - Clear userptr->pages on pin failure to avoid double-free on cleanup
> - Reject unaligned or overflowing userptr ranges at create time
> - Disallow PRIME export of userptr objects
> - Save CREATE_BLOB params and restore userptr resources after
> hibernation without using the shmem restore path
>
> The hibernation restore path maps with the same attrs and direction
> used at create time, as documented next to the call. Like shmem
> blobs, the DMA API can still bounce through a buffer there. This
> design only avoids a second guest side shmem allocation and memcpy,
> nothing more.
>
> Signed-off-by: Honglei Huang <honghuan@amd.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260924095556.1326164-1-honghuan@amd.com?part=3
next prev parent reply other threads:[~2026-09-24 10:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 9:55 [RFC PATCH v9 0/4] virtio-gpu: Add userptr support for compute workloads Honglei Huang
2026-09-24 9:55 ` [RFC PATCH v9 1/4] drm/virtio-gpu: Add VIRTIO_GPU_CAPSET_ROCM capability Honglei Huang
2026-09-24 10:03 ` sashiko-bot
2026-09-24 9:55 ` [RFC PATCH v9 2/4] drm/virtgpu api: add blob userptr resource Honglei Huang
2026-09-24 10:04 ` sashiko-bot
2026-09-24 9:55 ` [RFC PATCH v9 3/4] drm/virtio: implement userptr resource support Honglei Huang
2026-09-24 10:07 ` sashiko-bot [this message]
2026-09-26 11:33 ` Akihiko Odaki
2026-09-28 16:22 ` Huang, Honglei
2026-09-28 17:25 ` Akihiko Odaki
2026-09-29 2:22 ` Huang, Honglei
2026-09-30 4:56 ` Akihiko Odaki
2026-09-30 13:32 ` Huang, Honglei
2026-09-24 9:55 ` [RFC PATCH v9 4/4] drm/virtio: wire blob ioctl creation to userptr objects Honglei Huang
2026-09-24 10:04 ` sashiko-bot
2026-09-27 1:04 ` Akihiko Odaki
2026-09-28 16:23 ` Huang, Honglei
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=20260924100758.1ABB01F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=eperezma@redhat.com \
--cc=honghuan@amd.com \
--cc=mst@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=virtualization@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 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.