[PATCH v2 05/22] iommufd: Add iommufd_struct_destroy to revert iommufd_viommu_alloc

Baolu Lu baolu.lu at linux.intel.com
Sat Apr 26 23:55:40 PDT 2025


On 4/26/25 13:58, Nicolin Chen wrote:
> An IOMMU driver that allocated a vIOMMU may want to revert the allocation,
> if it encounters an internal error after the allocation. So, there needs a
> destroy helper for drivers to use.

A brief explanation or a small code snippet illustrating a typical
allocation and potential abort scenario would be helpful.

> Move iommufd_object_abort() to the driver.c file and the public header, to
> introduce common iommufd_struct_destroy() helper that will abort all kinds
> of driver structures, not confined to iommufd_viommu but also the new ones
> being added in the future.
> 
> Reviewed-by: Jason Gunthorpe<jgg at nvidia.com>
> Signed-off-by: Nicolin Chen<nicolinc at nvidia.com>

Reviewed-by: Lu Baolu <baolu.lu at linux.intel.com>

Thanks,
baolu



More information about the linux-arm-kernel mailing list