iommu: io-pgtable-arm: Fix arm_lpae_split_blk_unmap cornercase
The upstream iommu implementation calls __arm_lpae_unmap with sizes compatible with iommu_pgsize(). However the MSM implementation changed this to allow calling __arm_lpae_unmap with any size which can be mapped within a single last level page table. arm_lpae_split_blk_unmap() is unable to handle these unusual sizes. Consider the case where the range [0x1000, 0x20000] is to be unmapped from a 4GB block mapping. arm_lpae_split_blk_unmap() overrides the size value to the next block size (0x20000), but does not unmap anything since the iova is not aligned to the block size. This bug was introduced by commit 5f92f324 ("iommu: io-pgtable-arm: unmap last level all at once") Fix this by calculating the size used by arm_lpae_split_blk_unmap with iommu_pgsize(). Change-Id: I46709f8185327b21d5d39c61a2c37be7dafda713 Signed-off-by:Patrick Daly <pdaly@codeaurora.org>
Loading
Please register or sign in to comment