From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Honglei Huang <honghuan@amd.com>,
Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>,
David Airlie <airlied@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Val Packett <val@invisiblethingslab.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>,
Chia-I Wu <olvaffe@gmail.com>, Ray Huang <Ray.Huang@amd.com>,
dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v10 4/4] drm/virtio: wire blob ioctl creation to userptr objects
Date: Fri, 27 Nov 2026 16:59:13 +0300 [thread overview]
Message-ID: <e658ea49-9307-4abc-a579-224e8342ff41@collabora.com> (raw)
In-Reply-To: <20261106082625.812860-5-honghuan@amd.com>
On 11/6/26 11:26, Honglei Huang wrote:
> @@ -495,10 +516,15 @@ static int verify_blob(struct virtio_gpu_device *vgdev,
> params->blob = true;
> params->blob_flags = rc_blob->blob_flags;
> params->blob_hints = rc_blob->blob_hints;
> + params->userptr = rc_blob->userptr;
>
> - if (vgdev->has_blob_alignment &&
> - !IS_ALIGNED(params->size, vgdev->blob_alignment))
> - return -EINVAL;
> + if (vgdev->has_blob_alignment) {
> + if (!IS_ALIGNED(params->size, vgdev->blob_alignment))
> + return -EINVAL;
> +
> + if (!IS_ALIGNED(params->userptr, vgdev->blob_alignment))
> + return -EINVAL;
> + }
>
There was a bug reported RE the alignment check on [1], my proposal
there is to align allocated size to host page size.
[1]
https://lore.kernel.org/dri-devel/20261006154913.2689067-2-val@invisiblethingslab.com/
In virtio_gpu_userptr_create() I see it rejects size that is not aligned
to PAGE_SIZE, but for VRAM and shmem BOs the driver code implicitly
aligns size to PAGE_SIZE. Could we do the same for userptr for consistency?
--
Best regards,
Dmitry
next prev parent reply other threads:[~2026-11-27 13:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 8:26 [RFC PATCH v10 0/4] drm/virtio: userptr blobs for native-context compute Honglei Huang
2026-11-06 8:26 ` [RFC PATCH v10 1/4] drm/virtio: add VIRTIO_GPU_CAPSET_ROCM capability Honglei Huang
2026-11-27 13:19 ` Dmitry Osipenko
2026-11-06 8:26 ` [RFC PATCH v10 2/4] drm/virtio: add userptr blob resource to the UAPI Honglei Huang
2026-11-27 13:19 ` Dmitry Osipenko
2026-11-06 8:26 ` [RFC PATCH v10 3/4] drm/virtio: implement userptr resource support Honglei Huang
2026-11-27 13:45 ` Dmitry Osipenko
2026-11-06 8:26 ` [RFC PATCH v10 4/4] drm/virtio: wire blob ioctl creation to userptr objects Honglei Huang
2026-11-27 13:59 ` Dmitry Osipenko [this message]
2026-11-25 6:41 ` [RFC PATCH v10 0/4] drm/virtio: userptr blobs for native-context compute Huang, Honglei
2026-11-27 14:32 ` Dmitry Osipenko
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=e658ea49-9307-4abc-a579-224e8342ff41@collabora.com \
--to=dmitry.osipenko@collabora.com \
--cc=Ray.Huang@amd.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=honghuan@amd.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=olvaffe@gmail.com \
--cc=val@invisiblethingslab.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®