mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Jason Gunthorpe" <jgg@nvidia.com>
Cc: "Joao Martins" <joao.m.martins@oracle.com>,
	"Arnd Bergmann" <arnd@kernel.org>,
	"Kevin Tian" <kevin.tian@intel.com>,
	"Yishai Hadas" <yishaih@nvidia.com>,
	"Shameerali Kolothum Thodi"
	<shameerali.kolothum.thodi@huawei.com>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Brett Creeley" <brett.creeley@amd.com>,
	oushixiong <oushixiong@kylinos.cn>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfio: mlx5, pds: add IOMMU_SUPPORT dependency
Date: Mon, 23 Oct 2023 16:52:29 +0200	[thread overview]
Message-ID: <29ddfa62-6875-4b25-acc9-6d7228c6ae89@app.fastmail.com> (raw)
In-Reply-To: <20231023144322.GY3952@nvidia.com>

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

  reply	other threads:[~2023-10-23 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 11:55 Arnd Bergmann
2023-10-23 12:04 ` Jason Gunthorpe
2023-10-23 12:37   ` Joao Martins
2023-10-23 12:55     ` Arnd Bergmann
2023-10-23 13:23       ` Jason Gunthorpe
2023-10-23 14:02         ` Arnd Bergmann
2023-10-23 14:19           ` Jason Gunthorpe
2023-10-23 14:35             ` Arnd Bergmann
2023-10-23 14:43               ` Jason Gunthorpe
2023-10-23 14:52                 ` Arnd Bergmann [this message]
2023-10-23 13:12     ` Jason Gunthorpe
2023-10-23 17:50       ` Joao Martins
2023-10-23 18:08         ` Jason Gunthorpe
2023-10-23 18:46         ` Arnd Bergmann
2023-10-23 20:23           ` Joao Martins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29ddfa62-6875-4b25-acc9-6d7228c6ae89@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=alex.williamson@redhat.com \
    --cc=arnd@kernel.org \
    --cc=brett.creeley@amd.com \
    --cc=jgg@nvidia.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oushixiong@kylinos.cn \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®