WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Gerd Hoffmann <kraxel@xxxxxxx>
Subject: Re: [Xen-devel] Essay on an important Xen decision (long)
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Wed, 11 Jan 2006 10:22:20 -0600
Cc: "Magenheimer, Dan \(HP Labs Fort Collins\)" <dan.magenheimer@xxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 11 Jan 2006 16:29:28 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43C4D0F4.5050604@xxxxxxx>
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> <43C4D0F4.5050604@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
Gerd Hoffmann wrote:

  Hi,

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.

Excellent, thanks for the reference!


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

There are, of course, other ways around this. One could have a hypervisor level DMA API that allowed bulk transfer of memory between domains (either by copying or page flipping depending the size of the buffer). Another option would be a separate pool of sharable memory that could be mapped appropriately into a domain's VPM space.

Regards,

Anthony Liguori

cheers,

  Gerd



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel