Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp247891ybh; Tue, 17 Mar 2020 22:29:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvjRnNsfTmJgNvis5dNzCUDMeuaVhol90vciLR/UIVIa56OwYNTbi6DJ09+VfFWvQI2WIDG X-Received: by 2002:a9d:6654:: with SMTP id q20mr2548637otm.180.1584509378562; Tue, 17 Mar 2020 22:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584509378; cv=none; d=google.com; s=arc-20160816; b=uREYjPuqFqQPU5p+OKxe53sLiUimZO3RniN5+uCyxac/R4xdC5hDdLFKWy9Tyi4IRz vLCBGuRw5D/dMCr2Z5BWjDphMVpPTLtzbS4AOdgVaR1Y9n+dQWJvisZQXbnWNd/z7aM4 OIa5ssHsBWemo7FwC331zlTCr60QsTJ0SEm+j3jxWS8lBkyHfpVgaJuU8GT8yKnlLVpD UvX8kxtwvnEMs0yPM3BFQq4nF19besfi6QetSjabDrPZtJ9p8MAX+a6vuv5XGbrxGiGP Vej9qzRIPZ7/2wdYs4N6lA/kmLJgnmZ2dTD0wgsPDzHEc9txO2OsNh95jpZSmtcDTDfm 5nEg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc:ironport-sdr:ironport-sdr; bh=OcLiM2HeGh5IgTEEI2/wkkj9tk5lVzncrtYt/Aib2hc=; b=DCuC8JgWmrcTYZf1KB7fIwX7vKFY7dKVoKbmIgC2Zq9YBKNohDjTC/gG0kEo72MrXW 3W9jMr7YDwYkO8jFk1/AsKz1XSgI8cwPueggvUuHIg0DlHYWYnmEyz3BVlP4QZZiD5WG Yqca1r+77RxviubdXgD0XsdMYKzdHVhvYNs5F5bq08U7/IM41BuzilWI5naTuRWxxeDQ sc6uT2kxDqljxdGCqnvFk7KNIyHn7BQsmRqNZ7PatRAoyFhb1OBgWXjw36VpuPOufMTZ //4E+HRiqi+ZIZX+JblWYuH85wAaDn0mfWuRy5p9OwKmeQozj9ZCoHB439dNLhwLIaeT DwMQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si2792071oti.311.2020.03.17.22.29.25; Tue, 17 Mar 2020 22:29:38 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbgCRF14 (ORCPT + 99 others); Wed, 18 Mar 2020 01:27:56 -0400 Received: from mga17.intel.com ([192.55.52.151]:55088 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726478AbgCRF14 (ORCPT ); Wed, 18 Mar 2020 01:27:56 -0400 IronPort-SDR: zw2HLDlMOcu2DBo3Yy2tZdFq6JirdkSixExbqtuwI08s1f0Tdnom/cV5NFMh5fGur7zgR1K8IU LvPhWCY9mIqQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 22:27:56 -0700 IronPort-SDR: uZEuCHI+tEzJyoqs0pj1nsWFmlhiL3CqHyjZh9IskV9mrJQUfPSjNCQIs+AwzKnKtdhWXFt1tu TFHnYSwAOQvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,566,1574150400"; d="scan'208";a="263274199" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.212.140]) ([10.254.212.140]) by orsmga002.jf.intel.com with ESMTP; 17 Mar 2020 22:27:54 -0700 Cc: baolu.lu@linux.intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iommu/vt-d: silence a RCU-list debugging warning To: Qian Cai , jroedel@suse.de References: <20200317150326.1659-1-cai@lca.pw> From: Lu Baolu Message-ID: <36b9e69b-ee3f-c17d-1788-64448ce8bc14@linux.intel.com> Date: Wed, 18 Mar 2020 13:27:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200317150326.1659-1-cai@lca.pw> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/3/17 23:03, Qian Cai wrote: > dmar_find_atsr() calls list_for_each_entry_rcu() outside of an RCU read > side critical section but with dmar_global_lock held. Silence this > false positive. > > drivers/iommu/intel-iommu.c:4504 RCU-list traversed in non-reader section!! > 1 lock held by swapper/0/1: > #0: ffffffff9755bee8 (dmar_global_lock){+.+.}, at: intel_iommu_init+0x1a6/0xe19 > > Call Trace: > dump_stack+0xa4/0xfe > lockdep_rcu_suspicious+0xeb/0xf5 > dmar_find_atsr+0x1ab/0x1c0 > dmar_parse_one_atsr+0x64/0x220 > dmar_walk_remapping_entries+0x130/0x380 > dmar_table_init+0x166/0x243 > intel_iommu_init+0x1ab/0xe19 > pci_iommu_init+0x1a/0x44 > do_one_initcall+0xae/0x4d0 > kernel_init_freeable+0x412/0x4c5 > kernel_init+0x19/0x193 > > Signed-off-by: Qian Cai How about changing the commit subject to "iommu/vt-d: Silence RCU-list debugging warning in dmar_find_atsr()"? Acked-by: Lu Baolu Best regards, baolu > --- > drivers/iommu/intel-iommu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c > index 4be549478691..ef0a5246700e 100644 > --- a/drivers/iommu/intel-iommu.c > +++ b/drivers/iommu/intel-iommu.c > @@ -4501,7 +4501,8 @@ static struct dmar_atsr_unit *dmar_find_atsr(struct acpi_dmar_atsr *atsr) > struct dmar_atsr_unit *atsru; > struct acpi_dmar_atsr *tmp; > > - list_for_each_entry_rcu(atsru, &dmar_atsr_units, list) { > + list_for_each_entry_rcu(atsru, &dmar_atsr_units, list, > + dmar_rcu_check()) { > tmp = (struct acpi_dmar_atsr *)atsru->hdr; > if (atsr->segment != tmp->segment) > continue; >