[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] How does xc_map_foreign_pages work ?


  • To: "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>
  • From: Sébastien FREMAL [530784] <Sebastien.FREMAL@xxxxxxxxxxx>
  • Date: Tue, 23 Apr 2013 07:33:18 +0000
  • Accept-language: fr-BE, en-US
  • Delivery-date: Tue, 23 Apr 2013 08:16:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac4/aCgF3WcSQhZ7S0igWuyu3dbLlAAi85zE
  • Thread-topic: How does xc_map_foreign_pages work ?

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@xxxxxxxxxxxxx
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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.