iommu/dmar: silence RCU-list debugging warnings
PATCH 1/1 iommu/dmar: silence RCU-list debugging warnings
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
--- drivers/iommu/dmar.c | 3 ++- include/linux/dmar.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/iommu/dmar.c +2 -1
@@ -363,7 +363,8 @@ static int dmar_pci_bus_notifier(struct notifier_block *nb, {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;
include/linux/dmar.h +4 -2
@@ -74,11 +74,13 @@ struct dmar_pci_notify_info { 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) \
Signature · 6 lines
1.8.3.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Hi,
Quoted 11 lines · Qian Cai
Similar to the commit
02d715b4a818("iommu/vt-d: Fix RCU list debugging warnings"), there are several other places that calllist_for_each_entry_rcu()outside of an RCU read side critical section but withdmar_global_lockheld. Silence those false positives as well.
drivers/iommu/intel-iommu.c:4288RCU-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:366RCU-list traversed in non-reader section!! 1 lock held by swapper/0/1:
Quoted 7 lines
#0: ffffffff935892c8 (dmar_global_lock){+.+.}, at: intel_iommu_init+0x125/0xb97
drivers/iommu/intel-iommu.c:5057RCU-list traversed in non-reader section!! 1 lock held by swapper/0/1:#0: ffffffffa71892c8 (dmar_global_lock){++++}, at: intel_iommu_init+0x61a/0xb13Signed-off-by Qian Cai <[email protected]>
Thanks for the fix.
Best regards,
baolu
Quoted 40 lines
--- drivers/iommu/dmar.c | 3 ++- include/linux/dmar.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-)drivers/iommu/dmar.c +2
-1@@ -363,7 +363,8 @@ static int dmar_pci_bus_notifier(struct notifier_block *nb, {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;include/linux/dmar.h +4
-2@@ -74,11 +74,13 @@ struct dmar_pci_notify_info { 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) \
Joerg Roedel
AppliedQuoted 3 lines · Qian Cai
drivers/iommu/dmar.c | 3 ++- include/linux/dmar.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-)
Applied, thanks.