[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] Fix xencomm for xm mem-set command



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID fe543184f7f9d4c54a38525d7584950cee27d73e
# Parent  169687dab774a442b51a2175cbbdbe2a13b433d4
[IA64] Fix xencomm for xm mem-set command

This patch saves and restores the hypercall parameter within xencomm.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c |   34 ++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff -r 169687dab774 -r fe543184f7f9 
linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c   Mon Nov 13 11:02:37 
2006 -0700
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c   Mon Nov 13 11:24:30 
2006 -0700
@@ -221,10 +221,17 @@ int
 int
 xencomm_hypercall_memory_op(unsigned int cmd, void *arg)
 {
+       XEN_GUEST_HANDLE(xen_pfn_t) extent_start_va[2];
+       xen_memory_reservation_t *xmr = NULL, *xme_in = NULL, *xme_out = NULL;
+       int rc;
+
        switch (cmd) {
        case XENMEM_increase_reservation:
        case XENMEM_decrease_reservation:
        case XENMEM_populate_physmap:
+               xmr = (xen_memory_reservation_t *)arg;
+               xen_guest_handle(extent_start_va[0]) =
+                       xen_guest_handle(xmr->extent_start);
                xencommize_memory_reservation((xen_memory_reservation_t *)arg);
                break;
                
@@ -232,6 +239,12 @@ xencomm_hypercall_memory_op(unsigned int
                break;
 
        case XENMEM_exchange:
+               xme_in  = &((xen_memory_exchange_t *)arg)->in;
+               xme_out = &((xen_memory_exchange_t *)arg)->out;
+               xen_guest_handle(extent_start_va[0]) =
+                       xen_guest_handle(xme_in->extent_start);
+               xen_guest_handle(extent_start_va[1]) =
+                       xen_guest_handle(xme_out->extent_start);
                xencommize_memory_reservation
                        (&((xen_memory_exchange_t *)arg)->in);
                xencommize_memory_reservation
@@ -243,8 +256,25 @@ xencomm_hypercall_memory_op(unsigned int
                return -ENOSYS;
        }
 
-       return xencomm_arch_hypercall_memory_op
-               (cmd, xencomm_create_inline(arg));
+       rc =  xencomm_arch_hypercall_memory_op(cmd, xencomm_create_inline(arg));
+
+       switch (cmd) {
+       case XENMEM_increase_reservation:
+       case XENMEM_decrease_reservation:
+       case XENMEM_populate_physmap:
+               xen_guest_handle(xmr->extent_start) =
+                       xen_guest_handle(extent_start_va[0]);
+               break;
+
+       case XENMEM_exchange:
+               xen_guest_handle(xme_in->extent_start) =
+                       xen_guest_handle(extent_start_va[0]);
+               xen_guest_handle(xme_out->extent_start) =
+                       xen_guest_handle(extent_start_va[1]);
+               break;
+       }
+
+       return rc;
 }
 
 unsigned long

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.