summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2019-06-03 08:53:33 +0200
committerJoerg Roedel <jroedel@suse.de>2019-06-12 10:32:59 +0200
commite143fd4598ddf7401d3699957cd59ceb5426d53d (patch)
tree9cf67a124b71f80c84d120d49a396fe6b3df6955 /drivers/iommu
parentb9a7f9816483b19360b92e9b8c91bea2f9f30308 (diff)
downloadlinux-e143fd4598ddf7401d3699957cd59ceb5426d53d.tar.bz2
iommu/vt-d: Handle RMRR with PCI bridge device scopes
When reading the vtd specification and especially the Reserved Memory Region Reporting Structure chapter, it is not obvious a device scope element cannot be a PCI-PCI bridge, in which case all downstream ports are likely to access the reserved memory region. Let's handle this case in device_has_rmrr. Fixes: ea2447f700ca ("intel-iommu: Prevent devices with RMRRs from being placed into SI Domain") Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-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 6747fec46cfb..0d7d177673dd 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2880,7 +2880,8 @@ static bool device_has_rmrr(struct device *dev)
*/
for_each_active_dev_scope(rmrr->devices,
rmrr->devices_cnt, i, tmp)
- if (tmp == dev) {
+ if (tmp == dev ||
+ is_downstream_to_pci_bridge(dev, tmp)) {
rcu_read_unlock();
return true;
}