From 3c60944373c71f82fdf234d3220720b781b4c67a Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Fri, 31 Jul 2015 14:58:13 -0700 Subject: [PATCH] iommu/io-pgtable-arm: Correct size in arm_lpae_split_blk_unmap Currently, arm_lpae_split_blk_unmap is assuming that the size to be remapped is the block size of the next level. However, optimizations have been made to the unmap code that result in the entire remaining size being passed in, rather than just doing it one block at a time, which breaks arm_lpae_split_blk_unmap. Fix this by overriding the size passed in to be the block size of the next level. Change-Id: Ifce5b2e07dc15aba3cd37b7ac249e00decd2923f Signed-off-by: Mitchel Humpherys --- drivers/iommu/io-pgtable-arm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 3c48d95b959f..1777fd9e6b39 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -517,6 +517,7 @@ static int arm_lpae_split_blk_unmap(struct arm_lpae_io_pgtable *data, blk_start = iova & ~(blk_size - 1); blk_end = blk_start + blk_size; blk_paddr = iopte_to_pfn(*ptep, data) << data->pg_shift; + size = ARM_LPAE_BLOCK_SIZE(lvl + 1, data); for (; blk_start < blk_end; blk_start += size, blk_paddr += size) { arm_lpae_iopte *tablep; -- 2.11.0