ia64/xen-unstable

changeset 5484:764d98ff8c26

bitkeeper revision 1.1713.2.5 (42b2f7c3PDbPInUuxxYnJtABejaMCQ)

More hyperprivop stuff
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Fri Jun 17 16:18:11 2005 +0000 (2005-06-17)
parents 7f51ede19020
children 5fc176d2b3a9
files xen/arch/ia64/asm-offsets.c xen/arch/ia64/hyperprivop.S
line diff
     1.1 --- a/xen/arch/ia64/asm-offsets.c	Fri Jun 17 15:39:22 2005 +0000
     1.2 +++ b/xen/arch/ia64/asm-offsets.c	Fri Jun 17 16:18:11 2005 +0000
     1.3 @@ -59,6 +59,7 @@ void foo(void)
     1.4  	DEFINE(XSI_INCOMPL_REG_OFS, offsetof(vcpu_info_t, arch.incomplete_regframe));
     1.5  	DEFINE(XSI_PEND_OFS, offsetof(vcpu_info_t, arch.pending_interruption));
     1.6  	DEFINE(XSI_RR0_OFS, offsetof(vcpu_info_t, arch.rrs[0]));
     1.7 +	DEFINE(XSI_TPR_OFS, offsetof(vcpu_info_t, arch.tpr));
     1.8  	//DEFINE(IA64_TASK_BLOCKED_OFFSET,offsetof (struct task_struct, blocked));
     1.9  	//DEFINE(IA64_TASK_CLEAR_CHILD_TID_OFFSET,offsetof (struct task_struct, clear_child_tid));
    1.10  	//DEFINE(IA64_TASK_GROUP_LEADER_OFFSET, offsetof (struct task_struct, group_leader));
     2.1 --- a/xen/arch/ia64/hyperprivop.S	Fri Jun 17 15:39:22 2005 +0000
     2.2 +++ b/xen/arch/ia64/hyperprivop.S	Fri Jun 17 16:18:11 2005 +0000
     2.3 @@ -69,7 +69,6 @@ 1:	// when we get to here r20=~=interrup
     2.4  	cmp.ne p7,p0=r20,r0
     2.5  (p7)	br.spnt.many dispatch_break_fault ;;
     2.6  
     2.7 -// hard to test, because only called from rbs_switch
     2.8  	// HYPERPRIVOP_COVER?
     2.9  	cmp.eq p7,p6=XEN_HYPER_COVER,r17
    2.10  (p7)	br.sptk.many hyper_cover;;
    2.11 @@ -82,6 +81,14 @@ 1:	// when we get to here r20=~=interrup
    2.12  	cmp.eq p7,p6=XEN_HYPER_RSM_DT,r17
    2.13  (p7)	br.sptk.many hyper_rsm_dt;;
    2.14  
    2.15 +	// HYPERPRIVOP_GET_TPR?
    2.16 +	cmp.eq p7,p6=XEN_HYPER_GET_TPR,r17
    2.17 +(p7)	br.sptk.many hyper_get_tpr;;
    2.18 +
    2.19 +	// HYPERPRIVOP_SET_TPR?
    2.20 +	cmp.eq p7,p6=XEN_HYPER_SET_TPR,r17
    2.21 +(p7)	br.sptk.many hyper_set_tpr;;
    2.22 +
    2.23  	// if not one of the above, give up for now and do it the slow way
    2.24  	br.sptk.many dispatch_break_fault ;;
    2.25  
    2.26 @@ -455,7 +462,6 @@ ENTRY(hyper_cover)
    2.27  	rfi
    2.28  	;;
    2.29  
    2.30 -#if 1
    2.31  // return from metaphysical mode (meta=1) to virtual mode (meta=0)
    2.32  ENTRY(hyper_ssm_dt)
    2.33  #ifdef FAST_HYPERPRIVOP_CNT
    2.34 @@ -526,4 +532,60 @@ 1:	extr.u r26=r24,41,2 ;;
    2.35  	mov pr=r31,-1 ;;
    2.36  	rfi
    2.37  	;;
    2.38 +
    2.39 +ENTRY(hyper_get_tpr)
    2.40 +#ifdef FAST_HYPERPRIVOP_CNT
    2.41 +	movl r20=fast_hyperpriv_cnt+(8*XEN_HYPER_GET_TPR);;
    2.42 +	ld8 r21=[r20];;
    2.43 +	adds r21=1,r21;;
    2.44 +	st8 [r20]=r21;;
    2.45  #endif
    2.46 +	mov r24=cr.ipsr
    2.47 +	mov r25=cr.iip;;
    2.48 +	adds r20=XSI_TPR_OFS-XSI_PSR_IC_OFS,r18 ;;
    2.49 +	ld8 r8=[r20];;
    2.50 +	extr.u r26=r24,41,2 ;;
    2.51 +	cmp.eq p6,p7=2,r26 ;;
    2.52 +(p6)	mov r26=0
    2.53 +(p6)	adds r25=16,r25
    2.54 +(p7)	adds r26=1,r26
    2.55 +	;;
    2.56 +	dep r24=r26,r24,41,2
    2.57 +	;;
    2.58 +	mov cr.ipsr=r24
    2.59 +	mov cr.iip=r25
    2.60 +	mov pr=r31,-1 ;;
    2.61 +	rfi
    2.62 +	;;
    2.63 +END(hyper_get_tpr)
    2.64 +
    2.65 +// if we get to here, there are no interrupts pending so we
    2.66 +// can change virtual tpr to any value without fear of provoking
    2.67 +// (or accidentally missing) delivering an interrupt
    2.68 +ENTRY(hyper_set_tpr)
    2.69 +#ifdef FAST_HYPERPRIVOP_CNT
    2.70 +	movl r20=fast_hyperpriv_cnt+(8*XEN_HYPER_SET_TPR);;
    2.71 +	ld8 r21=[r20];;
    2.72 +	adds r21=1,r21;;
    2.73 +	st8 [r20]=r21;;
    2.74 +#endif
    2.75 +	mov r24=cr.ipsr
    2.76 +	mov r25=cr.iip;;
    2.77 +	movl r27=0xff00;;
    2.78 +	adds r20=XSI_TPR_OFS-XSI_PSR_IC_OFS,r18 ;;
    2.79 +	andcm r8=r8,r27;;
    2.80 +	st8 [r20]=r8;;
    2.81 +	extr.u r26=r24,41,2 ;;
    2.82 +	cmp.eq p6,p7=2,r26 ;;
    2.83 +(p6)	mov r26=0
    2.84 +(p6)	adds r25=16,r25
    2.85 +(p7)	adds r26=1,r26
    2.86 +	;;
    2.87 +	dep r24=r26,r24,41,2
    2.88 +	;;
    2.89 +	mov cr.ipsr=r24
    2.90 +	mov cr.iip=r25
    2.91 +	mov pr=r31,-1 ;;
    2.92 +	rfi
    2.93 +	;;
    2.94 +END(hyper_set_tpr)