OSDN Git Service

iommu/io-pgtable-arm: Correct size in arm_lpae_split_blk_unmap
authorMitchel Humpherys <mitchelh@codeaurora.org>
Fri, 31 Jul 2015 21:58:13 +0000 (14:58 -0700)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:13:46 +0000 (11:13 -0700)
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 <mitchelh@codeaurora.org>
drivers/iommu/io-pgtable-arm.c

index 3c48d95..1777fd9 100644 (file)
@@ -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;