|
|
@@ -3119,21 +3119,24 @@ static void amd_iommu_get_resv_regions(struct device *dev,
|
|
|
return;
|
|
|
|
|
|
list_for_each_entry(entry, &amd_iommu_unity_map, list) {
|
|
|
+ int type, prot = 0;
|
|
|
size_t length;
|
|
|
- int prot = 0;
|
|
|
|
|
|
if (devid < entry->devid_start || devid > entry->devid_end)
|
|
|
continue;
|
|
|
|
|
|
+ type = IOMMU_RESV_DIRECT;
|
|
|
length = entry->address_end - entry->address_start;
|
|
|
if (entry->prot & IOMMU_PROT_IR)
|
|
|
prot |= IOMMU_READ;
|
|
|
if (entry->prot & IOMMU_PROT_IW)
|
|
|
prot |= IOMMU_WRITE;
|
|
|
+ if (entry->prot & IOMMU_UNITY_MAP_FLAG_EXCL_RANGE)
|
|
|
+ /* Exclusion range */
|
|
|
+ type = IOMMU_RESV_RESERVED;
|
|
|
|
|
|
region = iommu_alloc_resv_region(entry->address_start,
|
|
|
- length, prot,
|
|
|
- IOMMU_RESV_DIRECT);
|
|
|
+ length, prot, type);
|
|
|
if (!region) {
|
|
|
pr_err("Out of memory allocating dm-regions for %s\n",
|
|
|
dev_name(dev));
|