Skip to content

Commit ad56766

Browse files
LuBaolugregkh
authored andcommitted
iommu/vt-d: Allow devices with RMRRs to use identity domain
commit 9235cb1 upstream. 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]> Cc: Alan Stern <[email protected]> Cc: John Donnelly <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 04ad505 commit ad56766

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
@@ -2762,20 +2762,15 @@ static int __init si_domain_init(int hw)
27622762
}
27632763

27642764
/*
2765-
* Normally we use DMA domains for devices which have RMRRs. But we
2766-
* loose this requirement for graphic and usb devices. Identity map
2767-
* the RMRRs for graphic and USB devices so that they could use the
2768-
* si_domain.
2765+
* Identity map the RMRRs so that devices with RMRRs could also use
2766+
* the si_domain.
27692767
*/
27702768
for_each_rmrr_units(rmrr) {
27712769
for_each_active_dev_scope(rmrr->devices, rmrr->devices_cnt,
27722770
i, dev) {
27732771
unsigned long long start = rmrr->base_address;
27742772
unsigned long long end = rmrr->end_address;
27752773

2776-
if (device_is_rmrr_locked(dev))
2777-
continue;
2778-
27792774
if (WARN_ON(end < start ||
27802775
end >> agaw_to_width(si_domain->agaw)))
27812776
continue;
@@ -2914,9 +2909,6 @@ static int device_def_domain_type(struct device *dev)
29142909
if (dev_is_pci(dev)) {
29152910
struct pci_dev *pdev = to_pci_dev(dev);
29162911

2917-
if (device_is_rmrr_locked(dev))
2918-
return IOMMU_DOMAIN_DMA;
2919-
29202912
/*
29212913
* Prevent any device marked as untrusted from getting
29222914
* placed into the statically identity mapping domain.
@@ -2954,9 +2946,6 @@ static int device_def_domain_type(struct device *dev)
29542946
return IOMMU_DOMAIN_DMA;
29552947
} else if (pci_pcie_type(pdev) == PCI_EXP_TYPE_PCI_BRIDGE)
29562948
return IOMMU_DOMAIN_DMA;
2957-
} else {
2958-
if (device_has_rmrr(dev))
2959-
return IOMMU_DOMAIN_DMA;
29602949
}
29612950

29622951
return (iommu_identity_mapping & IDENTMAP_ALL) ?

0 commit comments

Comments
 (0)