From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67266C47E48 for ; Wed, 14 Jul 2021 20:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D55E613CA for ; Wed, 14 Jul 2021 20:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234019AbhGNUyo (ORCPT ); Wed, 14 Jul 2021 16:54:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbhGNUyn (ORCPT ); Wed, 14 Jul 2021 16:54:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 480C1613D6; Wed, 14 Jul 2021 20:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626295911; bh=xAyIdXe/5fhq34AXTyvgdjHjmK5ndfv86zQ48bk0AJE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WLPrmbY+/4G0TvI9fg6g5W/gH96ZMYa8lj/uZ1BhLE7SH6PB/P5a9HYbijdqUuTaL sKsL7R7hmGI11aE99N7FLPfwE3VMeU1/b1xpb5GNPUMfW8ydK8bson3RLBs3XgvcSW j+QxsuNrxkwlwLiPecBRrXHTMYmQDrJuxcdq4u3+yBdIOcUfsSR++EYhTBXZTzH9Fw cgAYzwKQ1QEUqUsmDwWaiYAdNscr3871knlhHMs5zteG+7IXqtoyalqWc9OBCnjGK2 eDSOoI4b/akid9ZOzp/NBUWMJMmuDVllwd3O7bRU2DVDv22glZx6Dda2Foy75q6uvd bmHQoij/psogw== Received: by mail-wm1-f44.google.com with SMTP id y21-20020a7bc1950000b02902161fccabf1so4712657wmi.2; Wed, 14 Jul 2021 13:51:51 -0700 (PDT) X-Gm-Message-State: AOAM532mKi7LkyGM3mmln76qhIzZOytr9zuKImsB5vgj6MmwP/b3QEtl 5+zwvm2YWvC1hCi8aN4TJgyOFVx00YKBNxBKxOc= X-Google-Smtp-Source: ABdhPJz63KW2Ft3EbkVjZmLO4vq5WYRyfYEAftI+sXxudBSXv9441/KxGl10WXB7ZvaYYnopUapzerEF9J1s+q7gcgU= X-Received: by 2002:a1c:4e0c:: with SMTP id g12mr6068054wmh.120.1626295909914; Wed, 14 Jul 2021 13:51:49 -0700 (PDT) MIME-Version: 1.0 References: <20210627143405.77298-1-sven@svenpeter.dev> <7261df01-34a9-4e53-37cd-ae1aa15b1fb4@arm.com> In-Reply-To: <7261df01-34a9-4e53-37cd-ae1aa15b1fb4@arm.com> From: Arnd Bergmann Date: Wed, 14 Jul 2021 22:51:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 0/3] Apple M1 DART IOMMU driver To: Robin Murphy Cc: Sven Peter , Will Deacon , Joerg Roedel , DTML , Hector Martin , Linux Kernel Mailing List , Marc Zyngier , Mohamed Mediouni , Stan Skowronek , Linux ARM , Mark Kettenis , "open list:IOMMU DRIVERS" , Alexander Graf , Alyssa Rosenzweig , Rob Herring , Rouven Czerwinski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 14, 2021 at 8:21 PM Robin Murphy wrote: > > On 2021-06-27 15:34, Sven Peter wrote: > [...] > > In the long term, I'd like to extend the dma-iommu framework itself to > > support iommu pagesizes with a larger granule than the CPU pagesize if that is > > something you agree with. > > BTW this isn't something we can fully support in general. IOMMU API > users may expect this to work: > > iommu_map(domain, iova, page_to_phys(p1), PAGE_SIZE, prot); > iommu_map(domain, iova + PAGE_SIZE, page_to_phys(p2), PAGE_SIZE, prot); > > Although they do in principle have visibility of pgsize_bitmap, I still > doubt anyone is really prepared for CPU-page-aligned mappings to fail. > Even at the DMA API level you could hide *some* of it (at the cost of > effectively only having 1/4 of the usable address space), but there are > still cases like where v4l2 has a hard requirement that a page-aligned > scatterlist can be mapped into a contiguous region of DMA addresses. I think that was the same conclusion we had earlier: the dma-mapping interfaces should be possible for large iotlb pages, but any driver directly using the IOMMU API, such as VFIO, would not work. The question is how we can best allow one but not the other. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D762EC12002 for ; Wed, 14 Jul 2021 20:52:00 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85740613CA for ; Wed, 14 Jul 2021 20:52:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85740613CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3453D40620; Wed, 14 Jul 2021 20:52:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BvnDD69z5PVQ; Wed, 14 Jul 2021 20:51:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 9C034400F8; Wed, 14 Jul 2021 20:51:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 64132C001A; Wed, 14 Jul 2021 20:51:57 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id F108AC000E for ; Wed, 14 Jul 2021 20:51:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D6CFD4035C for ; Wed, 14 Jul 2021 20:51:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fUDEMtfi38aY for ; Wed, 14 Jul 2021 20:51:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp4.osuosl.org (Postfix) with ESMTPS id BA96A402FD for ; Wed, 14 Jul 2021 20:51:51 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 47B2D613D3 for ; Wed, 14 Jul 2021 20:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626295911; bh=xAyIdXe/5fhq34AXTyvgdjHjmK5ndfv86zQ48bk0AJE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WLPrmbY+/4G0TvI9fg6g5W/gH96ZMYa8lj/uZ1BhLE7SH6PB/P5a9HYbijdqUuTaL sKsL7R7hmGI11aE99N7FLPfwE3VMeU1/b1xpb5GNPUMfW8ydK8bson3RLBs3XgvcSW j+QxsuNrxkwlwLiPecBRrXHTMYmQDrJuxcdq4u3+yBdIOcUfsSR++EYhTBXZTzH9Fw cgAYzwKQ1QEUqUsmDwWaiYAdNscr3871knlhHMs5zteG+7IXqtoyalqWc9OBCnjGK2 eDSOoI4b/akid9ZOzp/NBUWMJMmuDVllwd3O7bRU2DVDv22glZx6Dda2Foy75q6uvd bmHQoij/psogw== Received: by mail-wm1-f48.google.com with SMTP id n4so2410766wms.1 for ; Wed, 14 Jul 2021 13:51:51 -0700 (PDT) X-Gm-Message-State: AOAM531fgN0kX3UYWeyFq3T/quTn94E7WtUAhUWIAXrNLm9QYCI/YEIL nwhA1kUwMYrQwXI0DCqjThGcCwg7IowU/mB/YK8= X-Google-Smtp-Source: ABdhPJz63KW2Ft3EbkVjZmLO4vq5WYRyfYEAftI+sXxudBSXv9441/KxGl10WXB7ZvaYYnopUapzerEF9J1s+q7gcgU= X-Received: by 2002:a1c:4e0c:: with SMTP id g12mr6068054wmh.120.1626295909914; Wed, 14 Jul 2021 13:51:49 -0700 (PDT) MIME-Version: 1.0 References: <20210627143405.77298-1-sven@svenpeter.dev> <7261df01-34a9-4e53-37cd-ae1aa15b1fb4@arm.com> In-Reply-To: <7261df01-34a9-4e53-37cd-ae1aa15b1fb4@arm.com> From: Arnd Bergmann Date: Wed, 14 Jul 2021 22:51:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 0/3] Apple M1 DART IOMMU driver To: Robin Murphy Cc: DTML , Rouven Czerwinski , Marc Zyngier , Hector Martin , Linux Kernel Mailing List , "open list:IOMMU DRIVERS" , Rob Herring , Alexander Graf , Alyssa Rosenzweig , Mohamed Mediouni , Mark Kettenis , Will Deacon , Linux ARM , Stan Skowronek X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Jul 14, 2021 at 8:21 PM Robin Murphy wrote: > > On 2021-06-27 15:34, Sven Peter wrote: > [...] > > In the long term, I'd like to extend the dma-iommu framework itself to > > support iommu pagesizes with a larger granule than the CPU pagesize if that is > > something you agree with. > > BTW this isn't something we can fully support in general. IOMMU API > users may expect this to work: > > iommu_map(domain, iova, page_to_phys(p1), PAGE_SIZE, prot); > iommu_map(domain, iova + PAGE_SIZE, page_to_phys(p2), PAGE_SIZE, prot); > > Although they do in principle have visibility of pgsize_bitmap, I still > doubt anyone is really prepared for CPU-page-aligned mappings to fail. > Even at the DMA API level you could hide *some* of it (at the cost of > effectively only having 1/4 of the usable address space), but there are > still cases like where v4l2 has a hard requirement that a page-aligned > scatterlist can be mapped into a contiguous region of DMA addresses. I think that was the same conclusion we had earlier: the dma-mapping interfaces should be possible for large iotlb pages, but any driver directly using the IOMMU API, such as VFIO, would not work. The question is how we can best allow one but not the other. Arnd _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B426C47E48 for ; Wed, 14 Jul 2021 23:36:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 47BAC613C8 for ; Wed, 14 Jul 2021 23:36:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47BAC613C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Fjh/pozxN2FLuwlBz7PELEOvkQGREseGyE1/aJKkYuQ=; b=cPWImSD1RWTX4U 76rKSVne33A9T1+fmSAbWSJ3rkiUCFoRJxWAJi3KsQzaLzGRH7BrHzD4hjNOJpOOE6N7NcjoI+3Sy 4XK7KbfXHuAh14Fs32XxcjqJXc1OjeZylTfyE1dYNPQNq9msK8WYmt+pRKV75xmd9wYvv8yyVDDcB vApGWkyWehbWNaWEhXOXBWywVDIqis2Hr1kG2PYezftpDaQ3WmP6IlcqVzlc95VT8koJ5UCL6O2NU +q5kfQtDAYqNYpqtyUoIt7kEaU3wFe+/fppXKCbbrnkd/ZmNUXSYrTK9j3+ZEfAeM23xpO2u+Kq4X 8ezupUxCGFDl4DxTYqyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3oOX-00GKTZ-0e; Wed, 14 Jul 2021 23:34:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3lrD-00FAZM-MV for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 20:51:53 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5CF9C613DB for ; Wed, 14 Jul 2021 20:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626295911; bh=xAyIdXe/5fhq34AXTyvgdjHjmK5ndfv86zQ48bk0AJE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WLPrmbY+/4G0TvI9fg6g5W/gH96ZMYa8lj/uZ1BhLE7SH6PB/P5a9HYbijdqUuTaL sKsL7R7hmGI11aE99N7FLPfwE3VMeU1/b1xpb5GNPUMfW8ydK8bson3RLBs3XgvcSW j+QxsuNrxkwlwLiPecBRrXHTMYmQDrJuxcdq4u3+yBdIOcUfsSR++EYhTBXZTzH9Fw cgAYzwKQ1QEUqUsmDwWaiYAdNscr3871knlhHMs5zteG+7IXqtoyalqWc9OBCnjGK2 eDSOoI4b/akid9ZOzp/NBUWMJMmuDVllwd3O7bRU2DVDv22glZx6Dda2Foy75q6uvd bmHQoij/psogw== Received: by mail-wm1-f50.google.com with SMTP id j34so2384766wms.5 for ; Wed, 14 Jul 2021 13:51:51 -0700 (PDT) X-Gm-Message-State: AOAM530OGER4dSFAYWveLpGGCSSZ7NunpOhON1tkibp+zS5cc5CXnVFI n6F9OdRCh1YhS+npxWJSR9/PzKdl86iNzJy0yu0= X-Google-Smtp-Source: ABdhPJz63KW2Ft3EbkVjZmLO4vq5WYRyfYEAftI+sXxudBSXv9441/KxGl10WXB7ZvaYYnopUapzerEF9J1s+q7gcgU= X-Received: by 2002:a1c:4e0c:: with SMTP id g12mr6068054wmh.120.1626295909914; Wed, 14 Jul 2021 13:51:49 -0700 (PDT) MIME-Version: 1.0 References: <20210627143405.77298-1-sven@svenpeter.dev> <7261df01-34a9-4e53-37cd-ae1aa15b1fb4@arm.com> In-Reply-To: <7261df01-34a9-4e53-37cd-ae1aa15b1fb4@arm.com> From: Arnd Bergmann Date: Wed, 14 Jul 2021 22:51:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 0/3] Apple M1 DART IOMMU driver To: Robin Murphy Cc: Sven Peter , Will Deacon , Joerg Roedel , DTML , Hector Martin , Linux Kernel Mailing List , Marc Zyngier , Mohamed Mediouni , Stan Skowronek , Linux ARM , Mark Kettenis , "open list:IOMMU DRIVERS" , Alexander Graf , Alyssa Rosenzweig , Rob Herring , Rouven Czerwinski X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210714_135151_817010_935EBC05 X-CRM114-Status: GOOD ( 18.37 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 14, 2021 at 8:21 PM Robin Murphy wrote: > > On 2021-06-27 15:34, Sven Peter wrote: > [...] > > In the long term, I'd like to extend the dma-iommu framework itself to > > support iommu pagesizes with a larger granule than the CPU pagesize if that is > > something you agree with. > > BTW this isn't something we can fully support in general. IOMMU API > users may expect this to work: > > iommu_map(domain, iova, page_to_phys(p1), PAGE_SIZE, prot); > iommu_map(domain, iova + PAGE_SIZE, page_to_phys(p2), PAGE_SIZE, prot); > > Although they do in principle have visibility of pgsize_bitmap, I still > doubt anyone is really prepared for CPU-page-aligned mappings to fail. > Even at the DMA API level you could hide *some* of it (at the cost of > effectively only having 1/4 of the usable address space), but there are > still cases like where v4l2 has a hard requirement that a page-aligned > scatterlist can be mapped into a contiguous region of DMA addresses. I think that was the same conclusion we had earlier: the dma-mapping interfaces should be possible for large iotlb pages, but any driver directly using the IOMMU API, such as VFIO, would not work. The question is how we can best allow one but not the other. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel