From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from soltyk.jannau.net (soltyk.jannau.net [144.76.91.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E4F67E2 for ; Thu, 1 Sep 2022 00:22:36 +0000 (UTC) Received: by soltyk.jannau.net (Postfix, from userid 1000) id 22D3326EF4A; Thu, 1 Sep 2022 02:22:34 +0200 (CEST) Date: Thu, 1 Sep 2022 02:22:34 +0200 From: Janne Grunau To: Robin Murphy Cc: iommu@lists.linux-foundation.org, Konrad Dybcio , asahi@lists.linux.dev, Sven Peter , Alyssa Rosenzweig , Georgi Djakov , Hector Martin , "Isaac J. Manjarres" , Joerg Roedel , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/5] iommu/io-pgtable-dart: Add DART PTE support for t6000 Message-ID: <20220901002234.GD10102@jannau.net> References: <20220621071848.14834-1-j@jannau.net> <20220621071848.14834-5-j@jannau.net> <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> Precedence: bulk X-Mailing-List: asahi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) On 2022-06-27 16:13:20 +0100, Robin Murphy wrote: > On 2022-06-21 08:18, Janne Grunau wrote: > > From: Sven Peter > > > > The DARTs present in the M1 Pro/Max/Ultra SoC use a diffent PTE format. > > They support a 42bit physical address space by shifting the paddr and > > extending its mask inside the PTE. > > They also come with mandatory sub-page protection now which we just > > configure to always allow access to the entire page. This feature is > > already present but optional on the previous DARTs which allows to > > unconditionally configure it. > > > > Signed-off-by: Sven Peter > > Co-developed-by: Janne Grunau > > Signed-off-by: Janne Grunau > > > > --- > > > > Changes in v3: > > - apply change to io-pgtable-dart.c > > - handle pte <> paddr conversion based on the pte format instead of > > the output address size > > > > Changes in v2: > > - add APPLE_DART2 PTE format > > > > drivers/iommu/io-pgtable-dart.c | 51 +++++++++++++++++++++++++++------ > > drivers/iommu/io-pgtable.c | 1 + > > include/linux/io-pgtable.h | 1 + > > 3 files changed, 45 insertions(+), 8 deletions(-) > > > [...] > > @@ -536,7 +571,7 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie) > > if (!cfg->coherent_walk) > > return NULL; > > - if (cfg->oas > 36) > > + if (cfg->oas != 36 && cfg->oas != 42) > > return NULL; > > Wouldn't it make sense to tie this to the format? Maybe 36-bit OAS is still > valid with v2, but presumably 42-bit with v1 definitely isn't. The format is not know inside the alloc call unless I add per format alloc wrapper. I think we can trust the caller for now. Janne 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 91FCBECAAD4 for ; Thu, 1 Sep 2022 00:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Gbvqjs08t6eWfHr/ll00Vr8sybQkIGGJX61kfRclQGg=; b=KsHu7F/GKPHodc Voo/G7EIVl/5fHe6HF3aoIo5u7CWuoo8MvL7mO4IDWFEIq+NoFby3KM7nifyD+WmLL5sf/tWCYjsX I3pu+yVYTjifCo9V3SiI28gq1tbHUFiQ+SeEw2gVLrLMGzhSnugWzKkNwUXIWQ15NEBYzYxEaqx+h luQ98TWt9pgSzjReFZSQ46ptH7/LmFOvqUE0CoUdtIF3+rYdKAX7Wo/gz2akYI7Bg8qWaFll0aKwB Hd4eojVr/aaOdUphx3taVElh8A2X6nb60ueW6T78aPnIL9A9ss55tG9joQrt5xRiZdTYlu7bIvRRd mBhU1F9vYgx8kBb8gFgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTXyg-008mWo-QO; Thu, 01 Sep 2022 00:22:38 +0000 Received: from soltyk.jannau.net ([144.76.91.90]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTXyd-008mVz-QU for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2022 00:22:38 +0000 Received: by soltyk.jannau.net (Postfix, from userid 1000) id 22D3326EF4A; Thu, 1 Sep 2022 02:22:34 +0200 (CEST) Date: Thu, 1 Sep 2022 02:22:34 +0200 From: Janne Grunau To: Robin Murphy Cc: iommu@lists.linux-foundation.org, Konrad Dybcio , asahi@lists.linux.dev, Sven Peter , Alyssa Rosenzweig , Georgi Djakov , Hector Martin , "Isaac J. Manjarres" , Joerg Roedel , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/5] iommu/io-pgtable-dart: Add DART PTE support for t6000 Message-ID: <20220901002234.GD10102@jannau.net> References: <20220621071848.14834-1-j@jannau.net> <20220621071848.14834-5-j@jannau.net> <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_172236_033631_D85A9A19 X-CRM114-Status: GOOD ( 22.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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022-06-27 16:13:20 +0100, Robin Murphy wrote: > On 2022-06-21 08:18, Janne Grunau wrote: > > From: Sven Peter > > > > The DARTs present in the M1 Pro/Max/Ultra SoC use a diffent PTE format. > > They support a 42bit physical address space by shifting the paddr and > > extending its mask inside the PTE. > > They also come with mandatory sub-page protection now which we just > > configure to always allow access to the entire page. This feature is > > already present but optional on the previous DARTs which allows to > > unconditionally configure it. > > > > Signed-off-by: Sven Peter > > Co-developed-by: Janne Grunau > > Signed-off-by: Janne Grunau > > > > --- > > > > Changes in v3: > > - apply change to io-pgtable-dart.c > > - handle pte <> paddr conversion based on the pte format instead of > > the output address size > > > > Changes in v2: > > - add APPLE_DART2 PTE format > > > > drivers/iommu/io-pgtable-dart.c | 51 +++++++++++++++++++++++++++------ > > drivers/iommu/io-pgtable.c | 1 + > > include/linux/io-pgtable.h | 1 + > > 3 files changed, 45 insertions(+), 8 deletions(-) > > > [...] > > @@ -536,7 +571,7 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie) > > if (!cfg->coherent_walk) > > return NULL; > > - if (cfg->oas > 36) > > + if (cfg->oas != 36 && cfg->oas != 42) > > return NULL; > > Wouldn't it make sense to tie this to the format? Maybe 36-bit OAS is still > valid with v2, but presumably 42-bit with v1 definitely isn't. The format is not know inside the alloc call unless I add per format alloc wrapper. I think we can trust the caller for now. Janne _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel