Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3061445iog; Mon, 27 Jun 2022 08:20:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t1aW/f9ZDAiU5m0jrZ+4KvG2+nB15pmaH6MbBmUaUq9rWcNr5GY6FzO9eS+cKK2jwXY47A X-Received: by 2002:a17:906:4785:b0:722:f71d:b10c with SMTP id cw5-20020a170906478500b00722f71db10cmr13644327ejc.31.1656343258172; Mon, 27 Jun 2022 08:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656343258; cv=none; d=google.com; s=arc-20160816; b=UVqE3+XHn+pnfEMjrQEW36mbAKks4UEe5EtnVJbZ9tKplBSmIuFPCze3XBcJhp+oiv pOApne3rzZ6ZGau/XcRiL4Lrb3KtEcKpfJT/MLgkzvJww1t2vTGRkPlmL/RCQrdYKgpM zp2T2+L5hm8o3LwxrGt9OFAZwOUZUXJgwydAWJi1kv7j47I1F3aErQc7TINSlfNMH/HK 6w77bMDBA4N8S2FmuJk70/dgIAMKAQMs2MobOq747UdOGEgJeTtVDziccxoil5geWBCW +LFJ7hbzJaQb5is2X8m017LJova8+4BMbc4KYj6RqpVtpYKChKFfYtGM39ZD5Agbvi2P CA7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=UFf6w8lXwsnHhKcQI8IsbX5GOyEsFvSFbgX6Zy+sf3w=; b=aEPIbF66uRm3BMEkNtEjUI550+fiSo1N1oTkAZfRbL6SVkGfgGsafFdspCiDFlnFZl FTUaoiQs5TqLbgZRO4CsXnDczF4e6i8yeauunq3GClCEx1K75Zox7dzzE+clz9BT1aRJ w9tsrYz223M/AVVjvZ7wMuAAf+Oc0CGXRhI3ssJeNRAbkj5l4Il80CT3LSHk3Ls4tZ0H N/RtCpRJyGCYAtmdUKUaYHC6LAB+JOA6niDSkIU75+RHcxPhO8ph6WhreWjnH9tjjbbR WWrnyutXS9lNkn44x9R3g/MxUv0RKJzuBso4dALPFLP71FnG4HWc7e4a12BWUvywWFUC Hacw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my50-20020a1709065a7200b00718c7b4cc10si9732382ejc.127.2022.06.27.08.20.31; Mon, 27 Jun 2022 08:20:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237893AbiF0PNt (ORCPT + 99 others); Mon, 27 Jun 2022 11:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237821AbiF0PNf (ORCPT ); Mon, 27 Jun 2022 11:13:35 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A65C5175A6 for ; Mon, 27 Jun 2022 08:13:26 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3E8461758; Mon, 27 Jun 2022 08:13:26 -0700 (PDT) Received: from [10.57.84.159] (unknown [10.57.84.159]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 132823F5A1; Mon, 27 Jun 2022 08:13:23 -0700 (PDT) Message-ID: <2df8c1d1-fb83-5b92-d32a-6b8ba988844c@arm.com> Date: Mon, 27 Jun 2022 16:13:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v3 4/5] iommu/io-pgtable-dart: Add DART PTE support for t6000 Content-Language: en-GB To: Janne Grunau , iommu@lists.linux-foundation.org Cc: 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 References: <20220621071848.14834-1-j@jannau.net> <20220621071848.14834-5-j@jannau.net> From: Robin Murphy In-Reply-To: <20220621071848.14834-5-j@jannau.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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-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. Robin.