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 EEC2BCFC277 for ; Tue, 15 Oct 2024 15:09:32 +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=PlA/wii2bh+bHrcTk784szy5HvJLhrYuLgVdXpT1LYk=; b=xTKkzMgG4giJzxlg532CdjacJv JLbbpb5GLIL/NzvSSRGC5gs0OlJKyPYBlwKXMBxWf9HWIMPWwmU7tXuQOIn7cn2Ds0f591Xq83WKV xlq6ciH7NwtEXWwuMWJwSaTMxG2KxNNjYzjQkSIJ0Is2FID6QvQZRaub4oDzhZ6liHfi+r75xnrw1 jFz3D2eVgojT/t2Sw4vHq6fhki3kCwvsrCeXMqg0/K+QDrW5YBhdHTqVA5LNrOxoVGIGxK8ufqqF9 6YXvdELrWk7awAAUAts7GRlN2dtkgZrt9NL2dH4d/2eFm6ge1OzRlSp4gW5ZVws2pRO/bGwLDiSB6 MxOeUXzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0jAe-00000008eGe-42fr; Tue, 15 Oct 2024 15:09:12 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0j9E-00000008e8n-1A9U for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 15:07:45 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-20c8ac50b79so506905ad.0 for ; Tue, 15 Oct 2024 08:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729004863; x=1729609663; 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=PlA/wii2bh+bHrcTk784szy5HvJLhrYuLgVdXpT1LYk=; b=ftZ8hMsWe28Re0Wxg8NbqzHipr1LloXpHTIyz+zfgHFsheDzrI3CWfeFlF6wOo+RNg GYk4pkuK9nU9g9gKuwke1SCi6oiAEMd3PwxkX0/YjGLjRQQ4no9g1HvdHE6tapGwtgAp IIuatHhJgCBnz3HsZFXQyGTr65ggEV4VTF/06nwxYuwDt5o0vNVYcVgYKjIo0B1uiKKd iHMtw1n9RU1euU4OtQ9n++jlh5XDMTCIn2QsZgUXVTS2ddEuFuD3PFDwchv7bBxHc/iv WutKt9w/f+UuKthoOGrTpuyQcq6pNgGmf0oFbr4/gwx4rhRlGy7UXXNEQdDR3Y2zrBzB zLfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729004863; x=1729609663; 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=PlA/wii2bh+bHrcTk784szy5HvJLhrYuLgVdXpT1LYk=; b=K+sDVikYksUckLfgqx5L0vx4k2sbEaRIqTow2EbjSWRqeNVWK9fHanmztUq8EcXn2T dfT0yCY8D/3IVqJ4rC5KdF/vNRz+ZRioOC5CW7hBHvzgGwrElUZXkcEC0oQwX4PTECQP Y89F30Ezr7Tjy3xAI4HRU9zIQ9yDQuWJwTY1kgguFwy7QUjbAl5Fwmph64GFV2XfzFQT 5sTaJbF+0PRor568Q4e9I4TBG4c3hdgocMYT+FkX7FVZvNRA1iTYjP0r/Ml2IosP7gmy S5MbtYmzEYamKOfQj8CUfJlI0ixYUMVuOBDHA973pkJ33ff1UyGWRotvWXKAM3K1o2Nt 4U9g== X-Forwarded-Encrypted: i=1; AJvYcCXCYtzJY5ZJmAPJcc4P12fmTTokbIqSbIzK4ynIvyKJdQh2r+ptFsIArDLqrqSc+tEMuC7Di3zbOV0o5n/ZBGbm@lists.infradead.org X-Gm-Message-State: AOJu0Yy9uAN8xTPhydJam6NECwygcWCVayMdZ+Vftu+/idO9ll5nJeg4 dUM0iV44UZa37Z26djGZ7dI+3RfXu8ruU/kHlsRaSEjKfw9vyEVB4GeUYYmz/mCGvt/LJzs0k5A IzsJC X-Google-Smtp-Source: AGHT+IF1l7OR0X37A5QzB6dpGx5CADv36IvHuR768YDJl8fOGKf/Ye/4uOiLVbH4UsZhcLQQ270hKA== X-Received: by 2002:a17:902:e890:b0:20c:805a:22b with SMTP id d9443c01a7336-20cbced5496mr6942145ad.24.1729004862458; Tue, 15 Oct 2024 08:07:42 -0700 (PDT) Received: from google.com (62.166.143.34.bc.googleusercontent.com. [34.143.166.62]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea9c6ba33csm1451237a12.17.2024.10.15.08.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:07:41 -0700 (PDT) Date: Tue, 15 Oct 2024 15:07:32 +0000 From: Pranjal Shrivastava To: Jason Gunthorpe Cc: "Peng Fan (OSS)" , Will Deacon , Robin Murphy , 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> 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_080744_342444_EB3AC4D2 X-CRM114-Status: GOOD ( 23.76 ) 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 03:00:10PM +0000, Pranjal Shrivastava wrote: > On Tue, Oct 15, 2024 at 09:47:23AM -0300, 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. > > > > If this is a common thing we could have the core code take on more of > > the job. > > Yes! I've seen the IOMMU being bypassed at multiple places, primarily > for performance, people like bypassing the iommu for "trusted" devices. > A few examples that are publically accessible: Qcomm SoCs [1], [2]. > Seems like Qualcomm have a DT property `qcomm-s1-bypass` to achieve > something similar. > > In fact, *blast from the past*, I tried to do something similar sometime > ago with [3]. Although, perhaps that wasn't the best way (and I was a > kernel newbie :)) > > A little off-topic, but I think there has been some interest to bypass > the default substream as well while still maintaining PASID isolation.[4] > Agh, apologies, ignore the following part about rmr, it won't solve the problem here. > Although, as far as arm-smmu-v3 is concerned, IIRC, I think there was a > way to tell that the region is reserved and don't map it. > > > > > Jason > > Thanks, > Pranjal > > [1] > https://github.com/realme-kernel-opensource/realme5-kernel-source/blob/master/arch/arm64/boot/dts/qcom/sa8155-vm-qupv3.dtsi#L22 > > [2] > https://android.googlesource.com/kernel/msm/+/android-7.1.0_r0.2/Documentation/devicetree/bindings/platform/msm/ipa.txt#28 > > [3] > https://lore.kernel.org/all/20230707104857.348353-1-praan@google.com/ > > [4] > https://lore.kernel.org/all/CAGfWUPziSWNMc_px4E-i+_V_Jxdb_WSwOLXHZ+PANz2Tv5pFPA@mail.gmail.com/