From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Guthro Subject: Re: Remapping memory in a HVM DomU from one pfn to another? Date: Tue, 10 Jun 2008 08:36:16 -0400 Message-ID: <484E7540.9020707@virtualiron.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0542527750==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: James Harper Cc: xen-devel@lists.xensource.com, Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============0542527750== Content-Type: multipart/alternative; boundary="------------070401040207000907070305" This is a multi-part message in MIME format. --------------070401040207000907070305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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@lists.xensource.com > http://lists.xensource.com/xen-devel > --------------070401040207000907070305 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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@lists.xensource.com
http://lists.xensource.com/xen-devel
  
--------------070401040207000907070305-- --===============0542527750== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0542527750==--