Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1277173rda; Mon, 23 Oct 2023 07:53:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjKCZONx5UZZ/YFWBQjdmLfvhd1sxac/yvw0+byJBl+G3ml01DCnT73b/0l8e/J10uw6Sb X-Received: by 2002:a17:903:11cc:b0:1c9:faef:5765 with SMTP id q12-20020a17090311cc00b001c9faef5765mr7699504plh.5.1698072820586; Mon, 23 Oct 2023 07:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698072820; cv=none; d=google.com; s=arc-20160816; b=fzlimEuZe230QRm5HsNnSFuAXCBpuJa0PnRNCH+KKtdLBDJF3ewB1am2Q82u39jKqd nlrtauzmZq+DueBULIeoazUDJ0LKC2iDh7GfUwP3uawseIGfiDkh4dvt9pSB0rhBkgQH KPbgPhQFG/8hM016KMPyWXmo27+mw7chAVkofIUtcnjhVGRLMwZHDkm3mGuJEZCV/JZY vjnJwgv3KqOn13ELsMqEGN1V4jMo1m3xnA1vvYJ8wWJ9CDf8ytzgyOFDqiZ9oDBtRNZU a5XLWHF25xyG4hAIy0rEjIxs5A0ZSAadOn6ERwdun5Tg8NwJYP3n7kT9FJCnlakkcg0R cX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=Azwo4GV810aPeTvBEWC7qjq1Io9LNCYHKvvtMNaxp0o=; fh=9+lOjbe8wFBfzDlxwt4ogO85qC0pLjYodOSfOY5O5UA=; b=VQz7rZBETtw1hqEAuc+sxX9Gq/RPR8kRTEzU9NNoS3mHhZ245LNdyaCJUAzjJjNBZX uoQcIalui7fAfcSZYVdslsObIybodXqerNqos5DB/ygopy/lknRn/e3YYQMNe9nC9aWf uFO1z0HqetELMk64nAkqn5iYfxAz97LMtf4yYMjbKB9v6QC9NHEjNNs6P+ZBHR6/1KeO amVsIi7/tpzvljNtufFrcYhfJDvmDOB4YjtWsPtUXw4LlwAhbud5PWHNAcUYiHtr39Xr PFnR2Evy9xGRdgtsFerR1XnXvGB+JuvgPvJ81bkee1aTQZWKIYxKAdwj9IoAESgoNBcO brFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=miggIbsz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=MwiTSWr7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 19-20020a170902c11300b001c9af07788csi6583044pli.76.2023.10.23.07.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 07:53:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=miggIbsz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=MwiTSWr7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id F17328086805; Mon, 23 Oct 2023 07:53:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbjJWOxZ (ORCPT + 99 others); Mon, 23 Oct 2023 10:53:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjJWOxO (ORCPT ); Mon, 23 Oct 2023 10:53:14 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F884D79; Mon, 23 Oct 2023 07:53:03 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9318B5C03F9; Mon, 23 Oct 2023 10:53:02 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 23 Oct 2023 10:53:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1698072782; x=1698159182; bh=Az wo4GV810aPeTvBEWC7qjq1Io9LNCYHKvvtMNaxp0o=; b=miggIbszm8IdrnbhkD /s1zRFqh+sYOg/uO0TeA2dYmoZe/Ou8KblqBu10x5LckA7wUdqoqxsT2KSrLsAg6 Uv5IjJrKcs1f137NAKn03IcIVJjpZJmOj3noZLiFX40o3pPltTmDahD9qixmjvMf OpZo1Ry+9hzMY8IRHtoUVZ46jNql6K9UpbXol4NJxwciA5ixMCQR6f1482PU8NiS xtO3fExCRjVxnxKIGPt7tU/km5A4856vDiGtfxUJHLgaXYrJTL7OcgPkH7QqvRXp 9OKO/Tyxp4G9Fn6zA+TBG8QdJ8VCU+a1VIiZWC79t/uKB8eFuVQuDxr6oXSa0YkT MYGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698072782; x=1698159182; bh=Azwo4GV810aPe TvBEWC7qjq1Io9LNCYHKvvtMNaxp0o=; b=MwiTSWr7zHjHaoP7Vs7tFTcsD2kyJ gUeIMLjicevBCS6q/ZqShzrR+gO/+QGtbqavAHsXjNw1GkFT6UrwXggX4ylucq9m whiRYZKj42S3QdYWbulWioP6FP4oISpvWApFGR7PRSrtNe2marg0WeKFys4rV0Vs ejtglmDPdoQVT901EpPmh/Zik4AUTD+zbcnBBEbhPYcdxRqY0ZrcCyOJ71r2+xry TOcAQpzvwu3TiUQglJuYrROuZEILh9wCqNHnridq61I2N5AEILRZLI9EbetNL3EC Q6+LVDCKpEhlrUewtL9jNk45AKBDq+74V/9SOevZeQ0w3ohUIAB/xczCA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B07F5B60089; Mon, 23 Oct 2023 10:53:00 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1048-g9229b632c5-fm-20231019.001-g9229b632 MIME-Version: 1.0 Message-Id: <29ddfa62-6875-4b25-acc9-6d7228c6ae89@app.fastmail.com> In-Reply-To: <20231023144322.GY3952@nvidia.com> References: <20231023115520.3530120-1-arnd@kernel.org> <20231023120418.GH691768@ziepe.ca> <20231023132305.GT3952@nvidia.com> <5d7cb04d-9e79-43b9-9dd2-7d7803c93f4f@app.fastmail.com> <20231023141955.GX3952@nvidia.com> <35d65efa-e87b-4cc5-9c1a-e95dd6bf8edb@app.fastmail.com> <20231023144322.GY3952@nvidia.com> Date: Mon, 23 Oct 2023 16:52:29 +0200 From: "Arnd Bergmann" To: "Jason Gunthorpe" Cc: "Joao Martins" , "Arnd Bergmann" , "Kevin Tian" , "Yishai Hadas" , "Shameerali Kolothum Thodi" , "Alex Williamson" , "Brett Creeley" , oushixiong , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfio: mlx5, pds: add IOMMU_SUPPORT dependency Content-Type: text/plain X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 23 Oct 2023 07:53:38 -0700 (PDT) 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