summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/amd_iommu_types.h
diff options
context:
space:
mode:
authorJoerg Roedel2009-09-03 11:33:51 +0200
committerJoerg Roedel2009-09-03 16:11:17 +0200
commitabdc5eb3d69279039ba6cb89719913d08013ab14 (patch)
treefc77040a85d9601d91c6dee0e297386a3f5f7ccc /arch/x86/include/asm/amd_iommu_types.h
parentx86/amd-iommu: Support higher level PTEs in iommu_page_unmap (diff)
downloadkernel-qcow2-linux-abdc5eb3d69279039ba6cb89719913d08013ab14.tar.gz
kernel-qcow2-linux-abdc5eb3d69279039ba6cb89719913d08013ab14.tar.xz
kernel-qcow2-linux-abdc5eb3d69279039ba6cb89719913d08013ab14.zip
x86/amd-iommu: Change iommu_map_page to support multiple page sizes
This patch adds a map_size parameter to the iommu_map_page function which makes it generic enough to handle multiple page sizes. This also requires a change to alloc_pte which is also done in this patch. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/include/asm/amd_iommu_types.h')
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index 351ca39ece05..9e8bb9746dcf 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -160,6 +160,12 @@
IOMMU_PTE_P | IOMMU_PTE_IR | IOMMU_PTE_IW)
#define PM_PTE_LEVEL(pte) (((pte) >> 9) & 0x7ULL)
+#define PM_MAP_4k 0
+#define PM_ADDR_MASK 0x000ffffffffff000ULL
+#define PM_MAP_MASK(lvl) (PM_ADDR_MASK & \
+ (~((1ULL << (12 + ((lvl) * 9))) - 1)))
+#define PM_ALIGNED(lvl, addr) ((PM_MAP_MASK(lvl) & (addr)) == (addr))
+
#define IOMMU_PTE_P (1ULL << 0)
#define IOMMU_PTE_TV (1ULL << 1)
#define IOMMU_PTE_U (1ULL << 59)