Browse Source

AMD IOMMU: add a domain flag for default domains

Impact: adds a new protection domain flag

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel 16 years ago
parent
commit
e2dc14a2a6
2 changed files with 3 additions and 0 deletions
  1. 2 0
      arch/x86/include/asm/amd_iommu_types.h
  2. 1 0
      arch/x86/kernel/amd_iommu.c

+ 2 - 0
arch/x86/include/asm/amd_iommu_types.h

@@ -192,6 +192,8 @@
 
 /* Protection domain flags */
 #define PD_DMA_OPS_MASK		(1UL << 0) /* domain used for dma_ops */
+#define PD_DEFAULT_MASK		(1UL << 1) /* domain is a default dma_ops
+					      domain for an IOMMU */
 
 /*
  * This structure contains generic data for  IOMMU protection domains

+ 1 - 0
arch/x86/kernel/amd_iommu.c

@@ -1574,6 +1574,7 @@ int __init amd_iommu_init_dma_ops(void)
 		iommu->default_dom = dma_ops_domain_alloc(iommu, order);
 		if (iommu->default_dom == NULL)
 			return -ENOMEM;
+		iommu->default_dom->domain.flags |= PD_DEFAULT_MASK;
 		ret = iommu_init_unity_mappings(iommu);
 		if (ret)
 			goto free_domains;