Hello, I was reading the Xen 3.0 Interface Guide and there was a statement that concerned me. Specifically: "Pseudo-physical memory, on the other hand, is a per-domain abstraction. It allows a guest operating system to consider its memory allocation to consist of a contiguous range of physical page frames starting at physical frame 0, despite the fact that the underlying machine page frames may be sparsely allocated and in any order." 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? 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? Thanks - Martin _________________________________________________________________ Try Live.com: where your online world comes together - with news, sports, weather, and much more. http://www.live.com/getstarted _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Aug 01, 2006 at 01:04:22PM -0400, mjfeeney@hotmail.com wrote:> 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.> 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). Cheers, Muli _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
mjfeeney@hotmail.com
2006-Aug-02 15:42 UTC
RE: [Xen-users] Question on pseudo-physical memory
> > > 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 _________________________________________________________________ Try Live.com - your fast, personalized homepage with all the things you care about in one place. http://www.live.com/getstarted _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users