From patchwork Tue May 3 06:22:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janne Grunau X-Patchwork-Id: 12835045 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 160E3C433F5 for ; Tue, 3 May 2022 06:24:27 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=M1ZAFuWEDkfG0UqPxYZrhtOjiVVzzUFpIOfvgWe8GFo=; b=z1zBlYggocfxia az8xgkj9+7YAHLmb/BBrXplIGU0jzZ+zgAGHyDHd8yIHS9HTiPOyRYZAERVnKLZzmffIopXoz9uWw asznJRCwp0YzMPwj73je1mfXHOHpLv8x0fWqQKJ/dxTNsu1KBiDnOYtw8obCw6ZLJkYlI3Aodf1Sw zrZll+g9DxHgG/1GhstcEm71rpLES6H2sY39+hrxnklM+/xvJIZsx1CYaVvln0PFRHE8NubWgyl5u AzfDnJlvHUeu4Wcn/B5bX4/RxguaYKXBwgK7p16xuvnS2SqnTbZ164IkvgbhF59qxF1vc9tixSMZB ldCHYmfUXlYnZ0VWb4ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nllwX-003x6d-8H; Tue, 03 May 2022 06:23:29 +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 1nllwB-003wxd-QN for linux-arm-kernel@lists.infradead.org; Tue, 03 May 2022 06:23:10 +0000 Received: from coburn.home.jannau.net (p579ad988.dip0.t-ipconnect.de [87.154.217.136]) by soltyk.jannau.net (Postfix) with ESMTPSA id 0605826E9B2; Tue, 3 May 2022 08:23:01 +0200 (CEST) From: Janne Grunau To: iommu@lists.linux-foundation.org Cc: Sven Peter , Alyssa Rosenzweig , Hector Martin , Mark Kettenis , Joerg Roedel , Will Deacon , Rob Herring , Robin Murphy , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 0/4] iommu: M1 Pro/Max DART support Date: Tue, 3 May 2022 08:22:57 +0200 Message-Id: <20220503062301.20872-1-j@jannau.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220502_232308_040178_59AD80E5 X-CRM114-Status: GOOD ( 14.22 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hej, I've taken over this series to add support for DART on M1 Pro/Max from Sven. Since v1 we have discovered further differences in the PTE format. It has four differences which makes it incompatible with the one in the M1: - 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) The last difference is the most troublesome since it makes the PTE format incomaptible with iopte_type(). Handling this inside io-pgtable-arm.c seems manageable since DART supports just a single block size. It opens the question at which point we decide that DART uses its own io_pgtable_ops. There is second type of DART (t8110) present on M1 Pro/Max SoCs which uses the same PTE format as t6000. Janne Sven Peter (4): dt-bindings: iommu: dart: add t6000 compatible iommu/io-pgtable: Add DART subpage protection support iommu/io-pgtable: Add DART PTE support for t6000 iommu: dart: Support t6000 variant .../devicetree/bindings/iommu/apple,dart.yaml | 4 +- drivers/iommu/apple-dart.c | 24 +++++- drivers/iommu/io-pgtable-arm.c | 76 ++++++++++++++++++- drivers/iommu/io-pgtable.c | 1 + include/linux/io-pgtable.h | 3 + 5 files changed, 101 insertions(+), 7 deletions(-) base-commit: 3123109284176b1532874591f7c81f3837bbdc17