[PATCH v6 06/29] iommu/arm-smmu-v3: Add an ops indirection to the STE code

Jason Gunthorpe jgg at nvidia.com
Tue Apr 9 16:55:12 PDT 2024


On Tue, Apr 09, 2024 at 01:40:08PM +0100, Will Deacon wrote:
> On Wed, Mar 27, 2024 at 03:07:52PM -0300, Jason Gunthorpe wrote:
> > Prepare to put the CD code into the same mechanism. Add an ops indirection
> > around all the STE specific code and make the worker functions independent
> > of the entry content being processed.
> > 
> > get_used and sync ops are provided to hook the correct code.
> > 
> > Signed-off-by: Michael Shavit <mshavit at google.com>
> > Reviewed-by: Michael Shavit <mshavit at google.com>
> > Tested-by: Nicolin Chen <nicolinc at nvidia.com>
> > Tested-by: Shameer Kolothum <shameerali.kolothum.thodi at huawei.com>
> > Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> > ---
> >  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 170 ++++++++++++--------
> >  1 file changed, 102 insertions(+), 68 deletions(-)
> 
> Any chance we can pull the STE testing stuff forward from Michael once
> we have the entry writing ops indirection, please? It would be nice to
> land that before adding the CD support, I think.

Yes, I can. There is a bit more work because the CD testing is still
not finished, but I can probably do that.

How about this, I split part 2 into half and the first half ends at
"iommu/arm-smmu-v3: Build the whole CD in arm_smmu_make_s1_cd()" (it
finishes changing the CD programming to look like the STE). I'll pull
forward the selftest patch into that series. That is another 9 patches
from what you have taken so far.

The second half is all about "building a generic pasid layer".

Those 8 patches have all been looked at now, so if we pick them up
soonish we can more easially focus on the latter patches.

Agree?

> >  	used_qword_diff =
> > -		arm_smmu_entry_qword_diff(entry, target, &unused_update);
> > +		arm_smmu_entry_qword_diff(writer, entry, target, unused_update);
> >  	if (hweight8(used_qword_diff) == 1) {
> >  		/*
> >  		 * Only one qword needs its used bits to be changed. This is a
> 
> nit: This comment (lost in the diff context) refers to STEs a couple of
> times. Please update to e.g. "STE/CD".

Ok, I'll check them

Thanks,
Jason



More information about the linux-arm-kernel mailing list