Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6B223C02 for ; Mon, 5 Sep 2022 17:08:40 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id r4so12079888edi.8 for ; Mon, 05 Sep 2022 10:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Z4NPH3VMOZhGzciAdUkGzboSEXiv1Tr3n/uskw1TaLc=; b=HtssaPqx0g/dBFfnT62VO14ARKa+MavTMD+vXVu8bojf38JW+7oMZQ6FC2b1O4Cn7+ ANa1bm9arL1ODBssnKv0v1QZ2foCcZLwISc8vqGEEx859S6el9U3L55spM6H42+JUa4H hWWKnlNkDTZZRLPKklGGucJUC8hrF6LXmk7ExVE3X1YNyBdOqLTwCuCYyDM4FawOoFH1 OksKreJsl8IH/zu9GwIpB0dofVgvbO7WFF9pl2PZ8RP+8VfCYrx0QOSLF/VIaRlt0WGH 9ki1epJB7901I41mfJrm0fqBnMX+OfTykLCbhcrhrMsPrw9e1SfBQWNUI3vgbw+3feWq b+6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Z4NPH3VMOZhGzciAdUkGzboSEXiv1Tr3n/uskw1TaLc=; b=JAyZM4Lmmhd58WvVBjZo8EK0Yrf2hxxnejLoKXp2mWQHcnNNuiG6Ux7sOOUYUlI585 CyuJUEFSgRvuY0AW1j3vWCVB0IevhNBO4VpB3AP9D7wpRpVq/sEWiZFsAAZvwmJt9PD/ uNhP/Pu2GNAtynVNmR4yZyNZOMYu5ZbInCHJe75UNpiec9QJXQ1HZewn+mFzkdVZcr3w Zd/i21EB5myI/YdiDYQelhY1QUZW6R2UeKZ0QfMtqPiVuLCKCcIHOHw4dcQ23kw+DIN9 Oq/ab0Z1lajWm2Lb2xRtdiXVE1edyrRyQmNRZQ9jPJNFMByilq+yylfChJWYa11dyx8x DyAQ== X-Gm-Message-State: ACgBeo2n2w2JiPSkqoamSW/Igv3zlRKK4rUYvGF2nkQY6BiJ3FJEWCOv DqT2zAi8rJvvPxJL733FRAU= X-Google-Smtp-Source: AA6agR4s46ks47YtBXe+JZtx/QYH+X1xg0JmwBdjA7c8NgvDIjKokhXf7CMf1PItkPO6PqCYhfsZSQ== X-Received: by 2002:aa7:dcd2:0:b0:44e:69f3:edd1 with SMTP id w18-20020aa7dcd2000000b0044e69f3edd1mr6553227edu.244.1662397719116; Mon, 05 Sep 2022 10:08:39 -0700 (PDT) Received: from localhost (p200300e41f12c800f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f12:c800:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id vs22-20020a170907139600b00734a9503bcasm5266319ejb.135.2022.09.05.10.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 10:08:38 -0700 (PDT) From: Thierry Reding To: Rob Herring , Joerg Roedel Cc: Will Deacon , Robin Murphy , Nicolin Chen , Krishna Reddy , Dmitry Osipenko , Alyssa Rosenzweig , Janne Grunau , Sameer Pujar , devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org, asahi@lists.linux.dev Subject: [PATCH v8 0/5] iommu: Support mappings/reservations in reserved-memory regions Date: Mon, 5 Sep 2022 19:08:28 +0200 Message-Id: <20220905170833.396892-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.2 Precedence: bulk X-Mailing-List: asahi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Thierry Reding Hi, This version has several fixes over the previous v6/v7, which can be found here: https://lore.kernel.org/all/20220705125834.431711-1-thierry.reding@gmail.com/ An example is included in the DT bindings, but here is an extract of what I've used to test this: reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; /* * Creates an identity mapping for the framebuffer that * the firmware has setup to scan out a bootsplash from. */ fb: framebuffer@92cb2000 { reg = <0x0 0x92cb2000 0x0 0x00800000>; iommu-addresses = <&dc0 0x0 0x92cb2000 0x0 0x00800000>; }; /* * Creates a reservation in the IOVA space to prevent * any buffers from being mapped to that region. Note * that on Tegra the range is actually quite different * from this, but it would conflict with the display * driver that I tested this against, so this is just * a dummy region for testing. */ adsp: reservation-adsp { iommu-addresses = <&dc0 0x0 0x90000000 0x0 0x00010000>; }; }; host1x@50000000 { dc@54200000 { memory-region = <&fb>, <&adsp>; }; }; This is abbreviated a little to focus on the essentials. Note also that the ADSP reservation is not actually used on this device and the driver for this doesn't exist yet, but I wanted to include this variant for testing, because we'll want to use these bindings for the reservation use-case as well at some point. Adding Alyssa and Janne who have in the past tried to make these bindings work on Apple M1. Also adding Sameer from the Tegra audio team to look at the ADSP reservation and double-check that this is suitable for our needs. Thierry Navneet Kumar (1): iommu/tegra-smmu: Support managed domains Thierry Reding (4): dt-bindings: reserved-memory: Document iommu-addresses iommu: Implement of_iommu_get_resv_regions() iommu: dma: Use of_iommu_get_resv_regions() iommu/tegra-smmu: Add support for reserved regions .../reserved-memory/reserved-memory.yaml | 70 +++++++++++++++ drivers/iommu/dma-iommu.c | 3 + drivers/iommu/of_iommu.c | 85 +++++++++++++++++++ drivers/iommu/tegra-smmu.c | 85 +++++++++++++++---- include/linux/of_iommu.h | 8 ++ 5 files changed, 234 insertions(+), 17 deletions(-) -- 2.37.2