Re: [PATCH] vfio: mlx5, pds: add IOMMU_SUPPORT dependency

From: Arnd Bergmann
Date: Mon Oct 23 2023 - 08:55:41 EST


On Mon, Oct 23, 2023, at 14:37, Joao Martins wrote:
> On 23/10/2023 13:04, Jason Gunthorpe wrote:
>> On Mon, Oct 23, 2023 at 01:55:03PM +0200, Arnd Bergmann wrote:
>
> Right -- IOMMU drivers need really IOMMUFD (as its usage is driven by IOMMUFD),
> whereby vfio pci drivers don't quite need the iommufd support, only the helper
> code support, as the vfio UAPI drives VF own dirty tracking.
>
>> I think it means IOMMUFD_DRIVER should be lifted out of the
>> IOMMU_SUPPORT block somehow. I guess just move it into the top of
>> drivers/iommu/Kconfig?
>
> iommufd Kconfig is only included in the IOMMU_SUPPORT kconfig if clause; so
> moving it out from the iommufd kconfig out into iommu kconfig should fix it.
> Didn't realize that one can select IOMMU_API yet have IOMMU_SUPPORT unset/unmet.
> I'll make the move in v6

Are there any useful configurations with IOMMU_API but
not IOMMU_SUPPORT though? My first approach was actually

--- a/drivers/vfio/pci/mlx5/Kconfig
+++ b/drivers/vfio/pci/mlx5/Kconfig
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
config MLX5_VFIO_PCI
tristate "VFIO support for MLX5 PCI devices"
+ depends on IOMMU_SUPPORT
depends on MLX5_CORE
select VFIO_PCI_CORE
select IOMMUFD_DRIVER

before I saw the other construct in the iommu drivers. Maybe that
is the best solution after all.

Arnd