[2/2] vhost: search the packed vq driver area in RO areas

Message ID 20250605113552.918120-3-eperezma@redhat.com (mailing list archive)
State Awaiting Upstream
Delegated to: Maxime Coquelin
Headers
Series Search the split vq desc and avail in RO areas |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Eugenio Perez Martin June 5, 2025, 11:35 a.m. UTC
QEMU's shadow virtqueue and VDUSE exposes this as read-only. If we
don't change it, vhost_iova_to_vva do not consider them as valid and
returns that they're not found.

Fixes: 2d1541e2b6b3 ("vhost: add vring address setup for packed queues")
Cc: stable@dpdk.org

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
 lib/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Maxime Coquelin June 13, 2025, 8:07 a.m. UTC | #1
On 6/5/25 1:35 PM, Eugenio Pérez wrote:
> QEMU's shadow virtqueue and VDUSE exposes this as read-only. If we
> don't change it, vhost_iova_to_vva do not consider them as valid and
> returns that they're not found.
> 
> Fixes: 2d1541e2b6b3 ("vhost: add vring address setup for packed queues")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>   lib/vhost/vhost.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
> index 95a99bace6..a2e3e2635d 100644
> --- a/lib/vhost/vhost.c
> +++ b/lib/vhost/vhost.c
> @@ -544,7 +544,7 @@ vring_translate_packed(struct virtio_net *dev, struct vhost_virtqueue *vq)
>   	size = req_size;
>   	vq->driver_event = (struct vring_packed_desc_event *)(uintptr_t)
>   		vhost_iova_to_vva(dev, vq, vq->ring_addrs.avail_user_addr,
> -				&size, VHOST_ACCESS_RW);
> +				&size, VHOST_ACCESS_RO);
>   	if (!vq->driver_event || size != req_size)
>   		return -1;
>   

Squashed into patch 1.

Thanks,
Maxime
  

Patch

diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index 95a99bace6..a2e3e2635d 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -544,7 +544,7 @@  vring_translate_packed(struct virtio_net *dev, struct vhost_virtqueue *vq)
 	size = req_size;
 	vq->driver_event = (struct vring_packed_desc_event *)(uintptr_t)
 		vhost_iova_to_vva(dev, vq, vq->ring_addrs.avail_user_addr,
-				&size, VHOST_ACCESS_RW);
+				&size, VHOST_ACCESS_RO);
 	if (!vq->driver_event || size != req_size)
 		return -1;