[PATCH v1 0/3] Clean-up arm-smmu-v3-sva.c: remove arm_smmu_bond

Jason Gunthorpe jgg at nvidia.com
Tue Sep 5 05:35:28 PDT 2023


On Tue, Sep 05, 2023 at 07:49:11PM +0800, Michael Shavit wrote:
> 
> This small series was originally part of a larger effort to support
> set_dev_pasid in arm-smmu-v3.c and a related SVA refactoring. But it can
> also stand on its own as an initial and prepatory clean-up.
> 
> The crux of this series relies on the observation that SVA won't
> allocate multiple SVA domains for the same device and mm pair. 

Yes, I think that is true, certainly no-intree user of this stuff
wants to do that.

It is enforced to be true after Tina's series:

https://lore.kernel.org/r/20230905000930.24515-1-tina.zhang@intel.com

Which makes one SVA domain per mm.

> There's therefore no reason for the driver to try to normalize data
> allocated for a device/mm pair across set_dev_pasid calls. 

Indeed, this is where we are trying to get to. This de-duplication
code in every driver is quite horrible.

> Note that arm-smmu-v3-sva performs a second level of normalization by
> mapping multiple bonds (now SVA domains) attached to devices with the
> same SMMU (if those devices have the same RID domain attached) to a
> single arm_smmu_mmu_notifier. This is not affected by these patches.

Ultimately the notifier should be per-iommu_domain as well.

Thanks,
Jason



More information about the linux-arm-kernel mailing list