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

RE: [Xen-users] Question on pseudo-physical memory

To: "xen-users@xxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-users] Question on pseudo-physical memory
From: mjfeeney@xxxxxxxxxxx
Date: Wed, 2 Aug 2006 11:42:14 -0400
Delivery-date: Wed, 02 Aug 2006 08:43:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
>
> > Does this mean that a Domain0 Linux kernel driver which allocated
> > kernel memory with kmalloc() or __get_free_pages() may not receive
> > memory that is physically contiguous in the underlying real memory?
>
> Yep.
 
Is there, therefore, any way to guarantee that a kmalloc'ed (or similar) area is physically contiguous in machine memory? For example, if I need 8K (two pages) of physically continuous machine memory, how does a kernel device driver allocate this memory.
  
> > I ask because this could cause an issue for a device driver that
> > must build scatter/gather lists for an external device.  If this is
> > true, is there documentation available on what's required to build a
> > valid scatter/gather list which contains real physically contiguous
> > segments?
>
> If your driver is using the DMA API properly as it should, this should
> "just work", since the XenLinux DMA API implementations do the right
> thing (e.g., using swiotlb for bouncing buffer which are not contigous
> in machine memory).
 
Which "DMA API" are you referring to?  I am writing a SCSI device driver which accepts a scatter-gather list from the SCSI midlayer uses the kernel dma_map_sg() service to map to (what the kernel believes are) real addresses.  Under Xen, are these (pseudo-)physical addresses or machine addresses?  My belief is that they are the former and may need another layer of translation to generate the real (machine) addresses.
 
Thanks for the help - Martin
 


With MSN Spaces email straight to your blog. Upload jokes, photos and more. It's free! It's free!
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>