Hello,
I found how to solve the problem. The header of the function (void
*xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot, const xen_pfn_t
*arr, int num );) seems to indicate the use of the PFN to identify the page to
map but it works when we use the MFN.
Best regards,
Sebastien Fremal
________________________________________
De : Sébastien FREMAL [530784]
Envoyé : lundi 22 avril 2013 16:46
À : xen-devel@lists.xen.org
Objet : How does xc_map_foreign_pages work ?
Hello,
I''m trying to map a page from domU''s in dom0. I successfully
mapped it with its MFN thanks to xc_map_foreign_range(), but I don''t
find how to map it with xc_map_foreign_pages().
In a domU, I call these functions to get the PFN and the MFN of a page :
op.pfn = page_to_pfn(page);
op.mfn = pfn_to_mfn(op.pfn);
In the dom0, I call these functions to map the page :
addr = xc_map_foreign_pages(xci, domid, PROT_READ|PROT_WRITE, &page, 1);
addr = xc_map_foreign_range(xci, domid, 1, PROT_READ|PROT_WRITE, mfn);
The variable "mfn" contains the value of "op.mfn" and the
variable "page" contains the value of "op.pfn". When I use
map_foreign_range, the mapping works fine, but not when I use map_foreign_pages.
Does someone know where is my error and how to correct it please ?
Best regards,
Sebastien Fremal