Re: [RFC PATCH v6 08/11] iommufd: Add vIOMMU provider support
From: Aneesh Kumar K . V
Date: Fri Sep 25 2026 - 02:08:36 EST
Jason Gunthorpe <jgg@xxxxxxxxxx> writes:
>> vIOMMU creation currently dispatches directly through the physical IOMMU
>> driver. Some vIOMMU types need an implementation supplied by another
>> subsystem, together with private data whose lifetime extends across all
>> vIOMMUs using that implementation.
>>
>> Introduce a vIOMMU provider that associates implementation operations,
>> their module owner and private data. Allow one external provider to
>> register for each non-default vIOMMU type.
>
> This seems much more extensive than I imagined when I proposed this.
>
> I imagined you'd just have iommufd see there is a TSM attached the pci
> device with a function call, and check if that TSM handled the
> requested iommu ID.
>
> No need for a registration system because we already know the only
> possible TSM driver that can handle it,
>
Agreed, there will be only one vIOMMU provider. But, without a
registration mechanism, what would the module dependency look like?
I currently have the TSM driver depending on IOMMUFD. Therefore, the TSM
driver needs to tell iommufd which vIOMMU type it provides and register
the corresponding provider. IOMMUFD does not call into TSM directly.
-aneesh