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 2678343B86 for ; Tue, 5 Mar 2024 10:53:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2096842E07; Tue, 5 Mar 2024 10:53:23 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2076.outbound.protection.outlook.com [40.107.244.76]) by mails.dpdk.org (Postfix) with ESMTP id 04A494014F for ; Tue, 5 Mar 2024 10:53:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bxhha4mC8x5Bh29VpLSiYkYTEnDJ1K7uNIXErDSIL9rQsL+7/VQ+G09H1dIEWWJukZ9qZuZEcf4D5QAX0HO00wZ6v3XU+aiL2BnMRwuw4n1RkWaOWDd9HKDovDgS2pKNBJybRxN8VuxPtn0va9Tp6zKAKH3eacN0UfUt6XM1bR8C+g4/+mwE0hcTboK9Af+QGr/RpEVD6k2jznkk81tUidJEaRIfjRe/AX8Zb7IS1kIDmDoFTsHyBP044IPMj4prFWa4VkklHtUfbX3aI4NOOgfzdxkLwxPwPBszCC9E8KOqtxLx98qDgQMygiqDm5U1AxAvFKKITiLKFL2YG3xNwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cZkJRpXJka7kxu6+OPM8xrVys5r3OHBktHKjF+hdx+I=; b=gDp1qhUUHJEFh/57zlqsu/WoTGVGcb8qRgqX447T+d6nGb7fP2H8SQAhMO3+28HdQBQ+Oc1eoIv94tyIh5IXR8UkALsoo8OaJCqHjiXsYqkhocNNa7reCtx1oL+Ob/ASG/8OEwx7L7PilSm/Gt8UCWeUJIrhkM4m/iwUKqDkuKmJPQyCbch6LctvOk853phs6putVDXKE40GgDAbFi3kLo92Fyfrr5Bbw4XKkhQ223X3ZXPig3lhkvGdHFPKUa8leC2EOKexgmKnja1lmLy8GT+SDUZvltdcdFXONQpkc4XYrmSRXU1Y0FO4OiS5AMWh9STKDeIRzSHmIreS0Lxe6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cZkJRpXJka7kxu6+OPM8xrVys5r3OHBktHKjF+hdx+I=; b=QZE9+rpbpc2CbKHob/iCV1Ri0TM3kFJ9P1oMaAORRu0KoOD78xk/Wh/lV/HX7MTXXwtq+uX4+ZcdSNKIMDO894MwpCEuSz4A3+iAk9TLL+4YznYACvhLAxhJGBEOUE7EXfmVwDJIOD95hSJM31tOBpr0l3Qj20CzJdt2wtK0HXQpF55Otvq2G7g+7iKMDSRym+o8+YdoTdXs8dU+Fxi1+cFYXnK+sMWv+xxlp5c0X0SrCBq3n9ZQY+kxe7Bdmdc/VG+DyQnDt2NvEOmaLLss+uKKFSQts3Vmw3ZwAQMcqwCXHJr6p+S/T7BmxTiJNHuJ4dWsSCnL8cPf4M3HXDqrUg== Received: from CY5PR03CA0010.namprd03.prod.outlook.com (2603:10b6:930:8::18) by MN2PR12MB4064.namprd12.prod.outlook.com (2603:10b6:208:1d3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Tue, 5 Mar 2024 09:53:18 +0000 Received: from CY4PEPF0000FCC2.namprd03.prod.outlook.com (2603:10b6:930:8:cafe::f2) by CY5PR03CA0010.outlook.office365.com (2603:10b6:930:8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Tue, 5 Mar 2024 09:53:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000FCC2.mail.protection.outlook.com (10.167.242.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:53:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 5 Mar 2024 01:53:09 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 5 Mar 2024 01:53:07 -0800 From: Xueming Li To: David Marchand CC: Eelco Chaudron , Maxime Coquelin , dpdk stable Subject: patch 'vhost: fix virtqueue access check in VDUSE setup' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:46:37 +0800 Message-ID: <20240305094757.439387-57-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCC2:EE_|MN2PR12MB4064:EE_ X-MS-Office365-Filtering-Correlation-Id: 3dda14d2-3a5d-4adc-d611-08dc3cfa1571 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x93uOG4Lgl2tCZeq/OX/FRS//stzqpe+C7RcLdB8cGcpUWZ1rFQRS/SfkoPmGuxqK+xa9+y0hcaxbUwqWEj3ivgBTKzlgToFCSbUEk/KzvukQD8TWDzc6aHQBif7whfCziUx4vyuE9C5RbMwAbzH0c1gQHYhiwO+RpzCUrVf2fJNWMKOTZohMN855JHO1ANRgt6qa2ibaEF0xxtfdlOBDFDivMng2NEY4eRO7vSbW7Q5rCo1N4Q0wjnE/+K34dLJKnN1B63H5cwpitCmBoll8tZG6YBZ21epZ4gVC3W7HZWGqmvQHGwWK99hRyt5JXseZLnuWuDaFe7Hie68wFlxDCqAGNbWTke46M7lmw7LTjIOGfBkwqv2nFO/lvRORLphcHajXJnlsY0govuialGLMvFJuB6DCMhuK4xvMyZWJkTY+6kJwh23Y+cRbodzodYhmwKjZaFH6SZkixtCdKqzDrjTCQEoTnZNqlR7XSDVuGBaN6dJXk0A5X/vEkNZuk76da1G9MNpmu6C3TyRJjqYrJQ+8KR3iV2sS8ANaz+OW572spooVNt80mdzNnzPNY9nwQAbgyibtbnXz79bax/IqOQAzsXtRMGV96VUQ4wftSP14Hm32Wmq34lnQqqIu0rWvJP7ZaD4Q/Bs/dhzzztmEnUYFTiZE4oVWCqpAtHcoQVcnBn7bXnd5mtJTuLI0ilYorMKcnf8xao6h+Yeu/bQ87UIEX5RXtwvnfsYunosp+p5MWm9Kyw4CyzQhsdqxfpD X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:53:17.7634 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3dda14d2-3a5d-4adc-d611-08dc3cfa1571 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000FCC2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4064 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 Hi, FYI, your patch has been queued to stable release 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/31/24. 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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=692a7a0034dfc55a057be1ffd8623581a5ada51d Thanks. Xueming Li --- >From 692a7a0034dfc55a057be1ffd8623581a5ada51d Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 5 Dec 2023 10:45:32 +0100 Subject: [PATCH] vhost: fix virtqueue access check in VDUSE setup Cc: Xueming Li [ upstream commit af5328656709c65a75fe7bdd4146d18da16104b4 ] vring_translate and vring_invalidate change the vq access_ok field. The access_ok field should only be updated under a (write) lock. Fixes: a9120db8b98b ("vhost: add VDUSE device startup") Fixes: ad67c65efda1 ("vhost: add VDUSE device stop") Signed-off-by: David Marchand Acked-by: Eelco Chaudron Reviewed-by: Maxime Coquelin --- lib/vhost/vduse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c index 080b58f7de..e198eeef64 100644 --- a/lib/vhost/vduse.c +++ b/lib/vhost/vduse.c @@ -196,6 +196,7 @@ vduse_vring_setup(struct virtio_net *dev, unsigned int index) vq->size * sizeof(struct batch_copy_elem), RTE_CACHE_LINE_SIZE, 0); + rte_rwlock_write_lock(&vq->access_lock); vhost_user_iotlb_rd_lock(vq); if (vring_translate(dev, vq)) VHOST_LOG_CONFIG(dev->ifname, ERR, "Failed to translate vring %d addresses\n", @@ -206,6 +207,7 @@ vduse_vring_setup(struct virtio_net *dev, unsigned int index) "Failed to disable guest notifications on vring %d\n", index); vhost_user_iotlb_rd_unlock(vq); + rte_rwlock_write_unlock(&vq->access_lock); vq_efd.index = index; vq_efd.fd = vq->kickfd; @@ -259,7 +261,9 @@ vduse_vring_cleanup(struct virtio_net *dev, unsigned int index) close(vq->kickfd); vq->kickfd = VIRTIO_UNINITIALIZED_EVENTFD; + rte_rwlock_write_lock(&vq->access_lock); vring_invalidate(dev, vq); + rte_rwlock_write_unlock(&vq->access_lock); rte_free(vq->batch_copy_elems); vq->batch_copy_elems = NULL; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:32.668656556 +0800 +++ 0056-vhost-fix-virtqueue-access-check-in-VDUSE-setup.patch 2024-03-05 17:39:30.773566493 +0800 @@ -1 +1 @@ -From af5328656709c65a75fe7bdd4146d18da16104b4 Mon Sep 17 00:00:00 2001 +From 692a7a0034dfc55a057be1ffd8623581a5ada51d Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit af5328656709c65a75fe7bdd4146d18da16104b4 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index c7ba5a61dd..d462428d2c 100644 +index 080b58f7de..e198eeef64 100644 @@ -31 +33 @@ - VHOST_CONFIG_LOG(dev->ifname, ERR, "Failed to translate vring %d addresses", + VHOST_LOG_CONFIG(dev->ifname, ERR, "Failed to translate vring %d addresses\n", @@ -33 +35 @@ - "Failed to disable guest notifications on vring %d", + "Failed to disable guest notifications on vring %d\n",