From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2B39B468E2 for ; Thu, 12 Jun 2025 16:40:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1882C427B5; Thu, 12 Jun 2025 16:40:31 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 90EEF42789 for ; Thu, 12 Jun 2025 16:40:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749739228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w2tI+gj+D8McWwtGfYftqnmRavYczGUP7PtrBWn/2fo=; b=bMd8hulNHWZr14fXHBD58vJfgY5CHm5CztHqRnWqczdQDhH2wWGXTRCSjUI5szrdp76H6a gZ8ZDhGQdsLr8qlOcJ0CBvLM6GYEd4PcQE5ht0SrTdYYvcaoljJd2FEFCeNcu2nhs0kkhp JdZhYaAFOdDAKSDiuOCQiFGdz1EguJ0= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-312-6y0qL-6rOaqz40vApb9Nsg-1; Thu, 12 Jun 2025 10:40:26 -0400 X-MC-Unique: 6y0qL-6rOaqz40vApb9Nsg-1 X-Mimecast-MFC-AGG-ID: 6y0qL-6rOaqz40vApb9Nsg_1749739225 Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3138e65efe2so1085701a91.1 for ; Thu, 12 Jun 2025 07:40:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749739225; x=1750344025; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w2tI+gj+D8McWwtGfYftqnmRavYczGUP7PtrBWn/2fo=; b=ajnKXOtd7b6LbeaVRF5/Yl6qACGjVBhd3SzY94vnSOlgsIQZ1AuGBhm5LncwsrfOjN 4FkmCQmsPq7+u4x7/LD7/B6QcDPMuUSPt/P/FLlIasnCQHtJyQGKfMWkMV4WcWpqWIx/ PX8s6rErgdktogHaNa6OlhUlVrW5UkYajV+PU09fGdy37eFs6Xaw3rnSdUX6ILkR7uKB PeAdpH36QkgwyE85KFcYWWP45VY4ko2bB5kTLgIq0V0zSRYA3V8PG4O0wEsUjnSkrrTJ YokK5Z27Q5wakqqsZoM+au0QUiFI5dn70/f1W4y0YdpHXeuwUVwJy4Y4k2hbrwIQFc8b jGlA== X-Forwarded-Encrypted: i=1; AJvYcCUDMPTrah//+6RVmEK0DUAKYAwfOOJh2Gs/HR8a/I8Ij8a5XWkMCP6UEzjtgq1qsxOy87zdvhA=@dpdk.org X-Gm-Message-State: AOJu0YzjtbgN101Ek/Efv8vkjWHXqPfPGY4aresb4d+EJRul6xf/WkiQ TtOn7XortidbEoyUlVCrJBvgr6xxUnODFlhgwN/LEtSC1pH4H0KWdd3GD8PikiTxZRZpawT7Ecj KvcmVB0fLWuc+7QzfbjTNjN8zgY2AF0YHWA0a8CTElfRMpjX8Ivrui8F0p8KurX9epI5JCBXP+R rRzIsdIPLggSQ2lW7Akz5N58U= X-Gm-Gg: ASbGncvmHW8vjrhOtHJKJXWZkaYm7OWpM5F/TlbwW4GERoDDKA0vyea8mXlYjdjM5Z8 /SP3YiFqV8gQzufdwfjF2BxcE/OJ2Ja+mLsJuecLOH2yQoLdx55dwWaTbpoK1x6834WSWb2yxQ4 Sc+g== X-Received: by 2002:a17:90b:2e84:b0:313:28e7:af14 with SMTP id 98e67ed59e1d1-313bfbd0171mr5373828a91.19.1749739225264; Thu, 12 Jun 2025 07:40:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2EawY34LcvidLDuBZEohsEPYSvx8XSSUPJz7jxdABIcELQhU2p0LvRqJmoIQZXy64svBhIUraBYjGX3tR8q8= X-Received: by 2002:a17:90b:2e84:b0:313:28e7:af14 with SMTP id 98e67ed59e1d1-313bfbd0171mr5373787a91.19.1749739224786; Thu, 12 Jun 2025 07:40:24 -0700 (PDT) MIME-Version: 1.0 References: <20250605113552.918120-1-eperezma@redhat.com> <20250605113552.918120-2-eperezma@redhat.com> In-Reply-To: From: Eugenio Perez Martin Date: Thu, 12 Jun 2025 16:39:47 +0200 X-Gm-Features: AX0GCFtjc2MvxlfyoADdb3p9o9PvzRX0HB1dgZSTTfb-FRZnpDuUTLApJgRBzPM Message-ID: Subject: Re: [PATCH 1/2] vhost: search the split vq desc and avail in RO areas To: Maxime Coquelin Cc: dev@dpdk.org, Chenbo Xia , stable@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: qE7d5svVm2-a2SoyPSN2a83Y2326AcVNgTGID-8vbmI_1749739225 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Thu, Jun 12, 2025 at 3:56=E2=80=AFPM Maxime Coquelin wrote: > > > > On 6/5/25 1:35 PM, Eugenio P=C3=A9rez wrote: > > QEMU's shadow virtqueue and VDUSE exposes these areas 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: eefac9536a90 ("vhost: postpone device creation until rings are m= apped") > > Cc: stable@dpdk.org > > > > Signed-off-by: Eugenio P=C3=A9rez > > --- > > lib/vhost/vhost.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > > index 0353a04dc8..95a99bace6 100644 > > --- a/lib/vhost/vhost.c > > +++ b/lib/vhost/vhost.c > > @@ -497,7 +497,7 @@ vring_translate_split(struct virtio_net *dev, struc= t vhost_virtqueue *vq) > > size =3D req_size; > > vq->desc =3D (struct vring_desc *)(uintptr_t)vhost_iova_to_vva(de= v, vq, > > vq->ring_addrs.desc_user_= addr, > > - &size, VHOST_ACCESS_RW); > > + &size, VHOST_ACCESS_RO); > > if (!vq->desc || size !=3D req_size) > > return -1; > > > > @@ -508,7 +508,7 @@ vring_translate_split(struct virtio_net *dev, struc= t vhost_virtqueue *vq) > > size =3D req_size; > > vq->avail =3D (struct vring_avail *)(uintptr_t)vhost_iova_to_vva(= dev, vq, > > vq->ring_addrs.avail_user= _addr, > > - &size, VHOST_ACCESS_RW); > > + &size, VHOST_ACCESS_RO); > > if (!vq->avail || size !=3D req_size) > > return -1; > > > > I propose below text for the commit message: > > " > The virtqueues driver areas are read-only for the device. > While they are exposed as Read/Write to Vhost-user and regular VDUSE > backends, they are only exposed as Read-only when the control Virtqueue > is shadowed by QEMU with VDUSE backend. > > This patch makes the backend to request these areas as Read-only, so > that it can be accessed in all the configurations. > " > > Also, as requested by David, patch 2 will be squashed into this one. > > Eugenio, is that Ok for you? > Sure, I'm ok with that. Thanks! > With above suggested changes: > Reviewed-by: Maxime Coquelin > > Thanks, > Maxime >