]> www.infradead.org Git - users/dwmw2/linux.git/commit
iommu/arm-smmu-v3: Shrink the strtab l1_desc array
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 11 Jun 2024 00:31:11 +0000 (21:31 -0300)
committerWill Deacon <will@kernel.org>
Tue, 2 Jul 2024 15:34:16 +0000 (16:34 +0100)
commita4d75360f7a6d979edd66af577847b0f4dbf4377
tree1b7835f6a8b8839f6e8bf4ebe5bd7e0836decfe5
parentc84c5ab76c9c04b5f1c8cc66ee9313198e89bb11
iommu/arm-smmu-v3: Shrink the strtab l1_desc array

The top of the 2 level stream table is (at most) 128k entries big, and two
high order allocations are required. One of __le64 which is programmed
into the HW (1M), and one of struct arm_smmu_strtab_l1_desc which holds
the CPU pointer (3M).

There is no reason to store the l2ptr_dma as nothing reads it. devm stores
a copy of it and the DMA memory will be freed via devm mechanisms. span is
a constant of 8+1. Remove both.

This removes 16 bytes from each arm_smmu_l1_ctx_desc and saves up to 2M of
memory per iommu instance.

Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Link: https://lore.kernel.org/r/2-v2-318ed5f6983b+198f-smmuv3_tidy_jgg@nvidia.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h