[PATCH v5 05/27] iommu/arm-smmu-v3: Make CD programming use arm_smmu_write_entry()

Jason Gunthorpe jgg at nvidia.com
Mon Mar 25 07:25:14 PDT 2024


On Sat, Mar 23, 2024 at 01:02:15PM +0000, Mostafa Saleh wrote:
> Hi Jason,
> 
> On Mon, Mar 04, 2024 at 07:43:53PM -0400, Jason Gunthorpe wrote:
> > CD table entries and STE's have the same essential programming sequence,
> > just with different types and sizes.
> > 
> > Have arm_smmu_write_ctx_desc() generate a target CD and call
> > arm_smmu_write_entry() to do the programming. Due to the way the
> > target CD is generated by modifying the existing CD this alone is not
> > enough for the CD callers to be freed of the ordering requirements.
> > 
> > The following patches will make the rest of the CD flow mirror the STE
> > flow with precise CD contents generated in all cases.
> > 
> > Currently the logic can't ensure that the CD always conforms to the used
> > requirements until all the CD generation is moved to the new method. Add a
> > temporary no_used_check to disable the assertions.
> > 
> 
> I am still going through the patches, but is it possible to
> reorder/squash to avoid that, so it is easier to review?

After Nicolin's remark I changed this one use a temporary helper to 0
the unused bits then we delete the helper instead of touching the
machinery itself. It is much clearer.

We can't avoid this with patch ordering because the progression is to
move CD generation out of arm_smmu_write_ctx_desc() type-by-type then
delete it. In the mean time we need to use the new write logic in all
cases because I'm not sure the old/new schemes have compatible
assumptions for the existing arm_smmu_write_ctx_desc() to be safe.

Thanks,
Jason



More information about the linux-arm-kernel mailing list