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

[Xen-changelog] [xen-unstable] [IA64] fix restoring HVM domain with PV driver



# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1210326058 -32400
# Node ID debc868e380b4fe40d50772b6e09cd96ba88d085
# Parent  948188bc9fa3f22c13b8bd98e4daccdd11b9e99c
[IA64] fix restoring HVM domain with PV driver

The HVM domain with PV driver always panics after save/restore or
migration. This patch fixes it.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
---
 xen/arch/ia64/linux-xen/entry.S |   38 +++++++++++++++++++++++++++++++-------
 xen/arch/ia64/vmx/vmx_init.c    |    5 -----
 2 files changed, 31 insertions(+), 12 deletions(-)

diff -r 948188bc9fa3 -r debc868e380b xen/arch/ia64/linux-xen/entry.S
--- a/xen/arch/ia64/linux-xen/entry.S   Fri May 09 18:40:58 2008 +0900
+++ b/xen/arch/ia64/linux-xen/entry.S   Fri May 09 18:40:58 2008 +0900
@@ -651,13 +651,37 @@ GLOBAL_ENTRY(ia64_ret_from_clone)
 #ifdef XEN
        // new domains are cloned but not exec'ed so switch to user mode here
        cmp.ne pKStk,pUStk=r0,r0
-    adds r16 = IA64_VCPU_FLAGS_OFFSET, r13
-    ;;
-    ld8 r16 = [r16]
-    ;;
-    cmp.ne p6,p7 = r16, r0
- (p6) br.cond.spnt ia64_leave_hypervisor       /* VTi */
- (p7) br.cond.spnt ia64_leave_kernel           /* !VTi */
+       adds r16 = IA64_VCPU_FLAGS_OFFSET, r13
+       ;;
+       ld8 r16 = [r16]                         // arch.arch_vmx.flags
+       ;;
+       cmp.eq p6,p0 = r16, r0
+(p6)   br.cond.spnt ia64_leave_kernel          // !VMX_DOMAIN
+       ;;
+       adds r16 = PT(CR_IFS)+16, r12
+       ;;
+       ld8 r16 = [r16]
+       cmp.eq pNonSys,pSys=r0,r0               // pSys=0,pNonSys=1
+       ;;
+       cmp.eq p6,p7 = 0x6, r16
+(p7)   br.cond.sptk ia64_leave_hypervisor      // VMX_DOMAIN
+       ;;
+       /*
+        * cr.ifs.v==0 && cr.ifm(ar.pfm)==6 means that HYPERVISOR_suspend
+        * has been called. (i.e. HVM with PV driver is restored here)
+        * We need to allocate a dummy RSE stack frame to resume.
+        */
+       alloc r32=ar.pfs, 0, 0, 6, 0
+       cmp.eq pSys,pNonSys=r0,r0               // pSys=1,pNonSys=0
+       ;;
+       bsw.0
+       ;;
+       mov r21=r13                             // set current
+       ;;
+       bsw.1
+       ;;
+       mov r8=r0
+       br.cond.sptk.many ia64_leave_hypercall
 #else
 .ret8:
        adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
diff -r 948188bc9fa3 -r debc868e380b xen/arch/ia64/vmx/vmx_init.c
--- a/xen/arch/ia64/vmx/vmx_init.c      Fri May 09 18:40:58 2008 +0900
+++ b/xen/arch/ia64/vmx/vmx_init.c      Fri May 09 18:40:58 2008 +0900
@@ -55,7 +55,6 @@
 #include <asm/vhpt.h>
 #include <asm/vmx_pal_vsa.h>
 #include <asm/patch.h>
-#include "entry.h"
 
 /* Global flag to identify whether Intel vmx feature is on */
 u32 vmx_enabled = 0;
@@ -532,10 +531,6 @@ vmx_final_setup_guest(struct vcpu *v)
        /* Set up guest 's indicator for VTi domain*/
        set_bit(ARCH_VMX_DOMAIN, &v->arch.arch_vmx.flags);
 
-       /* Initialize pNonSys=1 for the first context switching */
-       sw = (struct switch_stack *)vcpu_regs(v) - 1;
-       sw->pr = (1UL << PRED_NON_SYSCALL);
-
        return 0;
 }
 

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