Skip to content

Commit

Permalink
iommu/vt-d: Silence RCU-list debugging warnings
Browse files Browse the repository at this point in the history
Similar to the commit 02d715b ("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 <cai@lca.pw>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Qian Cai authored and Joerg Roedel committed Mar 10, 2020
1 parent 2d48ea0 commit f515241
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion drivers/iommu/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,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;
Expand Down
6 changes: 4 additions & 2 deletions include/linux/dmar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit f515241

Please sign in to comment.