History

Revert "virtio: reject shm region if length is zero"

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. To fix, revert the offending commit.

Igor Torrente committed 1 year ago

Commit ced17ee1 parent dd54bcf1 file · +0 −2Browse files

Unified · Split

include/linux/virtio_config.h+0−2
@@ -328,8 +328,6 @@ static inline · 327 unmodified lines
328328 bool virtio_get_shm_region(struct virtio_device *vdev,
329329 struct virtio_shm_region *region, u8 id)
330330 {
331− if (!region->len)
332− return false;
333331 if (!vdev->config->get_shm_region)
334332 return false;
335333 return vdev->config->get_shm_region(vdev, region, id);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t