Skip to content

Commit f515241

Browse files
Qian Caijoergroedel
authored andcommitted
iommu/vt-d: Silence RCU-list debugging warnings
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 <[email protected]> Acked-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 2d48ea0 commit f515241

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

drivers/iommu/dmar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ dmar_find_dmaru(struct acpi_dmar_hardware_unit *drhd)
363363
{
364364
struct dmar_drhd_unit *dmaru;
365365

366-
list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list)
366+
list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list,
367+
dmar_rcu_check())
367368
if (dmaru->segment == drhd->segment &&
368369
dmaru->reg_base_addr == drhd->address)
369370
return dmaru;

include/linux/dmar.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ extern struct list_head dmar_drhd_units;
7474
dmar_rcu_check())
7575

7676
#define for_each_active_drhd_unit(drhd) \
77-
list_for_each_entry_rcu(drhd, &dmar_drhd_units, list) \
77+
list_for_each_entry_rcu(drhd, &dmar_drhd_units, list, \
78+
dmar_rcu_check()) \
7879
if (drhd->ignored) {} else
7980

8081
#define for_each_active_iommu(i, drhd) \
81-
list_for_each_entry_rcu(drhd, &dmar_drhd_units, list) \
82+
list_for_each_entry_rcu(drhd, &dmar_drhd_units, list, \
83+
dmar_rcu_check()) \
8284
if (i=drhd->iommu, drhd->ignored) {} else
8385

8486
#define for_each_iommu(i, drhd) \

0 commit comments

Comments
 (0)