WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] fix restoring HVM domain with PV driver

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] fix restoring HVM domain with PV driver
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 9 May 2008 17:10:14 +0900
Delivery-date: Fri, 09 May 2008 01:10:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
The HVM domain with PV driver always panics after save/restore or
migration. This patch fixes it.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r f2457c7aff8d xen/arch/ia64/linux-xen/entry.S
--- a/xen/arch/ia64/linux-xen/entry.S   Fri Apr 25 20:13:52 2008 +0900
+++ b/xen/arch/ia64/linux-xen/entry.S   Thu May 08 19:25:17 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 f2457c7aff8d xen/arch/ia64/vmx/vmx_init.c
--- a/xen/arch/ia64/vmx/vmx_init.c      Fri Apr 25 20:13:52 2008 +0900
+++ b/xen/arch/ia64/vmx/vmx_init.c      Fri May 09 17:05:13 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-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>