Re: [v2 PATCH] iommu/arm-smmu-v3: Fix L1 stream table index calculation for 32-bit sid size

From: Yang Shi
Date: Fri Oct 04 2024 - 12:47:13 EST




On 10/4/24 9:41 AM, Jason Gunthorpe wrote:
On Fri, Oct 04, 2024 at 09:37:10AM -0700, Yang Shi wrote:
size = num_sids * sizeof(struct arm_smmu_ste);
+ if (size > SIZE_4G)
+ return -EINVAL;
If you want to do it like that then 'size >= SIZE_MAX' is the right
expression

Thank you. Will take it.

And with the size check we don't need to check smmu->sid_bits.


Jason