Skip to content

Commit 9235cb1

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Allow devices with RMRRs to use identity domain
Since commit ea2447f ("intel-iommu: Prevent devices with RMRRs from being placed into SI Domain"), the Intel IOMMU driver doesn't allow any devices with RMRR locked to use the identity domain. This was added to to fix the issue where the RMRR info for devices being placed in and out of the identity domain gets lost. This identity maps all RMRRs when setting up the identity domain, so that devices with RMRRs could also use it. Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent ce4cc52 commit 9235cb1

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,20 +2893,15 @@ static int __init si_domain_init(int hw)
28932893
}
28942894

28952895
/*
2896-
* Normally we use DMA domains for devices which have RMRRs. But we
2897-
* loose this requirement for graphic and usb devices. Identity map
2898-
* the RMRRs for graphic and USB devices so that they could use the
2899-
* si_domain.
2896+
* Identity map the RMRRs so that devices with RMRRs could also use
2897+
* the si_domain.
29002898
*/
29012899
for_each_rmrr_units(rmrr) {
29022900
for_each_active_dev_scope(rmrr->devices, rmrr->devices_cnt,
29032901
i, dev) {
29042902
unsigned long long start = rmrr->base_address;
29052903
unsigned long long end = rmrr->end_address;
29062904

2907-
if (device_is_rmrr_locked(dev))
2908-
continue;
2909-
29102905
if (WARN_ON(end < start ||
29112906
end >> agaw_to_width(si_domain->agaw)))
29122907
continue;
@@ -3045,9 +3040,6 @@ static int device_def_domain_type(struct device *dev)
30453040
if (dev_is_pci(dev)) {
30463041
struct pci_dev *pdev = to_pci_dev(dev);
30473042

3048-
if (device_is_rmrr_locked(dev))
3049-
return IOMMU_DOMAIN_DMA;
3050-
30513043
/*
30523044
* Prevent any device marked as untrusted from getting
30533045
* placed into the statically identity mapping domain.
@@ -3085,9 +3077,6 @@ static int device_def_domain_type(struct device *dev)
30853077
return IOMMU_DOMAIN_DMA;
30863078
} else if (pci_pcie_type(pdev) == PCI_EXP_TYPE_PCI_BRIDGE)
30873079
return IOMMU_DOMAIN_DMA;
3088-
} else {
3089-
if (device_has_rmrr(dev))
3090-
return IOMMU_DOMAIN_DMA;
30913080
}
30923081

30933082
return (iommu_identity_mapping & IDENTMAP_ALL) ?

0 commit comments

Comments
 (0)