[PATCH rfcv2 4/8] iommu/arm-smmu-v3: Introduce a per-domain arm_smmu_invs array

Nicolin Chen nicolinc at nvidia.com
Mon Sep 29 11:52:09 PDT 2025


On Wed, Sep 24, 2025 at 06:29:12PM -0300, Jason Gunthorpe wrote:
> On Mon, Sep 08, 2025 at 04:26:58PM -0700, Nicolin Chen wrote:
> > +
> > +	WARN_ON(new != new_invs->inv + new_invs->num_invs);
> > +
> > +	return new_invs;
> 
> A debugging check that the output list is sorted would be a nice touch
> for robustness.

Sure. The second for loop generating "new" could run a sanity.

> I think this looks OK and has turned out to be pretty simple.
> 
> I've been thinking about generalizing it to core code and I think it
> would hold up well there as well?

How would you like it to be written in the core: a generalized
structure or a general macro that generates driver structures?

And potentially we need a new drivers/iommu/iommu-invs.c?

Thanks
Nicolin



More information about the linux-arm-kernel mailing list