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/[email protected]/

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

Reply via email to