Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp717551pxv; Wed, 14 Jul 2021 13:53:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwidVA2I7NYtUiMMI+Q6z96rzi/AUHvwOJqRCDy/jp2+1oIG3NWicAlmcoExQiVwFkNYB19 X-Received: by 2002:a6b:2bd6:: with SMTP id r205mr44393ior.122.1626296001032; Wed, 14 Jul 2021 13:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626296001; cv=none; d=google.com; s=arc-20160816; b=ncu08Fzm+9GwIAWHJ/bsgUx61CU3zEHE5H6hcZgmacce5FylMr4W6UaUhpgj4ko3VX OFPGZNBHwYgBz2Ct8xqtn0QEajaTAktzcQwejAYwF4MEx6S/7hgRQPCHCdGbopiZPVcB JnCyAteBoxX4zwF6YCTUOH3CZE/ln1vaYf0sbdvQB6QXhAizPWi6CpdQiCwsL9E7wZcO TjOkyeeC4xWRfpsQVtIb3BiDV1ldlHBDEkRNpFkG36z0okU5TILt1nOvbpQJcfb3Sajz Xb4TDd8ai1bXRi4b8/w2HGaXQxRhq9i7o3nYZBt8qryEubnuc5M2HMYi22x1QySnl1i4 GqeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lDCEYvKNm9nMbGWwxT1RJxms2I/44q3iSjpaUVbOnng=; b=QyXWEz1fedjgAsDWnai4aq8rmz3EDSrvExrqbVAixFqeq74PEQA0nVFLCUR6gK7s1T acl8/0wpzNhhDXDOEu51Ru0Plt2JibmZHKrL4uFftAcIvNStnqDytwFx88gubRzz5cIw u4TyRLPRFgOEcBPOEZqDbv5EC/FBzxgR2ZyCZsMqglNkujGJTaFayTLyUfIIOoi3ue/M P9Vj8QijAIAZF9KnXIvKthfvCjS5r3Fi6r4q7YepxaWYzqQLRXM5KF6c/b7fSZKtFilo 13LFDif5gWb9y5YDjfEbxbr6Ja6DoSrgjY0T0968Vgq3dmZKQgJ3QfsSHUJ5xYSABXKA rMHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WLPrmbY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si3968292ilu.13.2021.07.14.13.53.08; Wed, 14 Jul 2021 13:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WLPrmbY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233147AbhGNUyn (ORCPT + 99 others); Wed, 14 Jul 2021 16:54:43 -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-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