lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231023141955.GX3952@nvidia.com>
Date:   Mon, 23 Oct 2023 11:19:55 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Joao Martins <joao.m.martins@...cle.com>,
        Arnd Bergmann <arnd@...nel.org>,
        Kevin Tian <kevin.tian@...el.com>,
        Yishai Hadas <yishaih@...dia.com>,
        Shameerali Kolothum Thodi 
        <shameerali.kolothum.thodi@...wei.com>,
        Alex Williamson <alex.williamson@...hat.com>,
        Brett Creeley <brett.creeley@....com>,
        oushixiong <oushixiong@...inos.cn>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vfio: mlx5, pds: add IOMMU_SUPPORT dependency

On Mon, Oct 23, 2023 at 04:02:11PM +0200, Arnd Bergmann wrote:
> On Mon, Oct 23, 2023, at 15:23, Jason Gunthorpe wrote:
> > On Mon, Oct 23, 2023 at 02:55:13PM +0200, Arnd Bergmann wrote:
> >> On Mon, Oct 23, 2023, at 14:37, Joao Martins wrote:
> >> 
> >> Are there any useful configurations with IOMMU_API but
> >> not IOMMU_SUPPORT though? My first approach was actually
> >
> > IOMMU_SUPPORT is just the menu option in kconfig, it doesn't actually
> > do anything functional as far as I can tell
> >
> > But you can have IOMMU_API turned on without IOMMU_SUPPORT still on
> > power
> >
> > I think the right thing is to combine IOMMU_SUPPORT and IOMMU_API into
> > the same thing.
> 
> I've had a closer look now and I think the way it is currently
> designed to be used makes some sense: IOMMU implementations almost
> universally depend on both a CPU architecture and CONFIG_IOMMU_SUPPORT,
> but select IOMMU_API. So if you enable IOMMU_SUPPORT on an
> architecture that has no IOMMU implementations, none of the drivers
> are visible and nothing happens. Similarly, almost all drivers
> using the IOMMU interface depend on IOMMU_API, so they can only
> be built if at least one IOMMU driver is configured.

Maybe, but I don't think we need such micro-optimization.

If someone selects 'enable IOMMU support' and doesn't turn on any
drivers then they should still get the core API. That is how a lot of
the kconfig stuff typically works in the kernel.

Similarly, if they don't select 'enable IOMMU support' then they
definitely shouldn't quitely get the core API turned on!

> 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.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ