Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp112266rwe; Wed, 31 Aug 2022 17:34:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR5y9rMdMgU5WjMJm6Wi3Hta78Yh+7k1aHYOrjpAz0k1cN/CTRqgT+jutmGVWBk5FPjgdJud X-Received: by 2002:a17:907:2ceb:b0:741:6115:a57 with SMTP id hz11-20020a1709072ceb00b0074161150a57mr14337351ejc.423.1661992492615; Wed, 31 Aug 2022 17:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661992492; cv=none; d=google.com; s=arc-20160816; b=I7PiMUV+M4Vy5QnM3zcvGySAxzoIKe9JrfzI0W1s4kJOz2f4mA1zvfu11KvrFWr08s 8ifB/7PK4izidkpjvx/axdAMOCTryogt6u/XR0+OYVNuCISzA24lLpLCRQoPtbsMK2Jq nn9RdS/6UCtrgXlOsLznSgON5m0ygGwauXbgQ3+cvnnr5zPlu6TSGvu3y61iPwljPX2j /OItZUFs2Q7IthYZBEM6VVB203gbpOS5Oac4bih78+MgedtmcODN8oaSL0fAkEIaUzSO pBAcUG8hoR38CdJdPWENjDpBI0Nt8yWVdxGmRERpyvKYZSgmvhZoQAwkqlRsfG5nZdlC gqYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=78yYE39KQS5OEJRp1DUgeBjpHzCXkIuxvGV+sDtJY8o=; b=noREUOn5jJ108IFG1YVVDofduTDcqbyRFlknxytod/u6d5Yqwbo5OMz0MT3R/5IJTR FT54I8eSqhUDUaLpnUzQMAk97FAoKKv6tmS4hdyzC3Eoxq11eSfeZlzJj7tKxoe8e6M7 biM24oeH7lVYM1TDSA0LazrbXZ9xOT5aGkSAIG986LHpixTRJ9mJioaROirOchZF5tBX 52IAb5agsxgOX4BAdeBlnpfGGc21Sjt/9qStbxPs7lIH7FVAyXPzOHamAHmP31qTkRVr tex/eSZ6kbOHegqmyk+Tx42o6Xn27iYgxayQs7bB+ubs6tlDwkrEgrsA3E7QDyvksFNK XS8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a170907914300b0073cfa9b4286si10067408ejs.648.2022.08.31.17.34.05; Wed, 31 Aug 2022 17:34:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231138AbiIAAWi (ORCPT + 99 others); Wed, 31 Aug 2022 20:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbiIAAWh (ORCPT ); Wed, 31 Aug 2022 20:22:37 -0400 X-Greylist: delayed 452 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 31 Aug 2022 17:22:35 PDT Received: from soltyk.jannau.net (soltyk.jannau.net [144.76.91.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B71A1DDAAF for ; Wed, 31 Aug 2022 17:22:35 -0700 (PDT) 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-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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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