iommu: io-pgtable-arm: Improve coverage of arm_lpae_range_has_mapping
The arm_lpae_range_has_mapping currently checks if there are any non-mapped slots in a given iova range, but it's really meant to check if there is *any* mapping whatsoever in a given iova range. Fix this. Change-Id: I90e426ab157cc194328b754ac5021051ac883603 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
parent
3671f9ec4a
commit
e7f0469ba0
1 changed files with 4 additions and 4 deletions
|
@ -954,7 +954,7 @@ static void __init arm_lpae_dump_ops(struct io_pgtable_ops *ops)
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns true if the entire iova range has any mapping in ops.
|
* Returns true if there's any mapping in the given iova range in ops.
|
||||||
*/
|
*/
|
||||||
static bool arm_lpae_range_has_mapping(struct io_pgtable_ops *ops,
|
static bool arm_lpae_range_has_mapping(struct io_pgtable_ops *ops,
|
||||||
unsigned long iova_start, size_t size)
|
unsigned long iova_start, size_t size)
|
||||||
|
@ -962,11 +962,11 @@ static bool arm_lpae_range_has_mapping(struct io_pgtable_ops *ops,
|
||||||
unsigned long iova = iova_start;
|
unsigned long iova = iova_start;
|
||||||
|
|
||||||
while (iova < (iova_start + size)) {
|
while (iova < (iova_start + size)) {
|
||||||
if (!ops->iova_to_phys(ops, iova + 42))
|
if (ops->iova_to_phys(ops, iova + 42))
|
||||||
return false;
|
return true;
|
||||||
iova += SZ_4K;
|
iova += SZ_4K;
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue