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

[Xen-changelog] Properly return extents for hypervisor memory ops call



# HG changeset patch
# User djm@xxxxxxxxxxxxxxx
# Node ID 8e7df3b10d85bd78b81d6dba78631cbeb288a893
# Parent  55bc6698c889e8b9b2c85269f142821088cab2ea
Properly return extents for hypervisor memory ops call
Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>

diff -r 55bc6698c889 -r 8e7df3b10d85 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Thu Sep 15 00:00:23 2005
+++ b/xen/arch/ia64/xen/hypercall.c     Thu Sep 15 16:53:34 2005
@@ -14,6 +14,7 @@
 
 #include <asm/vcpu.h>
 #include <asm/dom_fw.h>
+#include <public/memory.h>
 
 extern unsigned long translate_domain_mpaddr(unsigned long);
 extern struct ia64_pal_retval xen_pal_emulator(UINT64,UINT64,UINT64,UINT64);
@@ -152,9 +153,25 @@
                break;
 
            case __HYPERVISOR_memory_op:
-               //regs->r8 = do_dom_mem_op(regs->r14, regs->r15, regs->r16, 
regs->r17, regs->r18); 
                /* we don't handle reservations; just return success */
-               regs->r8 = regs->r16;
+               {
+                   struct xen_memory_reservation reservation;
+                   void *arg = regs->r15;
+
+                   switch(regs->r14) {
+                   case XENMEM_increase_reservation:
+                   case XENMEM_decrease_reservation:
+                       if (copy_from_user(&reservation, arg,
+                               sizeof(reservation)))
+                           regs->r8 = -EFAULT;
+                       else
+                           regs->r8 = reservation.nr_extents;
+                       break;
+                   default:
+                       regs->r8 = do_memory_op(regs->r14, regs->r15);
+                       break;
+                   }
+               }
                break;
 
            case __HYPERVISOR_event_channel_op:

_______________________________________________
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®.