[PATCH v5 09/27] iommu/arm-smmu-v3: Allocate the CD table entry in advance
Jason Gunthorpe
jgg at nvidia.com
Mon Mar 18 11:14:00 PDT 2024
On Fri, Mar 15, 2024 at 09:16:14PM -0700, Nicolin Chen wrote:
> On Mon, Mar 04, 2024 at 07:43:57PM -0400, Jason Gunthorpe wrote:
> > Avoid arm_smmu_attach_dev() having to undo the changes to the
> > smmu_domain->devices list, acquire the cdptr earlier so we don't need to
> > handle that error.
>
> I should probably mention this in the other patch, yet PATCH-14
> adding arm_smmu_attach_prepare() to this function doesn't have a
> rollback for CD table allocation. I assume we're fine with that?
Yeah, I think so. The CD table leafs are never freed by anything, so
even if you did succeed to attach a PASID and then detach the leaf
will still hang around.
If we care we could try to clean it up by consulting the PASID xarray
and checking if the entire leaf is unused.
Thanks,
Jason
More information about the linux-arm-kernel
mailing list