RE: [PATCH v5 03/29] iommu: Apply the new iommufd_object_alloc_ucmd helper

Tian, Kevin
2025-05-23T07:53:10Z

> From: Nicolin Chen <nicolinc@nvidia.com>
> Sent: Sunday, May 18, 2025 11:21 AM
>
> Now the new ucmd-based object allocator eases the finalize/abort routine,
> apply this to all existing allocators that aren't protected by any lock.
>
> Upgrade the for-driver vIOMMU alloctor too, and pass down to all existing
> viommu_alloc op accordingly.
>
> Note that __iommufd_object_alloc_ucmd() builds in some static tests that
> cover both static_asserts in the iommufd_viommu_alloc(). Thus drop them.

I may overlook something, but at a quick glance the following check
Is not covered?

- static_assert(__same_type(struct iommufd_viommu, \
- ((drv_struct *)NULL)->member)); \

Btw this patch doesn't convert all object allocations to the new helper,
e.g. ioas. What is the criteria for when to use the old helpers vs. the
new helpers?