Skip to content

Commit

Permalink
iommu/vt-d: Handle RMRR with PCI bridge device scopes
Browse files Browse the repository at this point in the history
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: ea2447f ("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>
  • Loading branch information
Eric Auger authored and Joerg Roedel committed Jun 12, 2019
1 parent b9a7f98 commit e143fd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e143fd4

Please sign in to comment.