mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Huang, Honglei" <honghuan@amd.com>
To: Dmitry Osipenko <dmitry.osipenko@collabora.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,
	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>
Subject: Re: [RFC PATCH v10 4/4] drm/virtio: wire blob ioctl creation to userptr objects
Date: Mon, 30 Nov 2026 17:48:30 +0800	[thread overview]
Message-ID: <a5a39831-5177-419a-ac63-143a07296c74@amd.com> (raw)
In-Reply-To: <e658ea49-9307-4abc-a579-224e8342ff41@collabora.com>



On 11/27/2026 9:59 PM, Dmitry Osipenko wrote:
> 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?

Got it will change.

Regards,
Honglei

> 


  reply	other threads:[~2026-11-30  9:48 UTC|newest]

Thread overview: 14+ 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-30  9:47     ` Huang, Honglei
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
2026-11-30  9:48     ` Huang, Honglei [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
2026-11-30  8: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=a5a39831-5177-419a-ac63-143a07296c74@amd.com \
    --to=honghuan@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=airlied@redhat.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --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®