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

James Bottomley (James.Bottomley@steeleye.com)
01 Jul 2003 14:56:49 -0500


On Tue, 2003-07-01 at 12:42, Andi Kleen wrote:
> K8 doesn't have a real IOMMU. Instead it extended the AGP aperture to work
> for PCI devices too. The AGP aperture is a hole in memory configured
> at boot, normally mapped directly below 4GB, but it can be elsewhere
> (it's actually an BIOS option on machines without AGP chip and when
> the BIOS option is off Linux allocates some memory and puts the hole
> on top of it. This allocated hole can be anywhere in the first 4GB)
> Inside the AGP aperture memory is always remapped, you get a bus abort
> when you access an area in there that is not mapped.
>
> In short to detect it it needs to test against an address range,
> a mask is not enough.

It sounds like basically anything not physically in the window is
bypassable, so you just set BIO_VMERGE_BYPASS_MASK to 1. Thus, any
segment within the device's dma_mask gets bypassed, and anything that's
not has to be remapped within the window.

I don't see where you need to put extra information into the virtual
merging process.

> > I'm a bit reluctant to put a function like this in because the block
> > layer does a very good job of being separate from the dma layer.
> > Maintaining this separation is one of the reasons I added a dma_mask to
> > the request_queue, not a generic device pointer.
>
> Not sure I understand why you want to do this in the block layer.
> It's a generic extension of the PCI DMA API. The block devices/layer itself
> has no business knowing such intimate details about the pci dma
> implementation, it should just ask.

Virtual merging is already part of the block layer. It actually
interferes with the ability to bypass the IOMMU because you can't merge
virtually if you want to do a bypass.

James

-
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/