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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 23 Oct 2023 16:52:29 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Jason Gunthorpe" <jgg@...dia.com>
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 16:43, Jason Gunthorpe wrote:
> 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..

It does look like a mistake in ee8642162a9e ("drm/nouveau: fix build
error without CONFIG_IOMMU_API"), which was done in response
to a compile-time failure that was also addressed in commit 
0008d0c3b1ab ("iommu: Define dev_iommu_fwspec_get() for
!CONFIG_IOMMU_API") in a different way that made it possible to
use NOUVEAU without the IOMMU API again.

For drm/panfrost and drm/msm the dependency on IOMMU_SUPPORT
is different, as those apparently just want to select
CONFIG_IOMMU_IO_PGTABLE but can build without IOMMU_API.
This can also be handled in different ways, but it's a
separate problem.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ