* `virtio: reject shm region if length is zero` breaks virtio-gpu host_visible feature
@ 2025-08-06 18:34 Igor Torrente
2025-08-06 20:47 ` Michael S. Tsirkin
0 siblings, 1 reply; 2+ messages in thread
From: Igor Torrente @ 2025-08-06 18:34 UTC (permalink / raw)
To: mst, samimdko
Cc: virtualization, linux-kernel, eperezma, xuanzhuo, jasowang,
Dmitrii Osipenko
Hello,
The commit `206cc44588f7 virtio: reject shm region if length is zero` breaks the Virtio-gpu `host_visible` feature.
As you can see in the snippet below, host_visible_region is zero because of the `kzalloc`.
It's using the `vm_get_shm_region` (drivers/virtio/virtio_mmio.c:536) to read the `addr` and `len` from qemu/crosvm.
```
drivers/gpu/drm/virtio/virtgpu_kms.c
132 vgdev = drmm_kzalloc(dev, sizeof(struct virtio_gpu_device), GFP_KERNEL);
[...]
177 if (virtio_get_shm_region(vgdev->vdev, &vgdev->host_visible_region,
178 VIRTIO_GPU_SHM_ID_HOST_VISIBLE)) {
```
Now it always fails.
I don't know exactly what issue this patch is trying to solve, but right now Virtio-gpu relies upon the previous behavior.
Can we just revert it?
BR,
----
Igor Torrente
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: `virtio: reject shm region if length is zero` breaks virtio-gpu host_visible feature
2025-08-06 18:34 `virtio: reject shm region if length is zero` breaks virtio-gpu host_visible feature Igor Torrente
@ 2025-08-06 20:47 ` Michael S. Tsirkin
0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2025-08-06 20:47 UTC (permalink / raw)
To: Igor Torrente
Cc: samimdko, virtualization, linux-kernel, eperezma, xuanzhuo,
jasowang, Dmitrii Osipenko
On Wed, Aug 06, 2025 at 03:34:55PM -0300, Igor Torrente wrote:
> Hello,
>
> The commit `206cc44588f7 virtio: reject shm region if length is zero` breaks the Virtio-gpu `host_visible` feature.
>
> As you can see in the snippet below, host_visible_region is zero because of the `kzalloc`.
> It's using the `vm_get_shm_region` (drivers/virtio/virtio_mmio.c:536) to read the `addr` and `len` from qemu/crosvm.
>
> ```
> drivers/gpu/drm/virtio/virtgpu_kms.c
> 132 vgdev = drmm_kzalloc(dev, sizeof(struct virtio_gpu_device), GFP_KERNEL);
> [...]
> 177 if (virtio_get_shm_region(vgdev->vdev, &vgdev->host_visible_region,
> 178 VIRTIO_GPU_SHM_ID_HOST_VISIBLE)) {
> ```
> Now it always fails.
>
> I don't know exactly what issue this patch is trying to solve, but right now Virtio-gpu relies upon the previous behavior.
> Can we just revert it?
>
> BR,
> ----
> Igor Torrente
Pls go ahead and post the revert. We'll see what happens.
--
MST
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-06 20:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 18:34 `virtio: reject shm region if length is zero` breaks virtio-gpu host_visible feature Igor Torrente
2025-08-06 20:47 ` Michael S. Tsirkin
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.