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

Jason Gunthorpe
2023-10-23T14:57:58Z

On Mon, Oct 23, 2023 at 04:35:15PM +0200, Arnd Bergmann wrote:
> >> diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
> >> index 4a79704b164f7..2902b89a48f17 100644
> >> --- a/drivers/gpu/drm/nouveau/Kconfig
> >> +++ b/drivers/gpu/drm/nouveau/Kconfig
> >> @@ -4,7 +4,7 @@ config DRM_NOUVEAU
> >> depends on DRM && PCI && MMU
> >> depends on (ACPI_VIDEO && ACPI_WMI && MXM_WMI) || !(ACPI && X86)
> >> depends on BACKLIGHT_CLASS_DEVICE
> >> - select IOMMU_API
> >> + depends on IOMMU_API
> >> select FW_LOADER
> >> select DRM_DISPLAY_DP_HELPER
> >> select DRM_DISPLAY_HDMI_HELPER
> >
> > Like here, nouveau should still be compilable even if no iommu driver
> > was selected, and it should compile on arches without iommu drivers at
> > all.
>
> Right, so with my draft patch, we can't build nouveau without
> having an IOMMU driver, which matches the original intention
> behind the Kconfig logic, while your suggestion would add the
> same dependency here but still allow it to be compile tested
> on target systems with no IOMMU. A minor downside of your
> approach is that you end up building drivers (without
> CONFIG_COMPILE_TEST) that currently exclude because we know
> they will never work.

I wonder how true that is, even nouveau only seems to have this for
some tegra specific situation. The driver broadly does work without an
iommu. (even weirder that already seems to have IS_ENABLED so I don't
know what this is for)

I'd prefer clarity over these kinds of optimizations..

Jason