<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/virtio/virtgpu_ioctl.c, branch v7.2-rc1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-05-20T14:59:21+00:00</updated>
<entry>
<title>drm/virtio: add VIRTGPU_PARAM_BLOB_ALIGNMENT to params</title>
<updated>2026-05-20T14:59:21+00:00</updated>
<author>
<name>Sergio Lopez</name>
<email>slp@redhat.com</email>
</author>
<published>2026-04-28T19:44:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6bd7e82e26531541a6023f060ba749547b9868ac'/>
<id>urn:sha1:6bd7e82e26531541a6023f060ba749547b9868ac</id>
<content type='text'>
Add VIRTGPU_PARAM_BLOB_ALIGNMENT as a param that can be read with
VIRTGPU_GETPARAM by userspace applications running in the guest to
obtain the host's page size and find out the right alignment to be used
in shared memory allocations.

Signed-off-by: Sergio Lopez &lt;slp@redhat.com&gt;
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Link: https://patch.msgid.link/20260428194450.518296-4-slp@redhat.com
</content>
</entry>
<entry>
<title>drm/virtio: honor blob_alignment requirements</title>
<updated>2026-05-20T14:59:21+00:00</updated>
<author>
<name>Sergio Lopez</name>
<email>slp@redhat.com</email>
</author>
<published>2026-04-28T19:44:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47248e0d8264452762bd47a8b3c89665b8235e93'/>
<id>urn:sha1:47248e0d8264452762bd47a8b3c89665b8235e93</id>
<content type='text'>
If VIRTIO_GPU_F_BLOB_ALIGNMENT has been negotiated, blob size must be
aligned to blob_alignment. Validate this in verify_blob() so that
invalid requests are rejected early.

Signed-off-by: Sergio Lopez &lt;slp@redhat.com&gt;
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Link: https://patch.msgid.link/20260428194450.518296-3-slp@redhat.com
</content>
</entry>
<entry>
<title>drm/virtio: Extend blob UAPI with deferred-mapping hinting</title>
<updated>2026-05-13T21:57:34+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>dmitry.osipenko@collabora.com</email>
</author>
<published>2026-05-01T00:00:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c26e162947f91aa78ba57dd4fddd38fc80e7d60'/>
<id>urn:sha1:4c26e162947f91aa78ba57dd4fddd38fc80e7d60</id>
<content type='text'>
If userspace never maps GEM object, then BO wastes hostmem space
because VirtIO-GPU driver maps VRAM BO at the BO's creating time.

Make mappings on-demand by adding new RESOURCE_CREATE_BLOB IOCTL/UAPI
hinting flag telling that host mapping should be deferred until first
mapping is made when the flag is set by userspace.

Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Reviewed-by: Rob Clark &lt;robdclark@gmail.com&gt;
Link: https://patch.msgid.link/20260501000043.2483678-1-dmitry.osipenko@collabora.com
</content>
</entry>
<entry>
<title>drm/virtio: Use generic dumb_map_offset implementation</title>
<updated>2024-11-18T11:08:37+00:00</updated>
<author>
<name>Peter Shkenev</name>
<email>mustela@erminea.space</email>
</author>
<published>2024-11-07T14:10:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c85021f35ace0081081b3fcbd0b411ad085dc091'/>
<id>urn:sha1:c85021f35ace0081081b3fcbd0b411ad085dc091</id>
<content type='text'>
Currently, virtio uses its own dumb_map_offset implementation,
virtio_gpu_mode_dumb_mmap. It works similarly to generic implementation,
drm_gem_dumb_map_offset, and using the generic implementation is
preferable (and making drivers to do so is a task stated on the DRM
subsystem's TODO list).

Thus, make driver use the generic implementation. This includes
VIRTGPU_MAP ioctl so it cannot be used to circumvent rules imposed by
drm_gem_dumb_map_offset (imported objects cannot be mapped).

Signed-off-by: Peter Shkenev &lt;mustela@erminea.space&gt;
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
[dmitry.osipenko@collabora.com: cosmetic code improvements]
Link: https://patchwork.freedesktop.org/patch/msgid/20241107141133.13624-1-mustela@erminea.space
</content>
</entry>
<entry>
<title>drm/virtio: Fix return value for VIRTGPU_CONTEXT_PARAM_DEBUG_NAME</title>
<updated>2023-11-15T01:42:16+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>dmitry.osipenko@collabora.com</email>
</author>
<published>2023-11-11T22:42:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34b98a5f7a185c19715cc98c57d7e27b4785dfdf'/>
<id>urn:sha1:34b98a5f7a185c19715cc98c57d7e27b4785dfdf</id>
<content type='text'>
The strncpy_from_user() returns number of copied bytes and not zero on
success. The non-zero return value of ioctl is treated as error. Return
zero on success instead of the number of copied bytes.

Fixes: 7add80126bce ("drm/uapi: add explicit virtgpu context debug name")
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Reviewed-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231111224236.890431-1-dmitry.osipenko@collabora.com
</content>
</entry>
<entry>
<title>drm/uapi: add explicit virtgpu context debug name</title>
<updated>2023-11-11T18:31:00+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2023-10-18T18:17:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7add80126bcedddd157ddc09988b032c93ed56c7'/>
<id>urn:sha1:7add80126bcedddd157ddc09988b032c93ed56c7</id>
<content type='text'>
There are two problems with the current method of determining the
virtio-gpu debug name.

1) TASK_COMM_LEN is defined to be 16 bytes only, and this is a
   Linux kernel idiom (see PR_SET_NAME + PR_GET_NAME). Though,
   Android/FreeBSD get around this via setprogname(..)/getprogname(..)
   in libc.

   On Android, names longer than 16 bytes are common.  For example,
   one often encounters a program like "com.android.systemui".

   The virtio-gpu spec allows the debug name to be up to 64 bytes, so
   ideally userspace should be able to set debug names up to 64 bytes.

2) The current implementation determines the debug name using whatever
   task initiated virtgpu.  This is could be a "RenderThread" of a
   larger program, when we actually want to propagate the debug name
   of the program.

To fix these issues, add a new CONTEXT_INIT param that allows userspace
to set the debug name when creating a context.

It takes a null-terminated C-string as the param value. The length of the
string (excluding the terminator) **should** be &lt;= 64 bytes.  Otherwise,
the debug_name will be truncated to 64 bytes.

Link to open-source userspace:
https://android-review.googlesource.com/c/platform/hardware/google/gfxstream/+/2787176

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Reviewed-by: Josh Simonot &lt;josh.simonot@gmail.com&gt;
Reviewed-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231018181727.772-2-gurchetansingh@chromium.org
</content>
</entry>
<entry>
<title>drm/virtio: use uint64_t more in virtio_gpu_context_init_ioctl</title>
<updated>2023-11-11T18:19:11+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2023-10-18T18:17:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e4178256094a76cc36d9b9aabe7482615959b26f'/>
<id>urn:sha1:e4178256094a76cc36d9b9aabe7482615959b26f</id>
<content type='text'>
drm_virtgpu_context_set_param defines both param and
value to be u64s.

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Reviewed-by: Josh Simonot &lt;josh.simonot@gmail.com&gt;
Reviewed-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231018181727.772-1-gurchetansingh@chromium.org
</content>
</entry>
<entry>
<title>drm/virtio: Refactor and optimize job submission code path</title>
<updated>2023-06-03T01:50:40+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>dmitry.osipenko@collabora.com</email>
</author>
<published>2023-04-16T11:52:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e4812ab8e6b142e1ce19b50fcf744e20ea9adfe3'/>
<id>urn:sha1:e4812ab8e6b142e1ce19b50fcf744e20ea9adfe3</id>
<content type='text'>
Move virtio_gpu_execbuffer_ioctl() into separate virtgpu_submit.c file,
refactoring and optimizing the code along the way to ease addition of new
features to the ioctl.

The optimization is done by using optimal ordering of the job's submission
steps, reducing code path from the start of the ioctl to the point of
pushing job to virtio queue. Job's initialization is now performed before
in-fence is awaited and out-fence setup is made after sending out job to
virtio.

Reviewed-by: Rob Clark &lt;robdclark@gmail.com&gt;
Reviewed-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Tested-by: Pierre-Eric Pelloux-Prayer &lt;pierre-eric.pelloux-prayer@amd.com&gt;
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230416115237.798604-2-dmitry.osipenko@collabora.com
</content>
</entry>
<entry>
<title>drm/virtio: exbuf-&gt;fence_fd unmodified on interrupted wait</title>
<updated>2023-02-06T17:10:56+00:00</updated>
<author>
<name>Ryan Neph</name>
<email>ryanneph@chromium.org</email>
</author>
<published>2023-02-03T23:33:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8f20660f053cefd4693e69cfff9cf58f4f7c4929'/>
<id>urn:sha1:8f20660f053cefd4693e69cfff9cf58f4f7c4929</id>
<content type='text'>
An interrupted dma_fence_wait() becomes an -ERESTARTSYS returned
to userspace ioctl(DRM_IOCTL_VIRTGPU_EXECBUFFER) calls, prompting to
retry the ioctl(), but the passed exbuf-&gt;fence_fd has been reset to -1,
making the retry attempt fail at sync_file_get_fence().

The uapi for DRM_IOCTL_VIRTGPU_EXECBUFFER is changed to retain the
passed value for exbuf-&gt;fence_fd when returning anything besides a
successful result from the ioctl.

Fixes: 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization")
Signed-off-by: Ryan Neph &lt;ryanneph@chromium.org&gt;
Reviewed-by: Rob Clark &lt;robdclark@gmail.com&gt;
Reviewed-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230203233345.2477767-1-ryanneph@chromium.org
</content>
</entry>
<entry>
<title>drm/virtio: Fix GEM handle creation UAF</title>
<updated>2023-01-09T23:17:50+00:00</updated>
<author>
<name>Rob Clark</name>
<email>robdclark@chromium.org</email>
</author>
<published>2022-12-16T23:33:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=52531258318ed59a2dc5a43df2eaf0eb1d65438e'/>
<id>urn:sha1:52531258318ed59a2dc5a43df2eaf0eb1d65438e</id>
<content type='text'>
Userspace can guess the handle value and try to race GEM object creation
with handle close, resulting in a use-after-free if we dereference the
object after dropping the handle's reference.  For that reason, dropping
the handle's reference must be done *after* we are done dereferencing
the object.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Reviewed-by: Chia-I Wu &lt;olvaffe@gmail.com&gt;
Fixes: 62fb7a5e1096 ("virtio-gpu: add 3d/virgl support")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20221216233355.542197-2-robdclark@gmail.com
</content>
</entry>
</feed>
