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

Jason Gunthorpe
2023-10-18T15:43:16Z

On Wed, Oct 18, 2023 at 04:34:17PM +0100, Joao Martins wrote:
> These two lead to a recursive dependency:
>
> drivers/vfio/Kconfig:2:error: recursive dependency detected!
> drivers/vfio/Kconfig:2: symbol VFIO depends on IOMMUFD_DRIVER
> drivers/iommu/iommufd/Kconfig:14: symbol IOMMUFD_DRIVER is selected by
> MLX5_VFIO_PCI
> drivers/vfio/pci/mlx5/Kconfig:2: symbol MLX5_VFIO_PCI depends on VFIO
> For a resolution refer to Documentation/kbuild/kconfig-language.rst
> subsection "Kconfig recursive dependency limitations"
>
> Due to the end drivers being the ones actually selecting IOMMUFD_DRIVER. But
> well, if we remove those, then no VF dirty tracking either.

Oh I'm surprised by this

> diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig
> index 1db519cce815..2abd1c598b65 100644
> --- a/drivers/vfio/Kconfig
> +++ b/drivers/vfio/Kconfig
> @@ -7,7 +7,7 @@ menuconfig VFIO
> select VFIO_GROUP if SPAPR_TCE_IOMMU || IOMMUFD=n
> select VFIO_DEVICE_CDEV if !VFIO_GROUP
> select VFIO_CONTAINER if IOMMUFD=n
> - select IOMMUFD_DRIVER
> + select IOMMUFD_DRIVER if VFIO_PCI_CORE

I think you are better to stick with the bool non-modular in this
case

Jason