[PATCH v2 05/10] iommu/arm-smmu-v3: Reorganize struct arm_smmu_strtab_cfg

Jason Gunthorpe jgg at nvidia.com
Tue Jul 9 12:42:10 PDT 2024


On Tue, Jul 02, 2024 at 07:46:16PM +0100, Will Deacon wrote:
> On Mon, Jun 10, 2024 at 09:31:14PM -0300, Jason Gunthorpe wrote:
> > The members here are being used for both the linear and the 2 level case,
> > with the meaning of each item slightly different in the two cases.
> > 
> > Split it into a clean union where both cases have their own struct with
> > their own logical names and correct types.
> > 
> > Adjust all the users to detect linear/2lvl and use the right sub structure
> > and types consistently.
> > 
> > Remove STRTAB_STE_DWORDS by changing the last places to use
> > sizeof(struct arm_smmu_ste).
> > 
> > Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> > ---
> >  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 79 ++++++++++-----------
> >  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 26 +++----
> >  2 files changed, 51 insertions(+), 54 deletions(-)
> 
> [...]
> 
> > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> > index 1418f21f5db6a0..8b58a30ebeb06b 100644
> > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> > @@ -204,10 +204,8 @@
> >  #define STRTAB_L1_DESC_SPAN		GENMASK_ULL(4, 0)
> >  #define STRTAB_L1_DESC_L2PTR_MASK	GENMASK_ULL(51, 6)
> >  
> > -#define STRTAB_STE_DWORDS		8
> > -
> >  struct arm_smmu_ste {
> > -	__le64 data[STRTAB_STE_DWORDS];
> > +	__le64 data[8];
> >  };
> 
> I'm not seeing the improvement here.

Are you just asking to keep STRTAB_STE_DWORDS to use only for data[]?

I seem to recall a reviewer asked for this - but it can stay with no
issue. Let me know.

Jason



More information about the linux-arm-kernel mailing list