From: Ian Campbell Subject: Re: [RFC PATCH 3/8]: PVH: memory manager and paging related changes Date: Fri, 14 Sep 2012 17:20:28 +0100 Message-ID: <1347639628.14977.12.camel@zakaz.uk.xensource.com> References: <20120815180250.1e068d10@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120815180250.1e068d10@mantra.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor Cc: "Xen-devel@lists.xensource.com" , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Thu, 2012-08-16 at 02:02 +0100, Mukesh Rathor wrote: > > +/* Map foreign gmfn, fgmfn, to local pfn, lpfn. This for the user > space > + * creating new guest on PVH dom0 and needs to map domU pages. Called > from > + * exported function, so no need to export this. > + */ > +static int pvh_add_to_xen_p2m(unsigned long lpfn, unsigned long > fgmfn, > + unsigned int domid) > +{ > + int rc; > + struct xen_add_to_physmap pmb = {.foreign_domid = domid}; > + > + pmb.gpfn = lpfn; > + pmb.idx = fgmfn; > + pmb.space = XENMAPSPACE_gmfn_foreign; You've not initialised pmb.domid here. I think you want/need to set it to DOMID_SELF and have the h/v side behave accordingly. > + rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap, &pmb);