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 CF713D1D88B for ; Tue, 15 Oct 2024 16:14:25 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xGYhfp2OqW3Qzmg96OVHEI/GKpsDJXQmbA11pdTZQhk=; b=hjTxhURM87s+SEYLLI4Hk5RKeM EM3tEpt1Oy5iERN/7M9PPpS4AETmvQJ3+YtdKhY3Y4Nmeq82PHJI4RDFmcBo2+ipm0J73T3bNJyKg vqsZXtgUMMF7ej0CuDe882ZesEBpE+IGMG2ivfvD4Gb1VgYCVWm85GQ66RRheIc5MW8A5k/9wjOQe OhVI8T6KjJoAla0k8MTCxSVoMumzQsOwhMHod92hPtE/t/nYXQBcDOtPC/QBi394Jk3zlA3mvEEw3 pNN6mASM7sizSiHQ5IVvZEHspkyOJfhSdximkn/SXxQQdYujgco0OEma+HQbbwQ+8T+3L8ZM91Qlm ks2yStQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0kBc-00000008qQE-2q12; Tue, 15 Oct 2024 16:14:16 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0k8Q-00000008pcG-4AWD for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 16:11:00 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-20ca03687fdso553905ad.0 for ; Tue, 15 Oct 2024 09:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729008658; x=1729613458; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xGYhfp2OqW3Qzmg96OVHEI/GKpsDJXQmbA11pdTZQhk=; b=ANINPLwNYEJwCmmGHwt3cD5Cs9h674mH58mK5t1TcHQDfzEr9WOhQBUNExhsE68JIv WWzoY9wAuRoQ4fPIg/AroS3C2g6nYFdqEFIv/YKzNH6X/h3eiHiXJyEIoZ2nDQPcqQqu LY1ji2uSZRjiNWmQNQdz1OObisGjfJt1aTnzgNyK9iI9OAxd8T+uLXYoDVWZRg9SQ1Hi YAItI4TWXrLG6Q34TRO15gGwpCBGXe0WKk7rJH/Mz+aRLZg6TU6eXdlJu5lt3h7pCR2u CIYKN6Pv7p7GZpLo2uH6QEwjgYmCpmSWSPELPTzLkZTiwFx3PR9V30EcMVjxuOatNetq 7n3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729008658; x=1729613458; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xGYhfp2OqW3Qzmg96OVHEI/GKpsDJXQmbA11pdTZQhk=; b=lS7YJenlwk2uXYJp7Kvcsp/ezn8l6lOLQxiP7VCPAWHZNqKrYfwtHHEojaoDG7rOmY LuLCMD/NOCULRiUfz0Jn9IqCiLS/qj2tDPR+R/b4A1fxrf7EeQjZJq1S9VNMLIIA47JE RtGQVTcr/yzR8HLqpm/5BNIB7bicii3job2xk3nGN0b208jqB3kL0YcrYRrnSbd77A6k d1TERwDCpGKuTjqJD4jQ6LAgoTWm4JlFa1kNKYSEtuS/nSG8cObwTuZ0HkEnazoCjQ1F gNkhebUI68gwIqMkX/er5DsxSUQe/FVKy0dvxptp4OfIwqVk3/k6ikm2E+SALN0Mnocz Q1hg== X-Forwarded-Encrypted: i=1; AJvYcCVUrOh8fyk9Fz2/FY8q0FoxhO5Cau6gJBPXkE8zQaAfoY4KoPtkcnubWssz8ZMZumeV5EHj34GoSPOT7s/hI6R1@lists.infradead.org X-Gm-Message-State: AOJu0Ywl4jZzVXjgV7NN5fnCCfampUlaIdQj5Tsqmn9cQYbYWRwb04SX Xsom3faZLx/fjCciEeIkaGFt22i86G2qbxHzdKbJyB8prHN923ZKaHmeBTs5PiklCkH60ZpleY9 ck4UN X-Google-Smtp-Source: AGHT+IHSgi8+1o+3iy2Nr5pCUXFLnZB8SwGxpqHUBhSE2VfhssmbiQ27u4lhyDBdI5kO8qO8nZD2aQ== X-Received: by 2002:a17:903:22c6:b0:207:14ca:f0c1 with SMTP id d9443c01a7336-20cbce670dfmr7329985ad.16.1729008657827; Tue, 15 Oct 2024 09:10:57 -0700 (PDT) Received: from google.com (62.166.143.34.bc.googleusercontent.com. [34.143.166.62]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e392e8ec9esm2017723a91.7.2024.10.15.09.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 09:10:57 -0700 (PDT) Date: Tue, 15 Oct 2024 16:10:48 +0000 From: Pranjal Shrivastava To: Robin Murphy Cc: Jason Gunthorpe , "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 Subject: Re: [PATCH RFC 2/2] iommu/arm-smmu-v3: Bypass SID0 for NXP i.MX95 Message-ID: References: <20241015-smmuv3-v1-0-e4b9ed1b5501@nxp.com> <20241015-smmuv3-v1-2-e4b9ed1b5501@nxp.com> <20241015124723.GI1825128@ziepe.ca> <20241015153110.GM1825128@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_091059_058634_6A3D5F03 X-CRM114-Status: GOOD ( 20.85 ) 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 Tue, Oct 15, 2024 at 04:37:25PM +0100, Robin Murphy wrote: > 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. Agreed. I assumed the bypass was needed for a registered SID. > > Thanks, > Robin. Thanks, Pranjal