]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
iommu/arm-smmu: Limit 2-level strtab allocation for small SID sizes
authorWill Deacon <will.deacon@arm.com>
Thu, 16 Jul 2015 16:50:12 +0000 (17:50 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 31 Jul 2015 10:38:25 +0000 (11:38 +0100)
commit28c8b4045b18b013e05656b493ce9a57cbf1f09a
treefcaa96123a1917e6488ed182e255fdd64df6a04d
parentec11d63c677bbba15e65a35f5ba06c1d6eba4dbe
iommu/arm-smmu: Limit 2-level strtab allocation for small SID sizes

If the StreamIDs in a system can all be resolved by a single level-2
stream table (i.e. SIDSIZE < SPLIT), then we currently get our maths
wrong and allocate the largest strtab we support, thanks to unsigned
overflow in our calculation.

This patch fixes the issue by checking the SIDSIZE explicitly when
calculating the size of our first-level stream table.

Reported-by: Matt Evans <matt.evans@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c