[PATCH v3 5/5] vfio/iommu_type1: Simplify group attachment
Tian, Kevin
kevin.tian at intel.com
Sun Jun 26 23:57:30 PDT 2022
> From: Nicolin Chen <nicolinc at nvidia.com>
> Sent: Friday, June 24, 2022 4:00 AM
>
> Un-inline the domain specific logic from the attach/detach_group ops into
> two paired functions vfio_iommu_alloc_attach_domain() and
> vfio_iommu_detach_destroy_domain() that strictly deal with creating and
> destroying struct vfio_domains.
>
> Add the logic to check for EMEDIUMTYPE return code of
> iommu_attach_group()
> and avoid the extra domain allocations and attach/detach sequences of the
> old code. This allows properly detecting an actual attach error, like
> -ENOMEM, vs treating all attach errors as an incompatible domain.
>
> Co-developed-by: Jason Gunthorpe <jgg at nvidia.com>
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> Signed-off-by: Nicolin Chen <nicolinc at nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian at intel.com>
More information about the Linux-mediatek
mailing list