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 B8130D1AD30 for ; Wed, 16 Oct 2024 09:14:00 +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=uLkTQUFrbV0L+s+yopZ5QWgalT1mUxLcPDOJAGqfK1U=; b=nRstKD/QiLH0WOrW5QMLaO9qYv OeEjQ1VFaMPKO5txkYJ5vrPxbTIDbVVBSci90Vsd1LVABvh1XbBqMzMiQBsqxB0VbHXBA9zk0hTom qu9prCpE6KsMFnBjXBPG/STLjgkjflaSZBqaOhjgdAJTckPpduLKT6XhGDgq/h8D9MLiQy4vqf9xi MRrTFzKM+Ytj+HoFgTQj7cbinTz26WHy+UrEjRsmYCMyUcVxI5iBwKD7yaezr6AB6YdARvt7Bb0It cy0Zcd5rMsz44OWFMau1tizvGL6HUJRpdgXgVTqkD5ofhOv9s5dJn3Zxjd2cPWfMJmWoiKzxiKJY7 +fdZK4RQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t106C-0000000BBwu-3Af0; Wed, 16 Oct 2024 09:13:44 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t104l-0000000BBdO-16U0 for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2024 09:12:16 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-20c87b0332cso56345ad.1 for ; Wed, 16 Oct 2024 02:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729069934; x=1729674734; 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=uLkTQUFrbV0L+s+yopZ5QWgalT1mUxLcPDOJAGqfK1U=; b=IcXp8fbY6Ctfr1n7ta4V2ZZRz7zbmzDTmehPoH5TVarvqTwsbrCYqZZtl7bVH1cPkn uFsP4kB/2ZRPM7SaG0NfEAXfIe1sj9Dr41fAGNOl1klV4CjEE6kxPLuIYoi15a55KHAC bwhw2fWkizIkKEIWnZRYeyIPEV1xOz3jqqvg5g60zmbkvWjCZnljMhfB/jA0jfnmHTU3 tC9PO49Xl4xe6OPtBRAt6WuZ99vmtjTQTvUqSQXxHi1ERDtE/Ec3aEzqGhpshY/pdlzq aWvsHpAq+abbJZt9jiPdGwKXaePrTuV1KD44W/1SI0IpjoxbUyC+rXIErS2nimlRCj0p ZHtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729069934; x=1729674734; 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=uLkTQUFrbV0L+s+yopZ5QWgalT1mUxLcPDOJAGqfK1U=; b=a3AGReXfWN4PZajejDb8QCN8/cdmmPRjjwCWUqt9q5oL/alIhuu+SgLmVE1rGnyJyy K7cW7L/0tyKNxQapao8wz+fmIU6zVJCg6q69dyjHHcus3y7pKne5XW6kVWKnpJ2OldFR VP4XNUIrUW1t2KtvBB81DpkV0WLafNH7uTuhjeUJ852gF4zEQ8u5SP0RXZXJq72FZRTn JRAYlJQzJ7xRC0J8tdIi6sZF1oi14izRuzXIG3lNyrMpO/KneNOUJkp5xpyeDbyTsYfp o6+kY/VMo5JGgKL4+ZUX96b5pYb8XQmCJsL38GppRfpzN8ZB3kpjMfynnbBm+bn7HdBa AeoA== X-Forwarded-Encrypted: i=1; AJvYcCXECL2wDqZxhwsq/bsWoekV+CtwF077kvq/ECtJg6AM9qPvqWtQJ0kQQ2iYOkgMdgkmF27qqKtRhCft3DzhqkMJ@lists.infradead.org X-Gm-Message-State: AOJu0YwPchdfZcIJuy18ITwTHrjlcpmdXJzMUUSH4hoNejcmlnB0Zffi 0ZLQ71c0jrTmRlXx7uwj/gEWAb6vVtQL4514KWjQMVHvrzTR+NKxQ0vAKkHdtqASCUUlT4TxwTQ zWjIv X-Google-Smtp-Source: AGHT+IEpTuQgMKOjhldOXk/x3cs8GKdyYNhDHrou3DsiJAjDnoKoSf3rkJhlsq9S8AmWVWRj8pqwWg== X-Received: by 2002:a17:902:f552:b0:1f7:34e4:ebc1 with SMTP id d9443c01a7336-20d30021470mr1371165ad.5.1729069933995; Wed, 16 Oct 2024 02:12:13 -0700 (PDT) Received: from google.com (62.166.143.34.bc.googleusercontent.com. [34.143.166.62]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20d17f85455sm24836315ad.51.2024.10.16.02.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:12:13 -0700 (PDT) Date: Wed, 16 Oct 2024 09:12:04 +0000 From: Pranjal Shrivastava To: Peng Fan Cc: Robin Murphy , 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" 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-20241016_021215_325203_B7A8A653 X-CRM114-Status: GOOD ( 28.21 ) 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 Wed, Oct 16, 2024 at 09:02:39AM +0000, Peng Fan wrote: > All, > > > Subject: Re: [PATCH RFC 2/2] iommu/arm-smmu-v3: Bypass SID0 for > > NXP i.MX95 > > Thanks for the discussion on this topic to show much information > that I not foresee. > > > > > 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. > > I just reply here, not reply each thread. Apologies, I responded to the other thread before looking at this one > > The SID is not a registered SID. > > Considering the security things, except "iommus = <&smmu 0>" > being added, is there other method for this issue? I can only think of RMRs if you can ensure/restrict eDMA3 to access a fixed region of memory. Something like a DMA zone if feasible. > > Thanks, > Peng. > > > > > > > > > Thanks, > > > Robin. > > Thanks, Pranjal