[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] Simplify lazy cover algorithm



# HG changeset patch
# User awilliam@xxxxxxxxxxxx
# Date 1168629071 25200
# Node ID cd6598396086157a9eeb2f368462ddeb6e8f8201
# Parent  01ea554f1c5e8bdbfa172349438298b15da6fc5c
[IA64] Simplify lazy cover algorithm

Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c |    1 
 linux-2.6-xen-sparse/arch/ia64/xen/xenminstate.h    |   11 -------
 linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h  |    1 
 xen/arch/ia64/asm-xsi-offsets.c                     |    1 
 xen/arch/ia64/xen/faults.c                          |    3 -
 xen/arch/ia64/xen/hyperprivop.S                     |   31 ++++----------------
 xen/arch/ia64/xen/vcpu.c                            |    7 ----
 xen/include/public/arch-ia64.h                      |    5 +--
 8 files changed, 11 insertions(+), 49 deletions(-)

diff -r 01ea554f1c5e -r cd6598396086 
linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c       Thu Jan 11 
16:56:58 2007 -0700
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c       Fri Jan 12 
12:11:11 2007 -0700
@@ -280,7 +280,6 @@ void foo(void)
        DEFINE_MAPPED_REG_OFS(XSI_IHA_OFS, iha);
        DEFINE_MAPPED_REG_OFS(XSI_ITIR_OFS, itir);
        DEFINE_MAPPED_REG_OFS(XSI_PSR_IC_OFS, interrupt_collection_enabled);
-       DEFINE_MAPPED_REG_OFS(XSI_INCOMPL_REGFR_OFS, incomplete_regframe);
        DEFINE_MAPPED_REG_OFS(XSI_BANKNUM_OFS, banknum);
        DEFINE_MAPPED_REG_OFS(XSI_BANK0_R16_OFS, bank0_regs[0]);
        DEFINE_MAPPED_REG_OFS(XSI_BANK1_R16_OFS, bank1_regs[0]);
diff -r 01ea554f1c5e -r cd6598396086 
linux-2.6-xen-sparse/arch/ia64/xen/xenminstate.h
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xenminstate.h  Thu Jan 11 16:56:58 
2007 -0700
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xenminstate.h  Fri Jan 12 12:11:11 
2007 -0700
@@ -151,16 +151,7 @@
 .mem.offset 8,0; st8.spill [r17]=r11,24;                                       
                \
         ;;                                                                     
                \
        /* xen special handling for possibly lazy cover */                      
                \
-       movl r8=XSI_INCOMPL_REGFR;                                              
                \
-       ;;                                                                      
                \
-       ld4 r30=[r8];                                                           
                \
-       ;;                                                                      
                \
-       /* set XSI_INCOMPL_REGFR 0 */                                           
                \
-       st4 [r8]=r0;                                                            
                \
-       cmp.eq  p6,p7=r30,r0;                                                   
                \
-       ;; /* not sure if this stop bit is necessary */                         
                \
-(p6)   adds r8=XSI_PRECOVER_IFS-XSI_INCOMPL_REGFR,r8;                          
                \
-(p7)   adds r8=XSI_IFS-XSI_INCOMPL_REGFR,r8;                                   
                \
+       movl r8=XSI_PRECOVER_IFS;                                               
                \
        ;;                                                                      
                \
        ld8 r30=[r8];                                                           
                \
        ;;                                                                      
                \
diff -r 01ea554f1c5e -r cd6598396086 
linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h        Thu Jan 11 
16:56:58 2007 -0700
+++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h        Fri Jan 12 
12:11:11 2007 -0700
@@ -49,7 +49,6 @@
 
 #define XSI_IFS                        (XSI_BASE + XSI_IFS_OFS)
 #define XSI_PRECOVER_IFS       (XSI_BASE + XSI_PRECOVER_IFS_OFS)
-#define XSI_INCOMPL_REGFR      (XSI_BASE + XSI_INCOMPL_REGFR_OFS)
 #define XSI_IFA                        (XSI_BASE + XSI_IFA_OFS)
 #define XSI_ISR                        (XSI_BASE + XSI_ISR_OFS)
 #define XSI_IIM                        (XSI_BASE + XSI_IIM_OFS)
diff -r 01ea554f1c5e -r cd6598396086 xen/arch/ia64/asm-xsi-offsets.c
--- a/xen/arch/ia64/asm-xsi-offsets.c   Thu Jan 11 16:56:58 2007 -0700
+++ b/xen/arch/ia64/asm-xsi-offsets.c   Fri Jan 12 12:11:11 2007 -0700
@@ -62,7 +62,6 @@ void foo(void)
        DEFINE_MAPPED_REG_OFS(XSI_ITV_OFS, itv);
        DEFINE_MAPPED_REG_OFS(XSI_PTA_OFS, pta);
        DEFINE_MAPPED_REG_OFS(XSI_PSR_IC_OFS, interrupt_collection_enabled);
-       DEFINE_MAPPED_REG_OFS(XSI_INCOMPL_REGFR_OFS, incomplete_regframe);
        DEFINE_MAPPED_REG_OFS(XSI_METAPHYS_OFS, metaphysical_mode);
        DEFINE_MAPPED_REG_OFS(XSI_BANKNUM_OFS, banknum);
        DEFINE_MAPPED_REG_OFS(XSI_BANK0_R16_OFS, bank0_regs[0]);
diff -r 01ea554f1c5e -r cd6598396086 xen/arch/ia64/xen/faults.c
--- a/xen/arch/ia64/xen/faults.c        Thu Jan 11 16:56:58 2007 -0700
+++ b/xen/arch/ia64/xen/faults.c        Fri Jan 12 12:11:11 2007 -0700
@@ -88,7 +88,6 @@ void reflect_interruption(unsigned long 
        PSCB(v, isr) = isr;
        PSCB(v, iip) = regs->cr_iip;
        PSCB(v, ifs) = 0;
-       PSCB(v, incomplete_regframe) = 0;
 
        regs->cr_iip = ((unsigned long)PSCBX(v, iva) + vector) & ~0xffUL;
        regs->cr_ipsr = (regs->cr_ipsr & ~DELIVER_PSR_CLR) | DELIVER_PSR_SET;
@@ -155,7 +154,6 @@ void reflect_event(void)
        PSCB(v, isr) = isr;
        PSCB(v, iip) = regs->cr_iip;
        PSCB(v, ifs) = 0;
-       PSCB(v, incomplete_regframe) = 0;
 
        regs->cr_iip = v->arch.event_callback_ip;
        regs->cr_ipsr = (regs->cr_ipsr & ~DELIVER_PSR_CLR) | DELIVER_PSR_SET;
@@ -185,7 +183,6 @@ static int handle_lazy_cover(struct vcpu
 {
        if (!PSCB(v, interrupt_collection_enabled)) {
                PSCB(v, ifs) = regs->cr_ifs;
-               PSCB(v, incomplete_regframe) = 1;
                regs->cr_ifs = 0;
                perfc_incrc(lazy_cover);
                return 1;       // retry same instruction with cr.ifs off
diff -r 01ea554f1c5e -r cd6598396086 xen/arch/ia64/xen/hyperprivop.S
--- a/xen/arch/ia64/xen/hyperprivop.S   Thu Jan 11 16:56:58 2007 -0700
+++ b/xen/arch/ia64/xen/hyperprivop.S   Fri Jan 12 12:11:11 2007 -0700
@@ -192,7 +192,6 @@ END(fast_hyperprivop)
 //     and isr.ri to cr.isr.ri (all other bits zero)
 //  - cover and set shared_mem precover_ifs to cr.ifs
 //             ^^^ MISSED THIS FOR fast_break??
-//  - set shared_mem ifs and incomplete_regframe to 0
 //  - set shared_mem interrupt_delivery_enabled to 0
 //  - set shared_mem interrupt_collection_enabled to 0
 //  - set r31 to SHAREDINFO_ADDR
@@ -272,11 +271,9 @@ ENTRY(hyper_ssm_i)
        st1 [r22]=r20
        st4 [r18]=r0
        // cover and set shared_mem precover_ifs to cr.ifs
-       // set shared_mem ifs and incomplete_regframe to 0
+       // set shared_mem ifs to 0
        cover ;;
        mov r20=cr.ifs;;
-       adds r21=XSI_INCOMPL_REGFR_OFS-XSI_PSR_IC_OFS,r18 ;;
-       st4 [r21]=r0 ;;
        adds r21=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
        st8 [r21]=r0 ;;
        adds r21=XSI_PRECOVER_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
@@ -459,11 +456,9 @@ GLOBAL_ENTRY(fast_tick_reflect)
        st1 [r22]=r20;;
        st4 [r18]=r0;;
        // cover and set shared_mem precover_ifs to cr.ifs
-       // set shared_mem ifs and incomplete_regframe to 0
+       // set shared_mem ifs to 0
        cover ;;
        mov r20=cr.ifs;;
-       adds r21=XSI_INCOMPL_REGFR_OFS-XSI_PSR_IC_OFS,r18 ;;
-       st4 [r21]=r0 ;;
        adds r21=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
        st8 [r21]=r0 ;;
        adds r21=XSI_PRECOVER_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
@@ -645,11 +640,9 @@ ENTRY(fast_reflect)
        st1 [r24]=r22
        st4 [r18]=r0;;
        // cover and set shared_mem precover_ifs to cr.ifs
-       // set shared_mem ifs and incomplete_regframe to 0
+       // set shared_mem ifs to 0
        cover ;;
        mov r24=cr.ifs;;
-       adds r21=XSI_INCOMPL_REGFR_OFS-XSI_PSR_IC_OFS,r18 ;;
-       st4 [r21]=r0 ;;
        adds r21=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
        st8 [r21]=r0 ;;
        adds r21=XSI_PRECOVER_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
@@ -1082,8 +1075,6 @@ just_do_rfi:
 just_do_rfi:
        // r18=&vpsr.i|vpsr.ic, r21==vpsr, r22=vcr.iip
        mov cr.iip=r22;;
-       adds r20=XSI_INCOMPL_REGFR_OFS-XSI_PSR_IC_OFS,r18 ;;
-       st4 [r20]=r0 ;;
        adds r20=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
        ld8 r20=[r20];;
        dep r20=0,r20,38,25;; // ensure ifs has no reserved bits set
@@ -1259,20 +1250,16 @@ ENTRY(rfi_with_interrupt)
        st1 [r22]=r20
        st4 [r18]=r0;;
        // cover and set shared_mem precover_ifs to cr.ifs
-       // set shared_mem ifs and incomplete_regframe to 0
+       // set shared_mem ifs to 0
 #if 0
        cover ;;
        mov r20=cr.ifs;;
-       adds r22=XSI_INCOMPL_REG_OFS-XSI_PSR_IC_OFS,r18 ;;
-       st4 [r22]=r0 ;;
        adds r22=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
        st8 [r22]=r0 ;;
        adds r22=XSI_PRECOVER_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
        st8 [r22]=r20 ;;
        // leave cr.ifs alone for later rfi
 #else
-       adds r22=XSI_INCOMPL_REG_OFS-XSI_PSR_IC_OFS,r18 ;;
-       st4 [r22]=r0 ;;
        adds r22=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18 ;;
        ld8 r20=[r22];;
        st8 [r22]=r0 ;;
@@ -1334,13 +1321,9 @@ ENTRY(hyper_cover)
        mov r25=cr.iip;;
        // skip test for vpsr.ic.. it's a prerequisite for hyperprivops
        cover ;;
-       adds r20=XSI_INCOMPL_REGFR_OFS-XSI_PSR_IC_OFS,r18 ;;
-       mov r30=cr.ifs;;
-       adds r22=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18
-       ld4 r21=[r20] ;;
-       cmp.eq p6,p7=r21,r0 ;;
-(p6)   st8 [r22]=r30;;
-(p7)   st4 [r20]=r0;;
+       mov r30=cr.ifs
+       adds r22=XSI_IFS_OFS-XSI_PSR_IC_OFS,r18;;
+       st8 [r22]=r30;;
        mov cr.ifs=r0;;
        // adjust return address to skip over break instruction
        extr.u r26=r24,41,2 ;;
diff -r 01ea554f1c5e -r cd6598396086 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Thu Jan 11 16:56:58 2007 -0700
+++ b/xen/arch/ia64/xen/vcpu.c  Fri Jan 12 12:11:11 2007 -0700
@@ -613,7 +613,6 @@ IA64FAULT vcpu_get_ifs(VCPU * vcpu, u64 
        //PSCB(vcpu,ifs) = PSCB(vcpu)->regs.cr_ifs;
        //*pval = PSCB(vcpu,regs).cr_ifs;
        *pval = PSCB(vcpu, ifs);
-       PSCB(vcpu, incomplete_regframe) = 0;
        return IA64_NO_FAULT;
 }
 
@@ -1362,7 +1361,6 @@ IA64FAULT vcpu_rfi(VCPU * vcpu)
                printk("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n");
                return IA64_ILLOP_FAULT;
        }
-       PSCB(vcpu, incomplete_regframe) = 0;    // is this necessary?
 
        ifs = PSCB(vcpu, ifs);
        if (ifs > 0x8000000000000000UL) {
@@ -1397,10 +1395,7 @@ IA64FAULT vcpu_cover(VCPU * vcpu)
        REGS *regs = vcpu_regs(vcpu);
 
        if (!PSCB(vcpu, interrupt_collection_enabled)) {
-               if (!PSCB(vcpu, incomplete_regframe))
-                       PSCB(vcpu, ifs) = regs->cr_ifs;
-               else
-                       PSCB(vcpu, incomplete_regframe) = 0;
+               PSCB(vcpu, ifs) = regs->cr_ifs;
        }
        regs->cr_ifs = 0;
        return IA64_NO_FAULT;
diff -r 01ea554f1c5e -r cd6598396086 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Thu Jan 11 16:56:58 2007 -0700
+++ b/xen/include/public/arch-ia64.h    Fri Jan 12 12:11:11 2007 -0700
@@ -287,10 +287,9 @@ struct mapped_regs {
              */
             unsigned char *interrupt_mask_addr;
             int pending_interruption;
-            int incomplete_regframe; // see SDM vol2 6.8
             unsigned char vpsr_pp;
-            unsigned char reserved5_2[7];
-            unsigned long reserved5_1[3];
+            unsigned char reserved5_2[3];
+            unsigned long reserved5_1[4];
             int metaphysical_mode; // 1 = use metaphys mapping, 0 = use virtual
             int banknum; // 0 or 1, which virtual register bank is active
             unsigned long rrs[8]; // region registers

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.