Re: [PATCH v3 02/19] vfio: Move iova_bitmap into iommu core

Joao Martins
2023-10-13T16:00:54Z

On 13/10/2023 16:48, Jason Gunthorpe wrote:
> On Sat, Sep 23, 2023 at 02:24:54AM +0100, Joao Martins wrote:
>> Both VFIO and IOMMUFD will need iova bitmap for storing dirties and walking
>> the user bitmaps, so move to the common dependency into IOMMU core. IOMMUFD
>> can't exactly host it given that VFIO dirty tracking can be used without
>> IOMMUFD.
>
> Hum, this seems strange. Why not just make those VFIO drivers depends
> on iommufd? That seems harmless to me.
>

IF you and Alex are OK with it then I can move to IOMMUFD.

> However, I think the real issue is that iommu drivers need to use this
> API too for their part?
>

Exactly.

> IMHO would I would like to get to is a part of iommufd that used by
> iommu drivers (and thus built-in) and the current part that is
> modular.
>
> Basically, I think you should put this in the iommufd directory. Make
> the vfio side kconfig depend on iommufd at this point
>
> Later when the iommu drivers need it make some
> CONFIG_IOMMUFD_DRIVER_SUPPORT to build another module (that will be
> built in) and make the drivers that need it select it so it becomes
> built in.

That's a good idea; you want me to do this (CONFIG_IOMMUFD_DRIVER_SUPPORT) in
the context of this series, or as a follow-up (assuming I make it depend on
iommufd as you suggested earlier) ?