From: Keir Fraser Subject: Re: Remapping memory in a HVM DomU from one pfn to another? Date: Mon, 09 Jun 2008 14:11:53 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: James Harper , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 9/6/08 13:52, "James Harper" wrote: > I think I need to do the following: > > 1. Allocate a page of memory from the 'non-paged pool' > 2. Get the pfn of the memory I allocated (src pfn), and the pfn of where > I want to remap the memory to (dst pfn) > 3. Get the mfn(?) of the memory currently mapped to the src pfn > 4. Tell Xen to remap the mfn to the dst pfn > > Can this be done? Any tips on the calls I need to make to do it? From a > quick look through the include files it kind of looks like I could use > XENMEM_translate_gpfn_list to get the mfn from the pfn, but I don't know > if that does what I want to do and I don't know where to go from > there... any suggestions? XENMEM_exchange. Look at 'struct xen_memory_exchange' in xen/include/public/memory.h. Note that GMFN means PFN for an HVM guest. Hopefully it is all self-explanatory enough. -- Keir