Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 781558f3 authored by Patrick Daly's avatar Patrick Daly
Browse files

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: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 466237d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment