From nobody Tue Nov 26 18:25:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706082207; cv=none; d=zohomail.com; s=zohoarc; b=DSz2UVxws8yGVnuMidM+RGSWiaqUbrqnop1o9eoXmmulNPgCStyYCeohztM5ufuEbIsvQUNC7y/pd+feYzMJL7ffD0b0rE8np6e/ITyg9dGdCUQJzni7bNiL8qu5HRsgZ/FTw49RLzAjlzIdV2CpeeOhDjkJ0tkQpjA2pjpA3Yo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706082207; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+CzCtL3SwjCr5p6pkrscLd3wUMqqdx6mKYfPlktWfVc=; b=LO60aMbcReEMjU1sbPuZEFkqwpLkNnBF7ySi/vMGNrQ6W0WLAAui8uEexuMZUedYWChGlAz7Qt0WeCnuUzOVwAg3kmX7erBrckGtCA3YxLcXwOEeNmgfkA2LOh3LL/jK7Rs1ppMIU6TaYmYnJQWd7oFPfXyoKBVeF4G85wzbjzk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706082207884837.7010352663208; Tue, 23 Jan 2024 23:43:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSXuL-0003Wm-2b; Wed, 24 Jan 2024 02:42:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSXuJ-0003SQ-Lx for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:42:47 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSXuI-00036k-6s for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:42:47 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40ebf373130so14050255e9.3 for ; Tue, 23 Jan 2024 23:42:45 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id fl21-20020a05600c0b9500b0040e9d507424sm18572088wmb.5.2024.01.23.23.42.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jan 2024 23:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706082164; x=1706686964; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+CzCtL3SwjCr5p6pkrscLd3wUMqqdx6mKYfPlktWfVc=; b=Dw9EBgOxjeWp9+7sEtEm0Nmzo5Ytw/pvrLR5W2xeZekYEnqOhTGSYxG4QtNHVJM3a/ kTfPnbfd1P8LHlxs+j4mpUkD5cbI2wRo1wVERejzluKOgpLAw04hxeDafJdixD8B4o7b yXc4hppOB5kIHjS9puAmI8KdYrNG764vmLbMaaIhrW4Fq5RwgCRJL3gptL4Cd0Cv/Ssr AQNr2vB8+5pXx0FaFv6Iuutr/2ZdwvPkTdFv8ZcEoNXw4PIzGtgRv7YYCQlMNRoOZMXB eE5veuqk9tNeoejZ8wvQsMUtfwVnIf4mddEaQvi9cGsjTlwS6txoTgIGpdfoxJOV7fDI UWxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706082164; x=1706686964; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+CzCtL3SwjCr5p6pkrscLd3wUMqqdx6mKYfPlktWfVc=; b=WP3g8wawFB4hGWPShl+czE0FaS9y9eA6dCqULrdshhcb6G6cinmA6ARwNzuxTSKFkj EQCUdf7ZfpgyK+ASfUWKxOInNa6tG8s7VcHkFOhYbUQsA11a98GDHMT3TlXxcYwg1gIC w6Ysy+kpjtjQX2FZdI1SekrLVO0PqzqCg0zynkt0JckTcgK0Ngl0t2lmTR+wjupPdJil ZH8EJXvktu4vWTJMrcWPzXd6dPL15LjEIyZ9hgWSigx+xswWfmFL4GazH9do4MUp5C9Q sm8pA4XRs0RAsf8/wsr4VDRBZH1BMh9I/W5NCDmGdPUoRZqGp6aQYIQGQpS2QJ2/PKN+ MTAA== X-Gm-Message-State: AOJu0Yz+deo1tMsMhEREdF+d0zyVo+63yohwkwGlt9q1BNppUTscGFYo AmXrnPB1AwvomfocRarmjy1u7oP8enpbLr7H/CipGJSBW0gTcjDnCeKFs0FcuTJpGw0bDxHEApM V X-Google-Smtp-Source: AGHT+IHkxW/G4EA4Q/7i1YEwCr7CWDRc2y3STXDIKEXI+Lfm+5v3LDHNMJTPr1SL4F9fLMydWiKBEw== X-Received: by 2002:a05:600c:214:b0:40e:52ca:3043 with SMTP id 20-20020a05600c021400b0040e52ca3043mr1154125wmi.131.1706082164453; Tue, 23 Jan 2024 23:42:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Christian Schoenebeck , Fam Zheng , Greg Kurz , Richard Henderson , "Michael S. Tsirkin" , Gerd Hoffmann , Alex Williamson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/6] hw/virtio/vhost: Use RCU_READ macro Date: Wed, 24 Jan 2024 08:42:01 +0100 Message-ID: <20240124074201.8239-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124074201.8239-1-philmd@linaro.org> References: <20240124074201.8239-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706082208742100003 Replace the manual rcu_read_(un)lock calls by the WITH_RCU_READ_LOCK_GUARD macro (See commit ef46ae67ba "docs/style: call out the use of GUARD macros"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis --- hw/virtio/vhost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 2c9ac79468..1f5ecb843e 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -186,12 +186,12 @@ static int vhost_sync_dirty_bitmap(struct vhost_dev *= dev, hwaddr phys, s, offset; =20 while (used_size) { - rcu_read_lock(); - iotlb =3D address_space_get_iotlb_entry(dev->vdev->dma_as, + WITH_RCU_READ_LOCK_GUARD() { + iotlb =3D address_space_get_iotlb_entry(dev->vdev->dma= _as, used_phys, true, MEMTXATTRS_UNSPECIFI= ED); - rcu_read_unlock(); + } =20 if (!iotlb.target_as) { qemu_log_mask(LOG_GUEST_ERROR, "translation " --=20 2.41.0