From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A336EA04F0 for ; Tue, 10 Dec 2019 16:00:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B2441B13C; Tue, 10 Dec 2019 16:00:10 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 0A72E1BE80 for ; Tue, 10 Dec 2019 16:00:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575990008; 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=vNl1qzHwFnnObslTSiNpMN+becQ0sBH1TBHB+QbnjaU=; b=GdfwlpN/BzO3toxe8WD+YPfRcUAXYBKkzW1LL8aDMSrT2u5UEYZf1Cyc4Sw6Cu/BKeUuCa H4ncInJ3mpBXWmOsAyjO+xbfIBSoyPj5zRYMhroThiHeJQOC/EeZmQZ+tnt8A7U/YTYvbH CSapnrDO1TWP+ltAvaUPnr+BwLOcbSg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-OFKoK8ZMMhK5MzrmmYjkZQ-1; Tue, 10 Dec 2019 10:00:07 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30015801E66; Tue, 10 Dec 2019 15:00:06 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2E475D9C5; Tue, 10 Dec 2019 15:00:03 +0000 (UTC) From: Kevin Traynor To: Marvin Liu Cc: Adrian Moreno , Maxime Coquelin , dpdk stable Date: Tue, 10 Dec 2019 14:58:38 +0000 Message-Id: <20191210145937.32755-4-ktraynor@redhat.com> In-Reply-To: <20191210145937.32755-1-ktraynor@redhat.com> References: <20191210145937.32755-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: OFKoK8ZMMhK5MzrmmYjkZQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'vhost: fix virtqueue not accessible' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/16/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/c287794db0d7043dfe= a64b66c059899009ba232e Thanks. Kevin. --- >From c287794db0d7043dfea64b66c059899009ba232e Mon Sep 17 00:00:00 2001 From: Marvin Liu Date: Mon, 4 Nov 2019 18:13:22 +0800 Subject: [PATCH] vhost: fix virtqueue not accessible [ upstream commit bc42ca1787233617e5ce8a848e268784884a8d07 ] Log feature is disabled in vhost user, so that log address was invalid when checking. Check whether log address is valid can work around it. Log address should also be translated in packed ring virtqueue. Fixes: fbda9f145927 ("vhost: translate incoming log address to GPA") Signed-off-by: Marvin Liu Reviewed-by: Adrian Moreno Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 6cc842447..1e148fb45 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -671,9 +671,19 @@ translate_ring_addresses(struct virtio_net *dev, int v= q_index) =09uint64_t len, expected_len; =20 +=09if (addr->flags & (1 << VHOST_VRING_F_LOG)) { +=09=09vq->log_guest_addr =3D +=09=09=09translate_log_addr(dev, vq, addr->log_guest_addr); +=09=09if (vq->log_guest_addr =3D=3D 0) { +=09=09=09RTE_LOG(DEBUG, VHOST_CONFIG, +=09=09=09=09"(%d) failed to map log_guest_addr.\n", +=09=09=09=09dev->vid); +=09=09=09return dev; +=09=09} +=09} + =09if (vq_is_packed(dev)) { =09=09len =3D sizeof(struct vring_packed_desc) * vq->size; =09=09vq->desc_packed =3D (struct vring_packed_desc *)(uintptr_t) =09=09=09ring_addr_to_vva(dev, vq, addr->desc_user_addr, &len); -=09=09vq->log_guest_addr =3D 0; =09=09if (vq->desc_packed =3D=3D NULL || =09=09=09=09len !=3D sizeof(struct vring_packed_desc) * @@ -771,12 +781,4 @@ translate_ring_addresses(struct virtio_net *dev, int v= q_index) =09} =20 -=09vq->log_guest_addr =3D -=09=09translate_log_addr(dev, vq, addr->log_guest_addr); -=09if (vq->log_guest_addr =3D=3D 0) { -=09=09RTE_LOG(DEBUG, VHOST_CONFIG, -=09=09=09"(%d) failed to map log_guest_addr .\n", -=09=09=09dev->vid); -=09=09return dev; -=09} =09vq->access_ok =3D 1; =20 --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-10 14:49:39.375703665 +0000 +++ 0004-vhost-fix-virtqueue-not-accessible.patch=092019-12-10 14:49:38.986= 458998 +0000 @@ -1 +1 @@ -From bc42ca1787233617e5ce8a848e268784884a8d07 Mon Sep 17 00:00:00 2001 +From c287794db0d7043dfea64b66c059899009ba232e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit bc42ca1787233617e5ce8a848e268784884a8d07 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 3f649c802..cc660e03a 100644 +index 6cc842447..1e148fb45 100644 @@ -24 +25 @@ -@@ -654,9 +654,19 @@ translate_ring_addresses(struct virtio_net *dev, int = vq_index) +@@ -671,9 +671,19 @@ translate_ring_addresses(struct virtio_net *dev, int = vq_index) @@ -45 +46 @@ -@@ -754,12 +764,4 @@ translate_ring_addresses(struct virtio_net *dev, int = vq_index) +@@ -771,12 +781,4 @@ translate_ring_addresses(struct virtio_net *dev, int = vq_index)