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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 CBBD6C433F5 for ; Tue, 22 Mar 2022 09:16:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 51FB340AA0; Tue, 22 Mar 2022 09:16:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FBgCjmUBVrEu; Tue, 22 Mar 2022 09:16:34 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 036A6404C0; Tue, 22 Mar 2022 09:16:33 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C08D7C0012; Tue, 22 Mar 2022 09:16:33 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8AA58C000B for ; Tue, 22 Mar 2022 09:16:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 65149404C0 for ; Tue, 22 Mar 2022 09:16:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tq4B_5y9LQNV for ; Tue, 22 Mar 2022 09:16:31 +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 smtp2.osuosl.org (Postfix) with ESMTPS id 84C8D40220 for ; Tue, 22 Mar 2022 09:16:31 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 6556268AFE; Tue, 22 Mar 2022 10:16:26 +0100 (CET) Date: Tue, 22 Mar 2022 10:16:26 +0100 From: Christoph Hellwig To: Robin Murphy Subject: Re: [PATCH v2 2/2] thunderbolt: Make iommu_dma_protection more accurate Message-ID: <20220322091626.GB27069@lst.de> References: <0dd14883930c9f55ace22162e23765a37d91a057.1647624084.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0dd14883930c9f55ace22162e23765a37d91a057.1647624084.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 Fri, Mar 18, 2022 at 05:42:58PM +0000, Robin Murphy wrote: > Between me trying to get rid of iommu_present() and Mario wanting to > support the AMD equivalent of DMAR_PLATFORM_OPT_IN, scrutiny has shown > that the iommu_dma_protection attribute is being far too optimistic. > Even if an IOMMU might be present for some PCI segment in the system, > that doesn't necessarily mean it provides translation for the device(s) > we care about. Furthermore, all that DMAR_PLATFORM_OPT_IN really does > is tell us that memory was protected before the kernel was loaded, and > prevent the user from disabling the intel-iommu driver entirely. While > that lets us assume kernel integrity, what matters for actual runtime > DMA protection is whether we trust individual devices, based on the > "external facing" property that we expect firmware to describe for > Thunderbolt ports. > > It's proven challenging to determine the appropriate ports accurately > given the variety of possible topologies, so while still not getting a > perfect answer, by putting enough faith in firmware we can at least get > a good bit closer. If we can see that any device near a Thunderbolt NHI > has all the requisites for Kernel DMA Protection, chances are that it > *is* a relevant port, but moreover that implies that firmware is playing > the game overall, so we'll use that to assume that all Thunderbolt ports > should be correctly marked and thus will end up fully protected. > > CC: Mario Limonciello > Signed-off-by: Robin Murphy Looks sensible to me: Acked-by: Christoph Hellwig _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu