瀏覽代碼

iommu/amd: Support IOMMU_DOMAIN_IDENTITY type allocation

Add support to allocate direct mapped domains through the
IOMMU-API.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Joerg Roedel 10 年之前
父節點
當前提交
07f643a35d
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      drivers/iommu/amd_iommu.c

+ 7 - 0
drivers/iommu/amd_iommu.c

@@ -2996,6 +2996,13 @@ static struct iommu_domain *amd_iommu_domain_alloc(unsigned type)
 		}
 		pdomain = &dma_domain->domain;
 		break;
+	case IOMMU_DOMAIN_IDENTITY:
+		pdomain = protection_domain_alloc();
+		if (!pdomain)
+			return NULL;
+
+		pdomain->mode = PAGE_MODE_NONE;
+		break;
 	default:
 		return NULL;
 	}