Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5350759rwb; Wed, 21 Sep 2022 06:44:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pbwJNFLlu6fPQ/pkEyPO2BvRClkh/JzQjm7/T2EDQefqU5+EVyccXqGz+Bj9hLTUlbIgh X-Received: by 2002:a17:907:3e95:b0:780:559f:6339 with SMTP id hs21-20020a1709073e9500b00780559f6339mr20576477ejc.618.1663767849673; Wed, 21 Sep 2022 06:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663767849; cv=none; d=google.com; s=arc-20160816; b=iGdeTcesKxpd0E9bu7u0YkOGzHM3FNnwiINY9g0+jhPYSBOciGqPh/wNx22XwkzWt4 edDK6qFA4PJtdkjGBXwqRTXNVSMa6uTIEp9CghNNL9fdMljx7nVGgwP5e91BYUQb7Vjg QYU/6xxnZeG9hm2Cb/oWoSGvTdaaobUQXUlkEDJYHc4zPViW4If0HMdrOMB3Nq1SEpec Rq/X6FUyT/54vEY+5hrt9oeSx+gYPop8anHd0ANJz3BKdCWD6FiZlAokeuf+frpk4Fmz iF6gO7NKGQM+MCtXikh9MaHh5Zaf/QrNyI3o0RCV8qgIbzu72U+L3oX03+0XxkJHEqvW puTQ== 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=d4DgbmfbVE+fTnK7w0dOVik/soHk4IcWd1mKono9UJA=; b=YqjMnIAY05dCVyXsDG0m6AsjnPAeQQUqKmWY9tbEppwLWar9qiLRRkxL9aZlsa/siD FUPQo+NezE4oms7yzzoe/6o2rhHyDjdxyV9zu5ioKjxg1DDqMklVTdtMmr9cCtMhHF4U 4sYrJOUmw01rHNJrqg7bGf/VKcIPWaG7jMpGXWoc2XqO7zPO9pUf1pZpZ4RhQfE+ikg6 x+RdqCmNKNxppxUpIDgd2cWMllYUoulBvOu5YntV94Ca7Y+krVkudA2kZHRH5NLWdZxW Lpwz8Fe4OmTWg9PJAE9nZTO20tBYC8OSFfhe8WnvwYsj7VDx/WJeND5ZHL62P6qn17Yz 3Kfg== 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 js5-20020a17090797c500b00779f8e7ec5bsi2491470ejc.42.2022.09.21.06.43.41; Wed, 21 Sep 2022 06:44:09 -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 S230019AbiIUNUx (ORCPT + 99 others); Wed, 21 Sep 2022 09:20:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiIUNUw (ORCPT ); Wed, 21 Sep 2022 09:20:52 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 168D093514; Wed, 21 Sep 2022 06:20:51 -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 5ADA9143D; Wed, 21 Sep 2022 06:20:57 -0700 (PDT) Received: from [10.1.32.30] (010265703453.arm.com [10.1.32.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1985A3F73B; Wed, 21 Sep 2022 06:20:46 -0700 (PDT) Message-ID: <11708ed1-b74a-5d45-0ce3-e2649dac1e8a@arm.com> Date: Wed, 21 Sep 2022 14:20:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v5 0/5] iommu: M1 Pro/Max DART support Content-Language: en-GB To: Joerg Roedel Cc: Konrad Dybcio , asahi@lists.linux.dev, Alyssa Rosenzweig , Hector Martin , Krzysztof Kozlowski , Mark Kettenis , Rob Herring , Sven Peter , Will Deacon , devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Janne Grunau References: <20220916094152.87137-1-j@jannau.net> From: Robin Murphy In-Reply-To: <20220916094152.87137-1-j@jannau.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE 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-09-16 10:41, Janne Grunau wrote: > Hej, > > this is the next attempt adding support for the DART found in Apple's > M1 Pro/Max/Ultra. This adds a separate io-pgtable implementation for > DART. As already mentioned in v2 the pte format is not fully compatible > with io-pgtable-arm. Especially the 2nd least significant bit is used > and is not available to tag tables/pages. > io-pgtable-dart.c is copied from io-pgtable-arm.c and support for > unused features is removed. Support for 4k IO pages is left for A7 to > A11 SoCs as there's work underway to run Linux on them. > > The incompatibilities between both Apple DART pte seems manageable in > their own io-pgtable implementation. A short list of the known > differences: > > - the physical addresses are shifted left by 4 bits and and have 2 more > bits inside the PTE entries > - the read/write protection flags are at a different position > - the subpage protection feature is now mandatory. For Linux we can > just configure it to always allow access to the entire page. > - BIT(1) tags "uncached" mappings (used for the display controller) > > There is second type of DART (t8110) present on M1 Pro/Max SoCs which > uses the same PTE format as t6000. FWIW I think there's minimal risk in queueing this up as a late addition for 6.1, lest it get forgotten again. I've not been following it since I've been busy with other things and I largely trust that DART patches are well-tested, but from a quick skim it all earns a solid "yeah, why not" from me :) Cheers, Robin. > Changes in v5: > - collected Sven's ack > - minor fixes in "iommu/io-pgtable: Move Apple DART support to its own > file" > > Changes in v4: > - split dart and io-pgtable-dart build to allow building dart as module > - add missing "SELECT IOMMU_IO_PGTABLE" > - made map/unmap_pages/iova_to_phys inon-recursive > - replace pgd concatenation with multiple table handling > - simplified config and page size checks > - collected Robin's Ack > > Changes in v3: > - move APPLE_DART to its own io-pgtable implementation, copied from > io-pgtable-arm and simplified > > Changes in v2: > - added Rob's Acked-by: > - add APPLE_DART2 io-pgtable format > > Janne Grunau (1): > iommu/io-pgtable: Move Apple DART support to its own file > > Sven Peter (4): > dt-bindings: iommu: dart: add t6000 compatible > iommu/io-pgtable: Add DART subpage protection support > iommu/io-pgtable-dart: Add DART PTE support for t6000 > iommu: dart: Support t6000 variant > > .../devicetree/bindings/iommu/apple,dart.yaml | 4 +- > MAINTAINERS | 1 + > drivers/iommu/Kconfig | 13 +- > drivers/iommu/Makefile | 1 + > drivers/iommu/apple-dart.c | 24 +- > drivers/iommu/io-pgtable-arm.c | 63 --- > drivers/iommu/io-pgtable-dart.c | 470 ++++++++++++++++++ > drivers/iommu/io-pgtable.c | 3 + > include/linux/io-pgtable.h | 1 + > 9 files changed, 512 insertions(+), 68 deletions(-) > create mode 100644 drivers/iommu/io-pgtable-dart.c >