From patchwork Fri Apr 29 18:37:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1624499 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=kjvV+QUC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kqh6w6xmxz9sCq for ; Sat, 30 Apr 2022 04:37:27 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nkVUW-0006I5-N4; Fri, 29 Apr 2022 18:37:20 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nkVUV-0006HR-NG for kernel-team@lists.ubuntu.com; Fri, 29 Apr 2022 18:37:19 +0000 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 8252A3F1D8 for ; Fri, 29 Apr 2022 18:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1651257439; bh=hjp0vVH9+I7mWxnSXAzHEv5b5h74KF10fsFMp5iayJY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kjvV+QUCihe75iE8nrNYBt5ZJf6TV8eY4dOeTOd7Ex3+VBYOtjb7FPhFIn4zXEMU5 P8Di0+7iYB56T8VmTspO1ywD8H2HXQQoxo+M4QdqhUt94owL8CwDOfjWCtAVeNW1cS PX+RzxNhQ8yb+zXvCT66YI9YbBBj8eNrfg0wh1vni0UYitk7V2kheG0TioAKvGa+pu xH+oqjKQR3CwfAUBEiKt8vpygoTcWdjacVz/CeY89lr2ZOrxkJtUjVFmn4xX6xEXrX 9Q9+5cK0qpNMnmv1jxaxyKA5eUYcZjkc0Fog4dbJTGU6sbxknbfPs1aBvX6pp+KxP0 ObTwjWw+hWU8w== Received: by mail-pf1-f198.google.com with SMTP id x16-20020aa793b0000000b0050d3d5c4f4eso4560104pff.6 for ; Fri, 29 Apr 2022 11:37:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hjp0vVH9+I7mWxnSXAzHEv5b5h74KF10fsFMp5iayJY=; b=lT/VAMzq7vcWjkmAfDAt67QrufjIgQVgZDw3RYhpxNOZfIP5miHZVzH4t1tZRI4Htt XYdZGjhihGMvWc3OIGcrfLlQyRdaqOK9kaiTmsAeIMVt6ztSC1NekDNDuzsKvRWs4UN8 V53M+AMQG6HyK+6Gy2Hfi47CsC+kn8OTPFVIJ9NpPrivZ72CpbmKcQgMDFlwLQ5LwbCN ibKEQH+YFEa1JFiW2q5QM2IJUHeZdKNBra+IbSxcWUabi1FzT/Kh1hXceRo+fj/bp21V LPQl4ZaHeQtnMrsWZxIjINNiH2+st3DECIN9Xj3mD1x2YyAdgpPOUpYldv2rqu6121kV 8PXA== X-Gm-Message-State: AOAM530MWPw5P9i9g6YgHEQclw8U8GNr0rutVtGIUaYLjyq2+UMlos6G hzZNdeST7rj2KwW45eTkZiTKevnxNpab/TciOwnZvEWg9rkjbaeZRms9JqoKgHB4DS5zc3UlwXD M5/u5AENibHgICTn+EtMB2n6bG1uLuNd6MqKkO2KYkQ== X-Received: by 2002:a05:6a00:18a1:b0:50d:3211:8300 with SMTP id x33-20020a056a0018a100b0050d32118300mr682090pfh.66.1651257437829; Fri, 29 Apr 2022 11:37:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9aH3kEfthQ2glFdyPH0TJyu/KubzjPCZ5RptQvDipGQL1zR93RsCBjGAN2axEurtOJ1T5WQ== X-Received: by 2002:a05:6a00:18a1:b0:50d:3211:8300 with SMTP id x33-20020a056a0018a100b0050d32118300mr682069pfh.66.1651257437526; Fri, 29 Apr 2022 11:37:17 -0700 (PDT) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id s22-20020a17090ad49600b001cd4989fee1sm14505703pju.45.2022.04.29.11.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:37:17 -0700 (PDT) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/3] Drivers: hv: vmbus: Replace smp_store_mb() with virt_store_mb() Date: Fri, 29 Apr 2022 12:37:07 -0600 Message-Id: <20220429183707.25448-4-tim.gardner@canonical.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429183707.25448-1-tim.gardner@canonical.com> References: <20220429183707.25448-1-tim.gardner@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Andrea Parri (Microsoft)" BugLink: https://bugs.launchpad.net/bugs/1970468 Following the recommendation in Documentation/memory-barriers.txt for virtual machine guests. Fixes: 8b6a877c060ed ("Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels") Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20220328154457.100872-1-parri.andrea@gmail.com Signed-off-by: Wei Liu (cherry picked from commit eaa03d34535872d29004cb5cf77dc9dec1ba9a25) Signed-off-by: Tim Gardner --- drivers/hv/channel_mgmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 5d1961c761c1a..e773cff8deca5 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -356,7 +356,7 @@ void vmbus_channel_map_relid(struct vmbus_channel *channel) * execute: * * (a) In the "normal (i.e., not resuming from hibernation)" path, - * the full barrier in smp_store_mb() guarantees that the store + * the full barrier in virt_store_mb() guarantees that the store * is propagated to all CPUs before the add_channel_work work * is queued. In turn, add_channel_work is queued before the * channel's ring buffer is allocated/initialized and the @@ -368,14 +368,14 @@ void vmbus_channel_map_relid(struct vmbus_channel *channel) * recv_int_page before retrieving the channel pointer from the * array of channels. * - * (b) In the "resuming from hibernation" path, the smp_store_mb() + * (b) In the "resuming from hibernation" path, the virt_store_mb() * guarantees that the store is propagated to all CPUs before * the VMBus connection is marked as ready for the resume event * (cf. check_ready_for_resume_event()). The interrupt handler * of the VMBus driver and vmbus_chan_sched() can not run before * vmbus_bus_resume() has completed execution (cf. resume_noirq). */ - smp_store_mb( + virt_store_mb( vmbus_connection.channels[channel->offermsg.child_relid], channel); }