diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-04-01 14:58:48 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-04-02 13:31:07 +0200 |
commit | 3039ca1b1c37e61cc9239dbb3903db55141ecabd (patch) | |
tree | 33d23e9b45abb6dcfb7fe1189688ebf0135cb3a6 /drivers/iommu/amd_iommu_types.h | |
parent | 3b839a57998515bb44c091bbcb8ea0da9d2adef4 (diff) | |
download | linux-stable-3039ca1b1c37e61cc9239dbb3903db55141ecabd.tar.gz linux-stable-3039ca1b1c37e61cc9239dbb3903db55141ecabd.tar.bz2 linux-stable-3039ca1b1c37e61cc9239dbb3903db55141ecabd.zip |
iommu/amd: Return the pte page-size in fetch_pte
Extend the fetch_pte function to also return the page-size
that is mapped by the returned pte.
Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd_iommu_types.h')
-rw-r--r-- | drivers/iommu/amd_iommu_types.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index c4fffb710c58..60e87d2e140a 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -282,6 +282,12 @@ #define PTE_PAGE_SIZE(pte) \ (1ULL << (1 + ffz(((pte) | 0xfffULL)))) +/* + * Takes a page-table level and returns the default page-size for this level + */ +#define PTE_LEVEL_PAGE_SIZE(level) \ + (1ULL << (12 + (9 * (level)))) + #define IOMMU_PTE_P (1ULL << 0) #define IOMMU_PTE_TV (1ULL << 1) #define IOMMU_PTE_U (1ULL << 59) |