ia64/xen-unstable

changeset 17600:debc868e380b

[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@jp.fujitsu.com>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri May 09 18:40:58 2008 +0900 (2008-05-09)
parents 948188bc9fa3
children 6df8dcf48d9d
files xen/arch/ia64/linux-xen/entry.S xen/arch/ia64/vmx/vmx_init.c
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/entry.S	Fri May 09 18:40:58 2008 +0900
     1.2 +++ b/xen/arch/ia64/linux-xen/entry.S	Fri May 09 18:40:58 2008 +0900
     1.3 @@ -651,13 +651,37 @@ GLOBAL_ENTRY(ia64_ret_from_clone)
     1.4  #ifdef XEN
     1.5  	// new domains are cloned but not exec'ed so switch to user mode here
     1.6  	cmp.ne pKStk,pUStk=r0,r0
     1.7 -    adds r16 = IA64_VCPU_FLAGS_OFFSET, r13
     1.8 -    ;;
     1.9 -    ld8 r16 = [r16]
    1.10 -    ;;
    1.11 -    cmp.ne p6,p7 = r16, r0
    1.12 - (p6) br.cond.spnt ia64_leave_hypervisor	/* VTi */
    1.13 - (p7) br.cond.spnt ia64_leave_kernel		/* !VTi */
    1.14 +	adds r16 = IA64_VCPU_FLAGS_OFFSET, r13
    1.15 +	;;
    1.16 +	ld8 r16 = [r16]				// arch.arch_vmx.flags
    1.17 +	;;
    1.18 +	cmp.eq p6,p0 = r16, r0
    1.19 +(p6)	br.cond.spnt ia64_leave_kernel		// !VMX_DOMAIN
    1.20 +	;;
    1.21 +	adds r16 = PT(CR_IFS)+16, r12
    1.22 +	;;
    1.23 +	ld8 r16 = [r16]
    1.24 +	cmp.eq pNonSys,pSys=r0,r0		// pSys=0,pNonSys=1
    1.25 +	;;
    1.26 +	cmp.eq p6,p7 = 0x6, r16
    1.27 +(p7)	br.cond.sptk ia64_leave_hypervisor	// VMX_DOMAIN
    1.28 +	;;
    1.29 +	/*
    1.30 +	 * cr.ifs.v==0 && cr.ifm(ar.pfm)==6 means that HYPERVISOR_suspend
    1.31 +	 * has been called. (i.e. HVM with PV driver is restored here)
    1.32 +	 * We need to allocate a dummy RSE stack frame to resume.
    1.33 +	 */
    1.34 +	alloc r32=ar.pfs, 0, 0, 6, 0
    1.35 +	cmp.eq pSys,pNonSys=r0,r0		// pSys=1,pNonSys=0
    1.36 +	;;
    1.37 +	bsw.0
    1.38 +	;;
    1.39 +	mov r21=r13				// set current
    1.40 +	;;
    1.41 +	bsw.1
    1.42 +	;;
    1.43 +	mov r8=r0
    1.44 +	br.cond.sptk.many ia64_leave_hypercall
    1.45  #else
    1.46  .ret8:
    1.47  	adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
     2.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Fri May 09 18:40:58 2008 +0900
     2.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Fri May 09 18:40:58 2008 +0900
     2.3 @@ -55,7 +55,6 @@
     2.4  #include <asm/vhpt.h>
     2.5  #include <asm/vmx_pal_vsa.h>
     2.6  #include <asm/patch.h>
     2.7 -#include "entry.h"
     2.8  
     2.9  /* Global flag to identify whether Intel vmx feature is on */
    2.10  u32 vmx_enabled = 0;
    2.11 @@ -532,10 +531,6 @@ vmx_final_setup_guest(struct vcpu *v)
    2.12  	/* Set up guest 's indicator for VTi domain*/
    2.13  	set_bit(ARCH_VMX_DOMAIN, &v->arch.arch_vmx.flags);
    2.14  
    2.15 -	/* Initialize pNonSys=1 for the first context switching */
    2.16 -	sw = (struct switch_stack *)vcpu_regs(v) - 1;
    2.17 -	sw->pr = (1UL << PRED_NON_SYSCALL);
    2.18 -
    2.19  	return 0;
    2.20  }
    2.21