aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Snitselaar <[email protected]>2023-04-20 01:07:18 -0700
committerJoerg Roedel <[email protected]>2023-05-22 17:17:41 +0200
commit354440a7618746096cca4a2254594c00c86dc597 (patch)
treeac4643f45de043aa0819cc83fb4cd264775ec403
parent44c026a73be8038f03dbdeef028b642880cf1511 (diff)
iommu/amd: Use page mode macros in fetch_pte()
Use the page mode macros instead of magic numbers in fetch_pte. Cc: Robin Murphy <[email protected]> Cc: Will Deacon <[email protected]> Cc: Suravee Suthikulpanit <[email protected]> Cc: Joerg Roedel <[email protected]> Signed-off-by: Jerry Snitselaar <[email protected]> Reviewed-by: Vasant Hegde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
-rw-r--r--drivers/iommu/amd/io_pgtable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/amd/io_pgtable.c b/drivers/iommu/amd/io_pgtable.c
index 1b67116882be..2892aa1b4dc1 100644
--- a/drivers/iommu/amd/io_pgtable.c
+++ b/drivers/iommu/amd/io_pgtable.c
@@ -310,8 +310,8 @@ static u64 *fetch_pte(struct amd_io_pgtable *pgtable,
return NULL;
/* Large PTE */
- if (PM_PTE_LEVEL(*pte) == 7 ||
- PM_PTE_LEVEL(*pte) == 0)
+ if (PM_PTE_LEVEL(*pte) == PAGE_MODE_7_LEVEL ||
+ PM_PTE_LEVEL(*pte) == PAGE_MODE_NONE)
break;
/* No level skipping support yet */