Re: [PATCH 0/3] Apple M1 DART IOMMU driver

From: Arnd Bergmann
Date: Fri Mar 26 2021 - 12:39:14 EST


On Fri, Mar 26, 2021 at 5:10 PM Sven Peter <sven@xxxxxxxxxxxxx> wrote:
> On Fri, Mar 26, 2021, at 16:59, Mark Kettenis wrote:
> > Some of the DARTs provide a bypass facility. That code make using the
> > standard "dma-ranges" property tricky. That property would need to
> > contain the bypass address range. But that would mean that if the
> > DART driver needs to look at that property to figure out the address
> > range that supports translation it will need to be able to distinguish
> > between the translatable address range and the bypass address range.
>
> Do we understand if and why we even need to bypass certain streams?

My guess is that this is a performance optimization.

There are generally three reasons to want an iommu in the first place:
- Pass a device down to a guest or user process without giving
access to all of memory
- Avoid problems with limitations in the device, typically when it
only supports
32-bit bus addressing, but the installed memory is larger than 4GB
- Protect kernel memory from broken drivers

If you care about none of the above, but you do care about data transfer
speed, you are better off just leaving the IOMMU in bypass mode.
I don't think we have to support it if the IOMMU works reliably, but it's
something that users might want.

Arnd