summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/amd_iommu_types.h
diff options
context:
space:
mode:
authorJoerg Roedel2010-01-19 17:27:39 +0100
committerJoerg Roedel2010-03-07 18:01:12 +0100
commit24cd772315c19e4d9409d0d21367ec1ebab3149f (patch)
treecf8a322797fb4d27c21451b1b9fbbdd234dc667e /arch/x86/include/asm/amd_iommu_types.h
parentx86/amd-iommu: Make iommu_map_page and alloc_pte aware of page sizes (diff)
downloadkernel-qcow2-linux-24cd772315c19e4d9409d0d21367ec1ebab3149f.tar.gz
kernel-qcow2-linux-24cd772315c19e4d9409d0d21367ec1ebab3149f.tar.xz
kernel-qcow2-linux-24cd772315c19e4d9409d0d21367ec1ebab3149f.zip
x86/amd-iommu: Make iommu_unmap_page and fetch_pte aware of page sizes
This patch extends the functionality of iommu_unmap_page and fetch_pte to support arbitrary page sizes. 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 5e8da56755dd..b150c74e0d48 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -200,6 +200,12 @@
(((address) | ((pagesize) - 1)) & \
(~(pagesize >> 1)) & PM_ADDR_MASK)
+/*
+ * Takes a PTE value with mode=0x07 and returns the page size it maps
+ */
+#define PTE_PAGE_SIZE(pte) \
+ (1ULL << (1 + ffz(((pte) | 0xfffULL))))
+
#define IOMMU_PTE_P (1ULL << 0)
#define IOMMU_PTE_TV (1ULL << 1)
#define IOMMU_PTE_U (1ULL << 59)