From: Joerg Roedel Date: Thu, 28 May 2015 16:41:41 +0000 (+0200) Subject: iommu/amd: Support IOMMU_DOMAIN_IDENTITY type allocation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=07f643a35d6b50f0f091444f07db1353188e787e;p=linux-beck.git iommu/amd: Support IOMMU_DOMAIN_IDENTITY type allocation Add support to allocate direct mapped domains through the IOMMU-API. Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 27300aece203..188b81d56ac4 100644 --- a/drivers/iommu/amd_iommu.c +++ b/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; }