[PATCH v2 01/10] iommu/arm-smmu-v3: Do not zero the strtab twice

Nicolin Chen nicolinc at nvidia.com
Mon Jun 10 17:50:34 PDT 2024


On Mon, Jun 10, 2024 at 09:31:10PM -0300, Jason Gunthorpe wrote:
> dmam_alloc_coherent() already returns zero'd memory so cfg->strtab.l1_desc
> (the list of DMA addresses for the L2 entries) is already zero'd.
> 
> arm_smmu_init_l1_strtab() goes through and calls
> arm_smmu_write_strtab_l1_desc() on the newly allocated (and zero'd) struct
> arm_smmu_strtab_l1_desc, which ends up computing 'val = 0' and zeroing it
> again.
> 
> Remove arm_smmu_init_l1_strtab() and just call devm_kcalloc() from
> arm_smmu_init_strtab_2lvl to allocate the companion struct.
> 
> Tested-by: Nicolin Chen <nicolinc at nvidia.com>
> Reviewed-by: Mostafa Saleh <smostafa at google.com>
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
 
Reviewed-by: Nicolin Chen <nicolinc at nvidia.com>



More information about the linux-arm-kernel mailing list