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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 8C1B8D1D87B for ; Tue, 15 Oct 2024 15:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2kWmgBYOH9wgAzold8S/QcJxXJckEqMM/4U3yhTjnpo=; b=dED0BiFFLwGlRvLs0ZAh/bZ2xS XnCEx7qAvGo3N+lXMxiPxjHvR8jQztt0O+8nENHGqTL8rk2oureM3vvgby/Mr6xUreo7a75Wj7aWd p9XerpevNZvuG7/b/tV13vAE++UHXcHbkgsLhl9qmIp4QTrSTiiWEjZZRhMQKBqSPfqULK4mbWusR ztyykdOaE2+hqOHMwLDfRH1paixgNWdApGSG8BBCI06vLJ5tS8Fcj5vnmIL1XvOyfsiE1t3XwpmMT EeABdcGlhSctByCon2NXqDVupzqynsQ16vLR2C4J+Mur3AqFSMjbuHEqM6XlrPzKeBjGg5O+c1Wpg gpslsHPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0jdu-00000008knS-0wYP; Tue, 15 Oct 2024 15:39:26 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0jc2-00000008k8P-1yee for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 15:37:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 87583FEC; Tue, 15 Oct 2024 08:37:59 -0700 (PDT) Received: from [10.57.87.12] (unknown [10.57.87.12]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5ABE13F528; Tue, 15 Oct 2024 08:37:27 -0700 (PDT) Message-ID: Date: Tue, 15 Oct 2024 16:37:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 2/2] iommu/arm-smmu-v3: Bypass SID0 for NXP i.MX95 To: Jason Gunthorpe Cc: Pranjal Shrivastava , "Peng Fan (OSS)" , Will Deacon , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Joy Zou , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Fan References: <20241015-smmuv3-v1-0-e4b9ed1b5501@nxp.com> <20241015-smmuv3-v1-2-e4b9ed1b5501@nxp.com> <20241015124723.GI1825128@ziepe.ca> <20241015153110.GM1825128@ziepe.ca> From: Robin Murphy Content-Language: en-GB In-Reply-To: <20241015153110.GM1825128@ziepe.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_083730_667738_892124DE X-CRM114-Status: GOOD ( 13.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024-10-15 4:31 pm, Jason Gunthorpe wrote: > On Tue, Oct 15, 2024 at 04:13:13PM +0100, Robin Murphy wrote: >> On 2024-10-15 1:47 pm, Jason Gunthorpe wrote: >>> On Tue, Oct 15, 2024 at 08:13:28AM +0000, Pranjal Shrivastava wrote: >>> >>>> Umm.. this was specific for rmr not a generic thing. I'd suggest to >>>> avoid meddling with the STEs directly for acheiving bypass. Playing >>>> with the iommu domain type could be neater. Perhaps, modify the >>>> ops->def_domain_type to return an appropriate domain? >>> >>> Yeah, that is the expected way, to force the def_domain_type to >>> IDENTITY and refuse to attach a PAGING/BLOCKED domain. >> >> There is no domain, this is bypassing an arbitrary StreamID not associated >> with any device. > > If the stream ID is going to flow traffic shouldn't it have a DT node > for it? Something must be driving the DMA on this SID, and the kernel > does need to know what that is in some way, even for basic security > things like making sure VFIO doesn't get a hold of it :\ Exactly, hence this RFC is definitely not the right approach. Thanks, Robin.