Xin Zhao
2005-Feb-10 08:54 UTC
[Xen-devel] direct_remap_area_pages() does not work for multiple pages?
Hi, I am trying to use the following code to map multiple pages from a DomU to Dom0, but noticed some weird thing: when I change the content of the first page at Dom0, DomU can see the change, but if I change the content of pages after the first one, DomU cannot see any update. Why? I did check the return value of function direct_remap_area_pages(...), the function should execute succesfully. This function can only map one page a time? I checked the source code, it should be able to map multiple pages, why I got this weird problem? Please help!!! Thanks in advance! CODE: direct_remap_area_pages(&init_mm, VMALLOC_VMADDR(bufmap_vma->addr), mapcmd.bufmap_addr << PAGE_SHIFT, PAGE_SIZE * SVDIF_BUF_PAGES, prot, mapcmd.domid); -x ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Ian Pratt
2005-Feb-10 13:27 UTC
RE: [Xen-devel] direct_remap_area_pages() does not work for multiple pages?
> I am trying to use the following code to map multiple pages > from a DomU to > Dom0, but noticed some weird thing: when I change the content > of the first > page at Dom0, DomU can see the change, but if I change the content of > pages after the first one, DomU cannot see any update. Why? I > did check > the return value of function direct_remap_area_pages(...), > the function > should execute succesfully. This function can only map one > page a time? I > checked the source code, it should be able to map multiple > pages, why I > got this weird problem? Please help!!! Thanks in advance!Probably because the region you''re trying to map is guest pseudo-physical contiguous, but not machine contiguous. Ian> CODE: > direct_remap_area_pages(&init_mm, VMALLOC_VMADDR(bufmap_vma->addr), > mapcmd.bufmap_addr << PAGE_SHIFT, > PAGE_SIZE * SVDIF_BUF_PAGES, prot, mapcmd.domid); > > -x > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from > real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xen-devel >------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Xin Zhao
2005-Feb-10 17:43 UTC
RE: [Xen-devel] direct_remap_area_pages() does not work for multiple pages?
Many Thanks for your kind help! In DomU, I used alloc_pages() to allocate contiguous memory pages, are they machine contiguous? If not, what''s the right way to allocate machine contiguous pages? or what''s the right way to map multiple pages into Dom0? Again, thank you in advance for your help! Xin On Thu, 10 Feb 2005, Ian Pratt wrote:> > > I am trying to use the following code to map multiple pages > > from a DomU to > > Dom0, but noticed some weird thing: when I change the content > > of the first > > page at Dom0, DomU can see the change, but if I change the content of > > pages after the first one, DomU cannot see any update. Why? I > > did check > > the return value of function direct_remap_area_pages(...), > > the function > > should execute succesfully. This function can only map one > > page a time? I > > checked the source code, it should be able to map multiple > > pages, why I > > got this weird problem? Please help!!! Thanks in advance! > > Probably because the region you''re trying to map is guest > pseudo-physical contiguous, but not machine contiguous. > > Ian > > > > CODE: > > direct_remap_area_pages(&init_mm, VMALLOC_VMADDR(bufmap_vma->addr), > > mapcmd.bufmap_addr << PAGE_SHIFT, > > PAGE_SIZE * SVDIF_BUF_PAGES, prot, mapcmd.domid); > > > > -x > > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from > > real users. > > Discover which products truly live up to the hype. Start reading now. > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/xen-devel > > >------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Ian Pratt
2005-Feb-10 20:07 UTC
RE: [Xen-devel] direct_remap_area_pages() does not work for multiple pages?
> In DomU, I used alloc_pages() to allocate contiguous memory pages, > are they machine contiguous? If not, what''s the right way to allocate > machine contiguous pages? or what''s the right way to map > multiple pages > into Dom0?alloc_pages does not guarantee to return machine contiguous pages. As a hack, you could use dma_alloc_coherent. The correct approach is to find out all the mfns that are in use and do multiple direct_remap_area calls as appropriate. In user space, things are rather nicer as you can use the xc_map_foreign_batch. Ian ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel