ia64/xen-unstable

changeset 16169:d261b2d5e988

[IA64] vti domain save/restore: clean up vti break fault handler

It isn't necessary to set pUStk and pKStk like other VTi fault handlers.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Sun Oct 21 13:38:05 2007 -0600 (2007-10-21)
parents 328dcc446f9e
children ff1f49f62204
files xen/arch/ia64/linux-xen/unwind.c xen/arch/ia64/vmx/vmx_entry.S xen/arch/ia64/vmx/vmx_ivt.S
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/unwind.c	Sun Oct 21 12:10:25 2007 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/unwind.c	Sun Oct 21 13:38:05 2007 -0600
     1.3 @@ -2006,17 +2006,18 @@ unw_unwind_to_user (struct unw_frame_inf
     1.4  				   __FUNCTION__);
     1.5  			break;
     1.6  		}
     1.7 +#ifndef XEN
     1.8  		if (unw_is_intr_frame(info) &&
     1.9  		    (pr & (1UL << PRED_USER_STACK)))
    1.10  			return 0;
    1.11 -#ifdef XEN
    1.12 +#else
    1.13 +		if (unw_is_intr_frame(info) &&
    1.14 +		    !info->task->domain->arch.is_vti &&
    1.15 +		    (pr & (1UL << PRED_USER_STACK)))
    1.16 +			return 0;
    1.17  		/*
    1.18 -		 * vmx fault handlers don't always update vcpu->on_stack
    1.19 -		 * so that the above (pr & (1UL << PRED_USER_STACK)) condition
    1.20 -		 * isn't always true.
    1.21 -		 * hypercall path of break_fault does set pUStk=1,
    1.22 -		 * other fault paths don't set.
    1.23 -		 *
    1.24 +		 * vmx fault handlers don't vcpu->on_stack and keep
    1.25 +		 * (pr & (1UL << PRED_USER_STACK)) condition untouched.
    1.26  		 * we need to stop unwinding somehow.
    1.27  		 */
    1.28  		if (unw_is_intr_frame(info) &&
     2.1 --- a/xen/arch/ia64/vmx/vmx_entry.S	Sun Oct 21 12:10:25 2007 -0600
     2.2 +++ b/xen/arch/ia64/vmx/vmx_entry.S	Sun Oct 21 13:38:05 2007 -0600
     2.3 @@ -472,9 +472,10 @@ GLOBAL_ENTRY(ia64_leave_hypercall)
     2.4      ;;
     2.5      st8 [r16]=r8
     2.6      ;;
     2.7 -(pUStk) rsm psr.i
     2.8 +//(pUStk) rsm psr.i
     2.9 +    rsm psr.i
    2.10      cmp.eq pLvSys,p0=r0,r0		// pLvSys=1: leave from syscall
    2.11 -(pUStk) cmp.eq.unc p6,p0=r0,r0		// p6 <- pUStk
    2.12 +//(pUStk) cmp.eq.unc p6,p0=r0,r0		// p6 <- pUStk
    2.13      ;;
    2.14      br.call.sptk.many b0=leave_hypervisor_tail
    2.15  .work_processed_syscall:
    2.16 @@ -544,7 +545,7 @@ GLOBAL_ENTRY(ia64_leave_hypercall)
    2.17  //(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
    2.18      ;;
    2.19      ld8 r27=[r2],PT(B0)-PT(AR_PFS)	// M0|1 load ar.pfs
    2.20 -(pKStk) mov r22=psr			// M2   read PSR now that interrupts are disabled
    2.21 +//(pKStk) mov r22=psr			// M2   read PSR now that interrupts are disabled
    2.22      nop 0
    2.23      ;;
    2.24      ld8 r22=[r2],PT(AR_RNAT)-PT(B0) // M0|1 load b0
     3.1 --- a/xen/arch/ia64/vmx/vmx_ivt.S	Sun Oct 21 12:10:25 2007 -0600
     3.2 +++ b/xen/arch/ia64/vmx/vmx_ivt.S	Sun Oct 21 13:38:05 2007 -0600
     3.3 @@ -577,12 +577,13 @@ ENTRY(vmx_break_fault)
     3.4  ///////////////////////////////////////////////////////////////////////
     3.5  //    st1 [r16]=r0				// M2|3 clear current->thread.on_ustack flag
     3.6      mov b6=r30				// I0   setup syscall handler branch reg early
     3.7 -    cmp.ne pKStk,pUStk=r0,r0		// A    were we on kernel stacks already?
     3.8 +//    cmp.ne pKStk,pUStk=r0,r0		// A    were we on kernel stacks already?
     3.9  
    3.10  //  and r9=_TIF_SYSCALL_TRACEAUDIT,r9	// A    mask trace or audit
    3.11      mov r18=ar.bsp				// M2 (12 cyc)
    3.12     ;;
    3.13 -(pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1 // A    compute base of memory stack
    3.14 +//(pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1 // A    compute base of memory stack
    3.15 +    addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1 // A    compute base of memory stack
    3.16  //  cmp.eq p14,p0=r9,r0			// A    are syscalls being traced/audited?
    3.17  //    br.call.sptk.many b7=ia64_syscall_setup	// B
    3.18      br.call.sptk.many b7=ia64_hypercall_setup	// B
    3.19 @@ -839,7 +840,7 @@ GLOBAL_ENTRY(ia64_hypercall_setup)
    3.20  
    3.21      st8.spill [r17]=r11,PT(CR_IIP)-PT(R11)	// save r11
    3.22      tnat.nz p9,p0=in1
    3.23 -(pKStk) mov r18=r0				// make sure r18 isn't NaT
    3.24 +//(pKStk) mov r18=r0				// make sure r18 isn't NaT
    3.25      ;;
    3.26  
    3.27      st8 [r16]=r26,PT(CR_IFS)-PT(AR_PFS)	// save ar.pfs
    3.28 @@ -861,20 +862,23 @@ GLOBAL_ENTRY(ia64_hypercall_setup)
    3.29  (p9)    mov in1=-1
    3.30      ;;
    3.31  
    3.32 -(pUStk) sub r18=r18,r22				// r18=RSE.ndirty*8
    3.33 +//(pUStk) sub r18=r18,r22				// r18=RSE.ndirty*8
    3.34 +    sub r18=r18,r22				// r18=RSE.ndirty*8
    3.35      tnat.nz p10,p0=in2
    3.36      add r11=8,r11
    3.37      ;;
    3.38 -(pKStk) adds r16=PT(PR)-PT(AR_RNAT),r16		// skip over ar_rnat field
    3.39 -(pKStk) adds r17=PT(B0)-PT(AR_BSPSTORE),r17	// skip over ar_bspstore field
    3.40 +//(pKStk) adds r16=PT(PR)-PT(AR_RNAT),r16		// skip over ar_rnat field
    3.41 +//(pKStk) adds r17=PT(B0)-PT(AR_BSPSTORE),r17	// skip over ar_bspstore field
    3.42      tnat.nz p11,p0=in3
    3.43      ;;
    3.44  (p10)   mov in2=-1
    3.45      tnat.nz p12,p0=in4				// [I0]
    3.46  (p11)   mov in3=-1
    3.47      ;;
    3.48 -(pUStk) st8 [r16]=r24,PT(PR)-PT(AR_RNAT)	// save ar.rnat
    3.49 -(pUStk) st8 [r17]=r23,PT(B0)-PT(AR_BSPSTORE)	// save ar.bspstore
    3.50 +//(pUStk) st8 [r16]=r24,PT(PR)-PT(AR_RNAT)	// save ar.rnat
    3.51 +    st8 [r16]=r24,PT(PR)-PT(AR_RNAT)	// save ar.rnat
    3.52 +//(pUStk) st8 [r17]=r23,PT(B0)-PT(AR_BSPSTORE)	// save ar.bspstore
    3.53 +    st8 [r17]=r23,PT(B0)-PT(AR_BSPSTORE)	// save ar.bspstore	
    3.54      shl r18=r18,16				// compute ar.rsc to be used for "loadrs"
    3.55      ;;
    3.56      st8 [r16]=r31,PT(LOADRS)-PT(PR)		// save predicates