Commit 7f315c9d authored by Yong Wu's avatar Yong Wu Committed by Joerg Roedel

iommu/io-pgtable-arm-v7s: Use ias/oas to check the valid iova/pa

Use ias/oas to check the valid iova/pa. Synchronize this checking with
io-pgtable-arm.c.
Signed-off-by: default avatarYong Wu <yong.wu@mediatek.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 5950b954
......@@ -504,7 +504,8 @@ static int arm_v7s_map(struct io_pgtable_ops *ops, unsigned long iova,
if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
return 0;
if (WARN_ON(upper_32_bits(iova) || upper_32_bits(paddr)))
if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias) ||
paddr >= (1ULL << data->iop.cfg.oas)))
return -ERANGE;
ret = __arm_v7s_map(data, iova, paddr, size, prot, 1, data->pgd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment