summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchel Humpherys <mitchelh@codeaurora.org>2015-05-11 16:22:17 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:12:34 -0700
commit7a29d3fca7561fea1d5ea59fb76dbf5f05777c24 (patch)
tree526ec0fa4d53d71f6335ded2aadf4a998d0ab273
parent47ef5fd8b6deb10bab911151cbf8f7b11a645957 (diff)
iommu: io-pgtable-arm: use correct mask during iova_to_phys
In ARMv8, the output address from a page table walk is obtained by combining some bits from the physical address in the leaf page table entry with some bits from the input virtual address. The number of bits that should be taken from the virtual address varies based on the lookup level and descriptor type. However, we're currently always using data->pg_shift bits, which is a constant. Conveniently there's already a macro to compute the number of bits we want (ARM_LPAE_LVL_SHIFT). Use this macro instead of data->pg_shift to build the virtual address mask. Change-Id: Id7f8aa2c553cc004e5d895d05c9226a896d22ce6 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
-rw-r--r--drivers/iommu/io-pgtable-arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 4811ce851689..8b2764c749f0 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -584,7 +584,7 @@ static phys_addr_t arm_lpae_iova_to_phys(struct io_pgtable_ops *ops,
return 0;
found_translation:
- iova &= ((1 << data->pg_shift) - 1);
+ iova &= ((1 << ARM_LPAE_LVL_SHIFT(lvl, data)) - 1);
return ((phys_addr_t)iopte_to_pfn(pte,data) << data->pg_shift) | iova;
}