]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/arm-smmu-v3: Shrink the cdtab l1_desc array
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 6 Sep 2024 15:47:53 +0000 (12:47 -0300)
committerWill Deacon <will@kernel.org>
Mon, 9 Sep 2024 14:47:15 +0000 (15:47 +0100)
commitc0a25a96dee9c3af01fbcad227871fc0f222900b
tree5393b8d524877ba2593436934a628a6774f6fa67
parent47b2de35cab2b683f69d03515c2658c2d8515323
iommu/arm-smmu-v3: Shrink the cdtab l1_desc array

The top of the 2 level CD table is (at most) 1024 entries big, and two
high order allocations are required. One of __le64 which is programmed
into the HW (8k) and one of struct arm_smmu_l1_ctx_desc which holds the
CPU pointer (16k).

There are two copies of the l2ptr_dma, one is stored in the struct
arm_smmu_l1_ctx_desc, and another is encoded in the __le64 for the HW to
use. Instead of storing two copies just decode the value from the __le64.

Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/6-v4-6416877274e1+1af-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