Re: [RFC] block layer support for DMA IOMMU bypass mode

Andi Kleen (ak@suse.de)
Tue, 1 Jul 2003 19:09:38 +0200


On 01 Jul 2003 11:46:12 -0500
James Bottomley <James.Bottomley@steeleye.com> wrote:

>
> Some IOMMUs come with a "bypass" mode, where the IOMMU won't try to
> translate the physical address coming from the device but will instead
> place it directly on the memory bus. For some machines (ia-64, and
> possibly x86_64) any address not programmed into the IOMMU for

That's the case on x86_64 yes.

> The Problem:
>
> At the moment, the block layer assumes segments may be virtually
> mergeable (i.e. two phsically discondiguous pages may be treated as a
> single SG entity for DMA because the IOMMU will patch up the
> discontinuity) if an IOMMU is present in the system. This effectively
> stymies using bypass mode, because segments may not be virtually merged
> in a bypass operation.

I assume on 2.5 has this problem, not 2.4, right?

>
> The Solution:
>
> Is to teach the block layer not to virtually merge segments if either
> segment may be bypassed. To that end, the block layer has to know what
> the physical dma mask is (not the bounce limit, which is different) and
> it must also know the address bits that must be asserted in bypass
> mode. To that end, I've introduced a new #define for asm/io.h
>
> BIO_VMERGE_BYPASS_MASK

But a mask is not good for AMD64 because there is no guarantee
that the bypass/iommu address is checkable using a mask
(K8 uses an memory hole for IOMMU purposes and for various
reasons the hole can be anywhere in the address space)

This means x86_64 needs an function. Also the name is quite weird and
the issue is not really BIO specific. How about just calling it
iommu_address() ?

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/