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>
Subject: Re: [Xen-devel] Remapping memory in a HVM DomU from one pfn to another?
From: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Date: Tue, 10 Jun 2008 08:36:16 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Tue, 10 Jun 2008 05:36:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D013DCDAC@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>
References: <AEC6C66638C05B468B556EA548C1A77D013DCD6A@trantor> <C472EAA9.21C71%keir.fraser@xxxxxxxxxxxxx> <AEC6C66638C05B468B556EA548C1A77D013DCDAC@trantor>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
I was just looking into this codepath yesterday, for ballooning down a guest running in compat mode.

My analysis was that this functionality seems to be currently missing in both 3.2 xen and
xen-unstable(3.3)

The following functions:

do_memory_op_compat32 (3.2)
hvm_memory_op_compat32 (3.3)

seem to be missing the "XENMEM_decrease_reservation" and
"XENMEM_increase_reservation" functionality while running in compat mode.
Similarly, for your codepath - it would appear it is also missing XENMEM_exchange for you...

This will default to returning ENOSYS to hvm.c, and eventually bubble our way
up to

linux/drivers/xen/balloon/balloon.c :: decrease_reservation
Where it checks the following after the memory op, and crashes the guest
kernel:
BUG_ON(ret != nr_pages);


So - for now - unless I'm misunderstanding something here...both you & I appear to be SOL.




James Harper wrote on 06/10/2008 08:02 AM:
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.

    

I tried it and 'xm dmesg' says:

(XEN) hvm.c:747:d11 memory_op 11.

And looking in hvm.c, it appears that this occurs in
do_memory_op_compat32(...) and the only supported memory_op function is
XENMEM_add_to_physmap. Does that mean I'm out of luck?

James

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