ia64/xen-unstable

changeset 10675:446402805fd9

[IA64] Fix MINSTATE_START/END_SAVE_MIN_PHYS for INIT handler

- THIS_CPU(ia64_mca_data) have physcal address of each cpu's ia64_mca_cpu.
I computed address of init_stack by using it.
- from dep r12=-1,r12,61,3; to dep r12=-1,r12,60,4;
to computed xen virtual address.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Thu Jul 06 10:32:26 2006 -0600 (2006-07-06)
parents be1b7896c203
children d6b6d3defe81
files xen/arch/ia64/linux-xen/minstate.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/minstate.h	Thu Jul 06 10:23:34 2006 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/minstate.h	Thu Jul 06 10:32:26 2006 -0600
     1.3 @@ -36,7 +36,31 @@
     1.4   * For mca_asm.S we want to access the stack physically since the state is saved before we
     1.5   * go virtual and don't want to destroy the iip or ipsr.
     1.6   */
     1.7 -#define MINSTATE_START_SAVE_MIN_PHYS								\
     1.8 +#ifdef XEN
     1.9 +# define MINSTATE_START_SAVE_MIN_PHYS								\
    1.10 +(pKStk)	movl r3=THIS_CPU(ia64_mca_data);;							\
    1.11 +(pKStk)	tpa r3 = r3;;										\
    1.12 +(pKStk)	ld8 r3 = [r3];;										\
    1.13 +(pKStk)	addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;;						\
    1.14 +(pKStk)	addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3;						\
    1.15 +(pUStk)	mov ar.rsc=0;		/* set enforced lazy mode, pl 0, little-endian, loadrs=0 */	\
    1.16 +(pUStk)	addl r22=IA64_RBS_OFFSET,r1;		/* compute base of register backing store */	\
    1.17 +	;;											\
    1.18 +(pUStk)	mov r24=ar.rnat;									\
    1.19 +(pUStk)	addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1;   /* compute base of memory stack */	\
    1.20 +(pUStk)	mov r23=ar.bspstore;				/* save ar.bspstore */			\
    1.21 +(pUStk)	dep r22=-1,r22,60,4;			/* compute Xen virtual addr of RBS */	\
    1.22 +	;;											\
    1.23 +(pUStk)	mov ar.bspstore=r22;			/* switch to Xen RBS */			\
    1.24 +	;;											\
    1.25 +(pUStk)	mov r18=ar.bsp;										\
    1.26 +(pUStk)	mov ar.rsc=0x3;	 /* set eager mode, pl 0, little-endian, loadrs=0 */			\
    1.27 +
    1.28 +# define MINSTATE_END_SAVE_MIN_PHYS								\
    1.29 +	dep r12=-1,r12,60,4;	    /* make sp a Xen virtual address */			\
    1.30 +	;;
    1.31 +#else
    1.32 +# define MINSTATE_START_SAVE_MIN_PHYS								\
    1.33  (pKStk) mov r3=IA64_KR(PER_CPU_DATA);;								\
    1.34  (pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;;							\
    1.35  (pKStk) ld8 r3 = [r3];;										\
    1.36 @@ -55,9 +79,10 @@
    1.37  (pUStk)	mov r18=ar.bsp;										\
    1.38  (pUStk)	mov ar.rsc=0x3;		/* set eager mode, pl 0, little-endian, loadrs=0 */		\
    1.39  
    1.40 -#define MINSTATE_END_SAVE_MIN_PHYS								\
    1.41 +# define MINSTATE_END_SAVE_MIN_PHYS								\
    1.42  	dep r12=-1,r12,61,3;		/* make sp a kernel virtual address */			\
    1.43  	;;
    1.44 +#endif /* XEN */
    1.45  
    1.46  #ifdef MINSTATE_VIRT
    1.47  #ifdef XEN