This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] Essay on an important Xen decision (long)

To: Anthony Liguori <aliguori@xxxxxxxxxx>
Subject: Re: [Xen-devel] Essay on an important Xen decision (long)
From: Gerd Hoffmann <kraxel@xxxxxxx>
Date: Wed, 11 Jan 2006 10:33:40 +0100
Cc: "Magenheimer, Dan \(HP Labs Fort Collins\)" <dan.magenheimer@xxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 11 Jan 2006 09:40:38 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43C41133.3050606@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <516F50407E01324991DD6D07B0531AD59030F8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <43C41133.3050606@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050715)

If the only issue for making dom0 VP is DMA, wouldn't it be easier to modify the Linux DMA subsystem[1] to make a special hypercall to essentially pin a VP to a particular MFN that could be used for the DMA?

Linux has a nice API for DMA memory management, see Documentation/DMA-mapping.txt. Basically you pass in a "struct page" and a offset (within that page) and get back a dma address you can pass on to your hardware. That is required for some architectures where phyical addresses (as seen by the CPU) and bus addresses (as seen by the pci devices) are not identical. It's also needed on archs which have an iommu to create/delete mapping entries there.

I think that API should do just fine for any DMA transfer dom0 wants to do for its own pages. xenlinux would simply need a special implementation of that API which calls xen to translate the VP address into a dma address (usually same as machine address). Probably xen must also handle a iommu (if present) to ensure secure dma once we have hardware which supports this.

A bit more tricky are DMA transfers for _other_ domains (i.e. what the blkback driver has to do). blkback maps the foreign domain pages into its own address space, and I think there is no way around that right now API-wise as otherwise there isn't a "struct page" for the page ...



Gerd 'just married' Hoffmann <kraxel@xxxxxxx>
I'm the hacker formerly known as Gerd Knorr.

Xen-devel mailing list