| ebcff9da | 02-Feb-2026 |
Arnd Bergmann <arnd@arndb.de> |
vduse: avoid adding implicit padding
The vduse_iova_range_v2 and vduse_iotlb_entry_v2 structures are both defined in a way that adds implicit padding and is incompatible between i386 and x86_64 user
vduse: avoid adding implicit padding
The vduse_iova_range_v2 and vduse_iotlb_entry_v2 structures are both defined in a way that adds implicit padding and is incompatible between i386 and x86_64 userspace because of the different structure alignment requirements. Building the header with -Wpadded shows these new warnings:
vduse.h:305:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded] vduse.h:374:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]
Change the amount of padding in these two structures to align them to 64 bit words and avoid those problems. Since the v1 vduse_iotlb_entry already has an inconsistent size, do not attempt to reuse the structure but rather list the members indiviudally, with a fixed amount of padding.
Fixes: 079212f6877e ("vduse: add vq group asid support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260202224835.559538-1-arnd@kernel.org>
show more ...
|
| 12e0043d | 19-Jan-2026 |
Eugenio Pérez <eperezma@redhat.com> |
vduse: bump version number
Finalize the series by advertising VDUSE API v1 support to userspace.
Now that all required infrastructure for v1 (ASIDs, VQ groups, update_iotlb_v2) is in place, VDUSE d
vduse: bump version number
Finalize the series by advertising VDUSE API v1 support to userspace.
Now that all required infrastructure for v1 (ASIDs, VQ groups, update_iotlb_v2) is in place, VDUSE devices can opt in to the new features.
Assume API version 0 if the VDUSE instance does not call VDUSE_GET_API_VERSION to maintain compatibility.
Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260119143306.1818855-13-eperezma@redhat.com>
show more ...
|
| 079212f6 | 19-Jan-2026 |
Eugenio Pérez <eperezma@redhat.com> |
vduse: add vq group asid support
Add support for assigning Address Space Identifiers (ASIDs) to each VQ group. This enables mapping each group into a distinct memory space.
The vq group to ASID as
vduse: add vq group asid support
Add support for assigning Address Space Identifiers (ASIDs) to each VQ group. This enables mapping each group into a distinct memory space.
The vq group to ASID association is protected by a rwlock now. But the mutex domain_lock keeps protecting the domains of all ASIDs, as some operations like the one related with the bounce buffer size still requires to lock all the ASIDs.
Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260119143306.1818855-12-eperezma@redhat.com>
show more ...
|
| f3dc3a8a | 19-Jan-2026 |
Eugenio Pérez <eperezma@redhat.com> |
vduse: merge tree search logic of IOTLB_GET_FD and IOTLB_GET_INFO ioctls
The next patch adds new ioctl with the ASID member per entry. Abstract these two so it can be build on top easily.
Acked-by
vduse: merge tree search logic of IOTLB_GET_FD and IOTLB_GET_INFO ioctls
The next patch adds new ioctl with the ASID member per entry. Abstract these two so it can be build on top easily.
Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260119143306.1818855-11-eperezma@redhat.com>
show more ...
|
| 489d7652 | 19-Jan-2026 |
Eugenio Pérez <eperezma@redhat.com> |
vduse: take out allocations from vduse_dev_alloc_coherent
The function vduse_dev_alloc_coherent will be called under rwlock in next patches. Make it out of the lock to avoid increasing its fail rat
vduse: take out allocations from vduse_dev_alloc_coherent
The function vduse_dev_alloc_coherent will be called under rwlock in next patches. Make it out of the lock to avoid increasing its fail rate.
Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260119143306.1818855-10-eperezma@redhat.com>
show more ...
|
| 766e1749 | 19-Jan-2026 |
Eugenio Pérez <eperezma@redhat.com> |
vduse: remove unused vaddr parameter of vduse_domain_free_coherent
We will modify the function in next patches so let's clean it first.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off
vduse: remove unused vaddr parameter of vduse_domain_free_coherent
We will modify the function in next patches so let's clean it first.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260119143306.1818855-9-eperezma@redhat.com>
show more ...
|
| 3e2ddda6 | 19-Jan-2026 |
Eugenio Pérez <eperezma@redhat.com> |
vduse: refactor vdpa_dev_add for goto err handling
Next patches introduce more error paths in this function. Refactor it so they can be accommodated through gotos.
Acked-by: Jason Wang <jasowang@r
vduse: refactor vdpa_dev_add for goto err handling
Next patches introduce more error paths in this function. Refactor it so they can be accommodated through gotos.
Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Xie Yongji <xieyongji@bytedance.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260119143306.1818855-8-eperezma@redhat.com>
show more ...
|
| 02e3f7ff | 19-Jan-2026 |
Eugenio Pérez <eperezma@redhat.com> |
vduse: return internal vq group struct as map token
Return the internal struct that represents the vq group as virtqueue map token, instead of the device. This allows the map functions to access th
vduse: return internal vq group struct as map token
Return the internal struct that represents the vq group as virtqueue map token, instead of the device. This allows the map functions to access the information per group.
At this moment all the virtqueues share the same vq group, that only can point to ASID 0. This change prepares the infrastructure for actual per-group address space handling
Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260119143306.1818855-5-eperezma@redhat.com>
show more ...
|
| 3fc3068e | 25-Sep-2025 |
Sheng Zhao <sheng.zhao@bytedance.com> |
vduse: Use fixed 4KB bounce pages for non-4KB page size
The allocation granularity of bounce pages is PAGE_SIZE. This may cause even small IO requests to occupy an entire bounce page exclusively. Th
vduse: Use fixed 4KB bounce pages for non-4KB page size
The allocation granularity of bounce pages is PAGE_SIZE. This may cause even small IO requests to occupy an entire bounce page exclusively. The kind of memory waste will be more significant when PAGE_SIZE is larger than 4KB (e.g. arm64 with 64KB pages).
So, optimize it by using fixed 4KB bounce maps and iova allocation granularity. A single IO request occupies at least a 4KB bounce page instead of the entire memory page of PAGE_SIZE.
Signed-off-by: Sheng Zhao <sheng.zhao@bytedance.com> Message-Id: <20250925113516.60305-1-sheng.zhao@bytedance.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
| 1c14b0e4 | 24-Sep-2025 |
Jason Wang <jasowang@redhat.com> |
vduse: switch to use virtio map API instead of DMA API
Lacking the support of device specific mapping supported in virtio, VDUSE must trick the DMA API in order to make virtio-vdpa transport work. T
vduse: switch to use virtio map API instead of DMA API
Lacking the support of device specific mapping supported in virtio, VDUSE must trick the DMA API in order to make virtio-vdpa transport work. This is done by advertising vDPA device as dma device with a VDUSE specific dma_ops even if it doesn't do DMA at all.
This will be fixed by this patch. Thanks to the new mapping operations support by virtio and vDPA. VDUSE can simply switch to advertise its specific mappings operations to virtio via virtio-vdpa then DMA API is not needed for VDUSE any more and iova domain could be used as the mapping token instead.
Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20250924070045.10361-3-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
show more ...
|
| 89445218 | 09-Jan-2024 |
Maxime Coquelin <maxime.coquelin@redhat.com> |
vduse: enable Virtio-net device type
This patch adds Virtio-net device type to the supported devices types.
Initialization fails if the device does not support VIRTIO_F_VERSION_1 feature, in order
vduse: enable Virtio-net device type
This patch adds Virtio-net device type to the supported devices types.
Initialization fails if the device does not support VIRTIO_F_VERSION_1 feature, in order to guarantee the configuration space is read-only. It also fails with -EPERM if the CAP_NET_ADMIN is missing.
Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Message-Id: <20240109111025.1320976-4-maxime.coquelin@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
show more ...
|
| 56e71885 | 09-Jan-2024 |
Maxime Coquelin <maxime.coquelin@redhat.com> |
vduse: Temporarily fail if control queue feature requested
Virtio-net driver control queue implementation is not safe when used with VDUSE. If the VDUSE application does not reply to control queue m
vduse: Temporarily fail if control queue feature requested
Virtio-net driver control queue implementation is not safe when used with VDUSE. If the VDUSE application does not reply to control queue messages, it currently ends up hanging the kernel thread sending this command.
Some work is on-going to make the control queue implementation robust with VDUSE. Until it is completed, let's fail features check if control-queue feature is requested.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Message-Id: <20240109111025.1320976-3-maxime.coquelin@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Xie Yongji <xieyongji@bytedance.com> Acked-by: Jason Wang <jasowang@redhat.com>
show more ...
|