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-changelog

[Xen-changelog] More hyperprivop stuff

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] More hyperprivop stuff
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Fri, 17 Jun 2005 16:18:11 +0000
Cc: james@xxxxxxxxxxxxx
Delivery-date: Thu, 23 Jun 2005 11:02:04 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1713.2.5, 2005/06/17 10:18:11-06:00, djm@xxxxxxxxxxxxxxx

        More hyperprivop stuff
        Signed-off-by: Dan Magenheimer <dan.magenheimer@xxxxxx>



 asm-offsets.c |    1 
 hyperprivop.S |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 65 insertions(+), 2 deletions(-)


diff -Nru a/xen/arch/ia64/asm-offsets.c b/xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c       2005-06-23 07:03:15 -04:00
+++ b/xen/arch/ia64/asm-offsets.c       2005-06-23 07:03:15 -04:00
@@ -59,6 +59,7 @@
        DEFINE(XSI_INCOMPL_REG_OFS, offsetof(vcpu_info_t, 
arch.incomplete_regframe));
        DEFINE(XSI_PEND_OFS, offsetof(vcpu_info_t, arch.pending_interruption));
        DEFINE(XSI_RR0_OFS, offsetof(vcpu_info_t, arch.rrs[0]));
+       DEFINE(XSI_TPR_OFS, offsetof(vcpu_info_t, arch.tpr));
        //DEFINE(IA64_TASK_BLOCKED_OFFSET,offsetof (struct task_struct, 
blocked));
        //DEFINE(IA64_TASK_CLEAR_CHILD_TID_OFFSET,offsetof (struct task_struct, 
clear_child_tid));
        //DEFINE(IA64_TASK_GROUP_LEADER_OFFSET, offsetof (struct task_struct, 
group_leader));
diff -Nru a/xen/arch/ia64/hyperprivop.S b/xen/arch/ia64/hyperprivop.S
--- a/xen/arch/ia64/hyperprivop.S       2005-06-23 07:03:15 -04:00
+++ b/xen/arch/ia64/hyperprivop.S       2005-06-23 07:03:15 -04:00
@@ -69,7 +69,6 @@
        cmp.ne p7,p0=r20,r0
 (p7)   br.spnt.many dispatch_break_fault ;;
 
-// hard to test, because only called from rbs_switch
        // HYPERPRIVOP_COVER?
        cmp.eq p7,p6=XEN_HYPER_COVER,r17
 (p7)   br.sptk.many hyper_cover;;
@@ -82,6 +81,14 @@
        cmp.eq p7,p6=XEN_HYPER_RSM_DT,r17
 (p7)   br.sptk.many hyper_rsm_dt;;
 
+       // HYPERPRIVOP_GET_TPR?
+       cmp.eq p7,p6=XEN_HYPER_GET_TPR,r17
+(p7)   br.sptk.many hyper_get_tpr;;
+
+       // HYPERPRIVOP_SET_TPR?
+       cmp.eq p7,p6=XEN_HYPER_SET_TPR,r17
+(p7)   br.sptk.many hyper_set_tpr;;
+
        // if not one of the above, give up for now and do it the slow way
        br.sptk.many dispatch_break_fault ;;
 
@@ -455,7 +462,6 @@
        rfi
        ;;
 
-#if 1
 // return from metaphysical mode (meta=1) to virtual mode (meta=0)
 ENTRY(hyper_ssm_dt)
 #ifdef FAST_HYPERPRIVOP_CNT
@@ -526,4 +532,60 @@
        mov pr=r31,-1 ;;
        rfi
        ;;
+
+ENTRY(hyper_get_tpr)
+#ifdef FAST_HYPERPRIVOP_CNT
+       movl r20=fast_hyperpriv_cnt+(8*XEN_HYPER_GET_TPR);;
+       ld8 r21=[r20];;
+       adds r21=1,r21;;
+       st8 [r20]=r21;;
+#endif
+       mov r24=cr.ipsr
+       mov r25=cr.iip;;
+       adds r20=XSI_TPR_OFS-XSI_PSR_IC_OFS,r18 ;;
+       ld8 r8=[r20];;
+       extr.u r26=r24,41,2 ;;
+       cmp.eq p6,p7=2,r26 ;;
+(p6)   mov r26=0
+(p6)   adds r25=16,r25
+(p7)   adds r26=1,r26
+       ;;
+       dep r24=r26,r24,41,2
+       ;;
+       mov cr.ipsr=r24
+       mov cr.iip=r25
+       mov pr=r31,-1 ;;
+       rfi
+       ;;
+END(hyper_get_tpr)
+
+// if we get to here, there are no interrupts pending so we
+// can change virtual tpr to any value without fear of provoking
+// (or accidentally missing) delivering an interrupt
+ENTRY(hyper_set_tpr)
+#ifdef FAST_HYPERPRIVOP_CNT
+       movl r20=fast_hyperpriv_cnt+(8*XEN_HYPER_SET_TPR);;
+       ld8 r21=[r20];;
+       adds r21=1,r21;;
+       st8 [r20]=r21;;
 #endif
+       mov r24=cr.ipsr
+       mov r25=cr.iip;;
+       movl r27=0xff00;;
+       adds r20=XSI_TPR_OFS-XSI_PSR_IC_OFS,r18 ;;
+       andcm r8=r8,r27;;
+       st8 [r20]=r8;;
+       extr.u r26=r24,41,2 ;;
+       cmp.eq p6,p7=2,r26 ;;
+(p6)   mov r26=0
+(p6)   adds r25=16,r25
+(p7)   adds r26=1,r26
+       ;;
+       dep r24=r26,r24,41,2
+       ;;
+       mov cr.ipsr=r24
+       mov cr.iip=r25
+       mov pr=r31,-1 ;;
+       rfi
+       ;;
+END(hyper_set_tpr)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>