Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3300040ybb; Tue, 31 Mar 2020 02:24:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvwhhw8f73fXBYhZNiTL4GNbOl1+dBF5+0uD4nnVAmuqmEzCWV1ML5MmvlnwO0gbVabR1UR X-Received: by 2002:a05:6830:1d91:: with SMTP id y17mr12230189oti.184.1585646677725; Tue, 31 Mar 2020 02:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646677; cv=none; d=google.com; s=arc-20160816; b=MW5xUQAnFozHYfDstjsKwO6B4/B0A73hjt7RkSnLzRzcXYcuJ05k+IuNkNWdGNkOYe 2Hr7hMDiu5VoI/9RSbR/U2DIRj/CO3xAv6ODmUF7XmTzz+IfmvH8n2kLgyGUZedexsCG ugM34LNmPdmBBRluasd25mYffrd8Sl+ra/j1Y59WRyrfkX+zxQoFotcYc84OpghKw335 VR5JYnHvMVTE1V7ffcCsR6KD5UYlKZpFpZ3ry9v2DZYmh/l1agibafPOCm4wb4Ubd7Da 24aG040wlMn/NVWIAlJu1CaJcY4MH6ZAZ9E6jhrRHzeVXhkw6imBvH9dWgc/HPGsykcX Ms7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oUTs/Qsydtxys3hrtr2pDI5poJzunLiBm0x8x/WnrSQ=; b=v5QO269Ge1Vz4VqBwPNhIhqXKkqFEF8bYDeMQHjZtTWXvGDc64GFIIy+Mjr6JrLIqv M5t0igdBSGK/GnfZ8xpSlqm6UKYJrU6hy3FobtPCXDRBp0NExLDK0aiD19dOF3T07Siz XaPzwcXZMfm7ydQR9PhaU1VlfmmnkaX4KTbxrp6/vc5zNVUykbQMB2d/pWWe9sTev9Y9 FMvITwZzT69MSn/eNlQtGu/IsqD1xVgE/310gJEJhquRdbU+7hblwJZJ61Bn5vq8UlFX AkZR8XFsfs95ttdL0k8t8xwQJEhk0sKSFhOkkB84N5glaEVJ1flAQV4aFGd/vL0AZDhY VYPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="IV/Wphgg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17si4273147oix.228.2020.03.31.02.24.25; Tue, 31 Mar 2020 02:24:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="IV/Wphgg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730896AbgCaJWc (ORCPT + 99 others); Tue, 31 Mar 2020 05:22:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:48788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731195AbgCaJHH (ORCPT ); Tue, 31 Mar 2020 05:07:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 665B820B1F; Tue, 31 Mar 2020 09:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645626; bh=a6j/XWE8nTq+3h5O4aoFe2okcRGUNuXiPGmpylvwukc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IV/Wphggwh2/Xvb7K9oYymIhdblZRrO1uXYdEm7qtHx8ULM12wmaIXi662CofVm/s 8hm6zq4ckSSYd1t8neE5wB55CVHFUofNZFvmp9wI8WtfcWRzgHiJIrC0rXIIqkwe1d p1g472+rHPjdoMw2Hk9l5BZKKRaz2/WepGVBuz8Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 5.5 073/170] iommu/vt-d: Silence RCU-list debugging warnings Date: Tue, 31 Mar 2020 10:58:07 +0200 Message-Id: <20200331085432.115748881@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qian Cai [ Upstream commit f5152416528c2295f35dd9c9bd4fb27c4032413d ] Similar to the commit 02d715b4a818 ("iommu/vt-d: Fix RCU list debugging warnings"), there are several other places that call list_for_each_entry_rcu() outside of an RCU read side critical section but with dmar_global_lock held. Silence those false positives as well. drivers/iommu/intel-iommu.c:4288 RCU-list traversed in non-reader section!! 1 lock held by swapper/0/1: #0: ffffffff935892c8 (dmar_global_lock){+.+.}, at: intel_iommu_init+0x1ad/0xb97 drivers/iommu/dmar.c:366 RCU-list traversed in non-reader section!! 1 lock held by swapper/0/1: #0: ffffffff935892c8 (dmar_global_lock){+.+.}, at: intel_iommu_init+0x125/0xb97 drivers/iommu/intel-iommu.c:5057 RCU-list traversed in non-reader section!! 1 lock held by swapper/0/1: #0: ffffffffa71892c8 (dmar_global_lock){++++}, at: intel_iommu_init+0x61a/0xb13 Signed-off-by: Qian Cai Acked-by: Lu Baolu Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/dmar.c | 3 ++- include/linux/dmar.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 93f8e646cb0b0..f7a86652a9841 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -371,7 +371,8 @@ dmar_find_dmaru(struct acpi_dmar_hardware_unit *drhd) { struct dmar_drhd_unit *dmaru; - list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list) + list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list, + dmar_rcu_check()) if (dmaru->segment == drhd->segment && dmaru->reg_base_addr == drhd->address) return dmaru; diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 712be8bc6a7c8..d7bf029df737d 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h @@ -74,11 +74,13 @@ extern struct list_head dmar_drhd_units; dmar_rcu_check()) #define for_each_active_drhd_unit(drhd) \ - list_for_each_entry_rcu(drhd, &dmar_drhd_units, list) \ + list_for_each_entry_rcu(drhd, &dmar_drhd_units, list, \ + dmar_rcu_check()) \ if (drhd->ignored) {} else #define for_each_active_iommu(i, drhd) \ - list_for_each_entry_rcu(drhd, &dmar_drhd_units, list) \ + list_for_each_entry_rcu(drhd, &dmar_drhd_units, list, \ + dmar_rcu_check()) \ if (i=drhd->iommu, drhd->ignored) {} else #define for_each_iommu(i, drhd) \ -- 2.20.1