aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQian Cai <cai@lca.pw>2020-03-17 11:03:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-23 10:38:19 +0200
commitfa2fa282240b6b5d5a82b344c1c706e685bbd398 (patch)
tree37633bfd3a2420b384417d23710dfd2e2152d28b
parentb0d0decd3d51a1d81f0414c925de55303964d84e (diff)
downloadlinux-yocto-fa2fa282240b6b5d5a82b344c1c706e685bbd398.tar.gz
linux-yocto-fa2fa282240b6b5d5a82b344c1c706e685bbd398.tar.bz2
linux-yocto-fa2fa282240b6b5d5a82b344c1c706e685bbd398.zip
iommu/vt-d: Silence RCU-list debugging warning in dmar_find_atsr()
[ Upstream commit c6f4ebdeba4cff590594df931ff1ee610c426431 ] 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 <cai@lca.pw> Acked-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/iommu/intel-iommu.c3
1 files changed, 2 insertions, 1 deletions
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;