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 AC2CE43892 for ; Thu, 11 Jan 2024 12:10:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 874BF4025E; Thu, 11 Jan 2024 12:10:50 +0100 (CET) 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 06EE440042 for ; Thu, 11 Jan 2024 12:10:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704971448; 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=WV95VGXXV0FoQYxkpmd5vyjKSt44tmqL20dBSYtHbtE=; b=LHhfKwY+OyExF4azC8VKk47rwFsiJLVo8aufA0N381buHb9RAGYDEQ18LoHZYjy8Ps4nap 58bUSHI4NjBsd3FSgV+kXksTfIsRWPxbMo9qFK9rjHDf4SkSjInh+CSaU47IRkP5tXQjrS 7TUBQMx3D3L3KFWNskMUBjJ9l8ZlLmQ= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-Cv8GBELlNp-4n-P3we1NGA-1; Thu, 11 Jan 2024 06:10:47 -0500 X-MC-Unique: Cv8GBELlNp-4n-P3we1NGA-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-50e73a3a280so3991198e87.3 for ; Thu, 11 Jan 2024 03:10:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704971445; x=1705576245; 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=WV95VGXXV0FoQYxkpmd5vyjKSt44tmqL20dBSYtHbtE=; b=Iv+zwRMG7ddiVw7+OLkXCzls/tORVI9L+K8AkK0nUmw5UJbFLvOOlNpLruHfu/NfwC sU+dz9vpWdxqRUmH8m5FKuT7vbgfJizwpv0o+J5b8nwGixk1QlVuhwiG1izpvmhClJJh HqRe7+3cHtp6MS2DB55J8LAO1f5VgIoP5045xv3D7A3uToy59+GQv2bMhOR1y+mHq/au liZjCmVjwz8kTa4SeJT7S5470x7kiDVt6W1qzRlFWsyT9o67er4VoSD0MlXx2O7a+SHz ZtJGtXPnEhDKg1V8Xs8YUpbujkYQPRI/+5T80KthAZYlzS/lQG4xXw+9RXjB1V7ZZO9I xrSA== X-Gm-Message-State: AOJu0YwRA4IxbYysshaaQsU12cPVYiuL50kJtBlqhhjUWUEr6zobqJGE qQRDymrIDe23svd0JoDA5fBetPd5rCMLr2t6MNONRfOHe6pFopKxv/O81k9AUm6fYVOmwSFd2gg JNLYml9ZRgLreQR4OORC4k9zYa50/HNE= X-Received: by 2002:ac2:48a8:0:b0:50e:7fa7:9c68 with SMTP id u8-20020ac248a8000000b0050e7fa79c68mr411447lfg.139.1704971445631; Thu, 11 Jan 2024 03:10:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDLRA/2GWpnPP2jHtRc8yGWet/SWd7OhZQGL5V8TyquEXuZajIRBEMLVdJfftf8BuhuhJX3qxiaGV1mlMuZT8= X-Received: by 2002:ac2:48a8:0:b0:50e:7fa7:9c68 with SMTP id u8-20020ac248a8000000b0050e7fa79c68mr411439lfg.139.1704971445326; Thu, 11 Jan 2024 03:10:45 -0800 (PST) MIME-Version: 1.0 References: <20240111105158.3508078-1-maxime.coquelin@redhat.com> In-Reply-To: <20240111105158.3508078-1-maxime.coquelin@redhat.com> From: David Marchand Date: Thu, 11 Jan 2024 12:10:33 +0100 Message-ID: Subject: Re: [PATCH v22.11] vhost: fix missing spinlock unlock To: Maxime Coquelin , Lingli Chen Cc: stable@dpdk.org, xuemingl@nvidia.com, ktraynor@redhat.com X-Mimecast-Spam-Score: 0 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, Jan 11, 2024 at 11:52=E2=80=AFAM Maxime Coquelin wrote: > > Two regressions were introduced when backporting below > patch: > b4c4e5675c85 ("vhost: fix missing lock protection in power monitor API") > > First, rte_vhost_get_monitor_addr did not release the lock > in the success case. Then, rte_rwlock_read_lock() was > converted to rte_spinlock_trylock() instead of > rte_spinlock_lock(). > > This patch addresses both of these issues. > Bugzilla ID: 1338 > Fixes: a07736eb68da ("vhost: fix missing lock protection in power monitor= API") > Cc: stable@dpdk.org > > Signed-off-by: Maxime Coquelin I backported the lock annotations for the vhost lib in 22.11. Indeed, clang reports a deadlock in this part of the code which likely explains the bug report. [1/2] Compiling C object lib/librte_vhost.a.p/vhost_vhost.c.o ../lib/vhost/vhost.c:2092:1: warning: mutex 'vq->access_lock' is not held on every path through here [-Wthread-safety-analysis] } ^ ../lib/vhost/vhost.c:2061:7: note: mutex acquired here if (!rte_spinlock_trylock(&vq->access_lock)) ^ 1 warning generated. [2/2] Linking static target lib/librte_vhost.a I applied this patch and the issue is gone. Tested-by: David Marchand Can the bz reporter test this patch? --=20 David Marchand