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

[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: Mon, 22 Apr 2013 14:46:22 +0000
  • Accept-language: fr-BE, en-US
  • Delivery-date: Tue, 23 Apr 2013 08:16:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac4/aCgF3WcSQhZ7S0igWuyu3dbLlA==
  • Thread-topic: How does xc_map_foreign_pages work ?


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 

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



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