From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1493C433F5 for ; Wed, 6 Apr 2022 05:28:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 675B381934; Wed, 6 Apr 2022 05:28:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H-27FGI8U0kC; Wed, 6 Apr 2022 05:28:21 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6500481947; Wed, 6 Apr 2022 05:28:21 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3816BC002C; Wed, 6 Apr 2022 05:28:21 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5194DC0012 for ; Wed, 6 Apr 2022 05:28:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3A11560B43 for ; Wed, 6 Apr 2022 05:28:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 63H60MK4hwbT for ; Wed, 6 Apr 2022 05:28:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4F45B60AD7 for ; Wed, 6 Apr 2022 05:28:18 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id AEE8F68AFE; Wed, 6 Apr 2022 07:28:12 +0200 (CEST) Date: Wed, 6 Apr 2022 07:28:12 +0200 From: Christoph Hellwig To: Robin Murphy Subject: Re: [PATCH v3 1/4] iommu: Introduce device_iommu_capable() Message-ID: <20220406052812.GA10507@lst.de> References: <37ec2f9f67098d0caf60dcec558fbe1756ea2621.1649089693.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <37ec2f9f67098d0caf60dcec558fbe1756ea2621.1649089693.git.robin.murphy@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: michael.jamet@intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, YehezkelShB@gmail.com, iommu@lists.linux-foundation.org, mario.limonciello@amd.com, andreas.noever@gmail.com, mika.westerberg@linux.intel.com, hch@lst.de X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Tue, Apr 05, 2022 at 11:41:01AM +0100, Robin Murphy wrote: > iommu_capable() only really works for systems where all IOMMU instances > are completely homogeneous, and all devices are IOMMU-mapped. Implement > the new variant which can give an accurate answer for whichever device > the caller is actually interested in. > > Signed-off-by: Robin Murphy > --- > > v3: New patch; now that the dev_iommu_ops() work has landed we can go > straight to a proper implementation. Also s/dev/device/ to match > the precedent of device_iommu_mapped() for the public API. I'm a little worrited about a method with a parameter than can be NULL. Also usnic, vmd, and vdpa really want to use your new device_iommu_capable as they check based on a device. Just VFIO is special as usual.. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu