Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp918584rwb; Thu, 22 Sep 2022 07:59:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63d7Mig8SeyolneKgp3VZkIEudQzzxd7jZNcc02CBvWw9Fky7iQlc4hp4y19YUBaEoiuKA X-Received: by 2002:a63:5242:0:b0:438:a092:acf with SMTP id s2-20020a635242000000b00438a0920acfmr3418092pgl.412.1663858785181; Thu, 22 Sep 2022 07:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663858785; cv=none; d=google.com; s=arc-20160816; b=Vbq8LVT43ZZUi7fW7NrxKNQFet+9wRhyr7kWxUtmtKulXH/L7GPzGU3DZ59UHA2/aS H44iXR8vDGUEF0EiW+CzDRehEA6HsPxM9D6t6UeTg8WOj/D3x97Hfn3Apc9fcT0UGgdm bwrxcnou2QeoEzA/ZHi1VxDPnp8aEXDXSj+t6UTs1opYsROgZdRkJByiOP9zK7nRA3ze fzwenpZU0SPUn+9rUIy/TLq1W1EhFq2/fo++dHnutlkKXQeQLAXHkGJrQUfCY5lVT3QS 2drA/7PWmXVe9/A3upuWNLIgr8YziwQBE07OPBQj8LEUeLATlH/nmryTi+p08cApVa74 Z/Fw== 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:dkim-signature; bh=m0/xhmo2LZoRsGciVIVKZjrkItru4oVj7ssTCSvQOkA=; b=XnQgvEnwpHLfadwfkhwBYOUqVjL0SNRR9JM42VSw4nWxsX/MI8SjVBrlWlpRit4g09 LQzDGUZEsKoaGzl7BNN0tJwzjjPwKDhSJlD+piQULOJnMdjJenqZRI+3ZMX/rB0BTy0g olyqfVCuZWakuIS5+ke9KX3dYbUO7v0oNsItWHMjk1Kkqkjkl+Yy3X8tPoH4J9FVGRyF tAgwi4SI3U5qFYyxOzD6QBHJ1KgXbayABLo0xnVXwEIdzlwTvX9BG3owHeR13y2Ujk7J V/ISdkmeLC7P3r4NzFLbF9LNiRQaVULjJe5zZwxw/bzqZkqbzYkCibCjG3WN1QoH+Mqs ZS7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=QWCLSwH9; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d21-20020a056a00199500b0053ac347a786si6759691pfl.259.2022.09.22.07.59.32; Thu, 22 Sep 2022 07:59:45 -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; dkim=pass header.i=@marcan.st header.s=default header.b=QWCLSwH9; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbiIVOGL (ORCPT + 99 others); Thu, 22 Sep 2022 10:06:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbiIVOGI (ORCPT ); Thu, 22 Sep 2022 10:06:08 -0400 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 243E3E99B7; Thu, 22 Sep 2022 07:06:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 8FCAD425F5; Thu, 22 Sep 2022 14:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1663855565; bh=IydF5r0bwDxzvvlIl9TxDhyPgIBbw9VfI21vnIe6xyc=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=QWCLSwH9Zu8tmvAgyNU8L+E3ZSC2DJr9cXDYuKOJ4wnNv0KYrpVxZsO6cLeh4dIgK b1/WnbRUlVqVguRXcwXDLBamyaYegJjAprs0dn0b0CpT/uJBcDDN36XJQpl3vejslY OfudroNDHHsAOhx9HcBzRqL/uf5r3knwDt6mbDozdmaHf7A8BYM88Ee2kKpF7Ulq6H fLvbaOBeAUEB3zW/7kBi58NBMXBk7hHyb5h9a7Wj3XPQ+TQQh+Ox5sfhquCeIoktVn CAsOJJ1hQrqjIEwyV6yLXHF64QOd/eMc1pG8Gz5IEUydjfypAeGLFWr74TIYuOXPR6 2L4ljj6UaGwXg== Message-ID: <1a3771f5-39e6-4360-2b8d-2563ebdffd37@marcan.st> Date: Thu, 22 Sep 2022 23:05:59 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v5 0/5] iommu: M1 Pro/Max DART support Content-Language: es-ES To: Janne Grunau , iommu@lists.linux.dev Cc: Konrad Dybcio , asahi@lists.linux.dev, Alyssa Rosenzweig , Joerg Roedel , Krzysztof Kozlowski , Mark Kettenis , Rob Herring , Robin Murphy , Sven Peter , Will Deacon , devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220916094152.87137-1-j@jannau.net> From: Hector Martin In-Reply-To: <20220916094152.87137-1-j@jannau.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS 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 16/09/2022 18.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. > > 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 > For the whole series, modulo the trivial warning I mentioned: Acked-by: Hector Martin Let's get this merged please, it's been blocking t6000 support for a long time now :) - Hector