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

[Xen-changelog] Add hypercall continuation support, or else dom_mem_op may fail.



# HG changeset patch
# User fred@xxxxxxxxxxxxxxxxxxxxx
# Node ID b6803bdaa95ae98b0a5be63b28788f78b2b32072
# Parent  7e5868cb1b915a3f0788191d3b2806bcebac54de
Add hypercall continuation support, or else dom_mem_op may fail.

Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>

diff -r 7e5868cb1b91 -r b6803bdaa95a xen/arch/ia64/vmx_hypercall.c
--- a/xen/arch/ia64/vmx_hypercall.c     Tue Aug  2 10:08:00 2005
+++ b/xen/arch/ia64/vmx_hypercall.c     Tue Aug  2 10:09:24 2005
@@ -29,6 +29,7 @@
 #include <asm/regionreg.h>
 #include <asm/page.h>
 #include <xen/mm.h>
+#include <xen/multicall.h>
 
 
 void hyper_not_support(void)
@@ -49,6 +50,42 @@
     ret=do_mmu_update((mmu_update_t*)r32,r33,r34,r35);
     vmx_vcpu_set_gr(vcpu, 8, ret, 0);
     vmx_vcpu_increment_iip(vcpu);
+}
+
+unsigned long __hypercall_create_continuation(
+    unsigned int op, unsigned int nr_args, ...)
+{
+    struct mc_state *mcs = &mc_state[smp_processor_id()];
+    VCPU *vcpu = current;
+    struct cpu_user_regs *regs = vcpu_regs(vcpu);
+    unsigned int i;
+    va_list args;
+
+    va_start(args, nr_args);
+    if ( test_bit(_MCSF_in_multicall, &mcs->flags) ) {
+       panic("PREEMPT happen in multicall\n"); // Not support yet
+    } else {
+       vmx_vcpu_set_gr(vcpu, 15, op, 0);
+       for ( i = 0; i < nr_args; i++) {
+           switch (i) {
+           case 0: vmx_vcpu_set_gr(vcpu, 16, va_arg(args, unsigned long), 0);
+                   break;
+           case 1: vmx_vcpu_set_gr(vcpu, 17, va_arg(args, unsigned long), 0);
+                   break;
+           case 2: vmx_vcpu_set_gr(vcpu, 18, va_arg(args, unsigned long), 0);
+                   break;
+           case 3: vmx_vcpu_set_gr(vcpu, 19, va_arg(args, unsigned long), 0);
+                   break;
+           case 4: vmx_vcpu_set_gr(vcpu, 20, va_arg(args, unsigned long), 0);
+                   break;
+           default: panic("Too many args for hypercall continuation\n");
+                   break;
+           }
+       }
+    }
+    vcpu->arch.hypercall_continuation = 1;
+    va_end(args);
+    return op;
 }
 
 void hyper_dom_mem_op(void)
@@ -65,7 +102,13 @@
     printf("do_dom_mem return value: %lx\n", ret);
     vmx_vcpu_set_gr(vcpu, 8, ret, 0);
 
-    vmx_vcpu_increment_iip(vcpu);
+    /* Hard to define a special return value to indicate hypercall restart.
+     * So just add a new mark, which is SMP safe
+     */
+    if (vcpu->arch.hypercall_continuation == 1)
+       vcpu->arch.hypercall_continuation = 0;
+    else
+       vmx_vcpu_increment_iip(vcpu);
 }
 
 
diff -r 7e5868cb1b91 -r b6803bdaa95a xen/arch/ia64/xenmisc.c
--- a/xen/arch/ia64/xenmisc.c   Tue Aug  2 10:08:00 2005
+++ b/xen/arch/ia64/xenmisc.c   Tue Aug  2 10:09:24 2005
@@ -103,11 +103,13 @@
 }
 #endif
 
+#ifndef CONFIG_VTI
 unsigned long __hypercall_create_continuation(
        unsigned int op, unsigned int nr_args, ...)
 {
        printf("__hypercall_create_continuation: not implemented!!!\n");
 }
+#endif
 
 ///////////////////////////////
 
diff -r 7e5868cb1b91 -r b6803bdaa95a xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Tue Aug  2 10:08:00 2005
+++ b/xen/include/asm-ia64/domain.h     Tue Aug  2 10:09:24 2005
@@ -88,6 +88,7 @@
     thash_cb_t *vtlb;
     char irq_new_pending;
     char irq_new_condition;    // vpsr.i/vtpr change, check for pending VHPI
+    char hypercall_continuation;
     //for phycial  emulation
     unsigned long old_rsc;
     int mode_flags;

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