WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Remapping memory in a HVM DomU from one pfn to another?

To: James Harper <james.harper@xxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Remapping memory in a HVM DomU from one pfn to another?
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Mon, 09 Jun 2008 14:11:53 +0100
Delivery-date: Mon, 09 Jun 2008 06:12:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D013DCD6A@trantor>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjKL7zJukTKL6OfRRmjF/we8x04QQAAqW7t
Thread-topic: [Xen-devel] Remapping memory in a HVM DomU from one pfn to another?
User-agent: Microsoft-Entourage/11.4.0.080122
On 9/6/08 13:52, "James Harper" <james.harper@xxxxxxxxxxxxxxxx> 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



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel