[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a18XK2mfMGbZ+M32Mbabhbkd+=DNrnzampOah_j=rWozw@mail.gmail.com>
Date: Wed, 14 Jul 2021 22:51:34 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Robin Murphy <robin.murphy@....com>
Cc: Sven Peter <sven@...npeter.dev>, Will Deacon <will@...nel.org>,
Joerg Roedel <joro@...tes.org>,
DTML <devicetree@...r.kernel.org>,
Hector Martin <marcan@...can.st>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Marc Zyngier <maz@...nel.org>,
Mohamed Mediouni <mohamed.mediouni@...amail.com>,
Stan Skowronek <stan@...ellium.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Mark Kettenis <mark.kettenis@...all.nl>,
"open list:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
Alexander Graf <graf@...zon.com>,
Alyssa Rosenzweig <alyssa.rosenzweig@...labora.com>,
Rob Herring <robh+dt@...nel.org>,
Rouven Czerwinski <r.czerwinski@...gutronix.de>
Subject: Re: [PATCH v4 0/3] Apple M1 DART IOMMU driver
On Wed, Jul 14, 2021 at 8:21 PM Robin Murphy <robin.murphy@....com> 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
Powered by blists - more mailing lists