diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-01-19 17:27:39 +0100 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2010-03-07 18:01:12 +0100 |
commit | 24cd772315c19e4d9409d0d21367ec1ebab3149f (patch) | |
tree | cf8a322797fb4d27c21451b1b9fbbdd234dc667e /arch/x86/include | |
parent | cbb9d729f3433c9c2660b01dc52e6deb89488886 (diff) | |
download | kernel_samsung_aries-24cd772315c19e4d9409d0d21367ec1ebab3149f.zip kernel_samsung_aries-24cd772315c19e4d9409d0d21367ec1ebab3149f.tar.gz kernel_samsung_aries-24cd772315c19e4d9409d0d21367ec1ebab3149f.tar.bz2 |
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')
-rw-r--r-- | arch/x86/include/asm/amd_iommu_types.h | 6 |
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 5e8da56..b150c74 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) |