ia64/xen-unstable

changeset 17075:6aa10413da5b

[IA64] Avoid wild use of registers.

This patch avoids wild use of registers (r9,p6,p7) in guest_vhpt_lookup.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
author Alex Williamson <alex.williamson@hp.com>
date Tue Feb 19 09:25:22 2008 -0700 (2008-02-19)
parents aaf4d6d1d83e
children a0900277d1d1
files xen/arch/ia64/vmx/vtlb.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vtlb.c	Tue Feb 19 09:22:25 2008 -0700
     1.2 +++ b/xen/arch/ia64/vmx/vtlb.c	Tue Feb 19 09:25:22 2008 -0700
     1.3 @@ -272,9 +272,10 @@ thash_data_t * vhpt_lookup(u64 va)
     1.4  
     1.5  u64 guest_vhpt_lookup(u64 iha, u64 *pte)
     1.6  {
     1.7 -    u64 ret;
     1.8 +    u64 ret, tmp;
     1.9      thash_data_t * data;
    1.10  
    1.11 +    /* Try to fill mTLB for the gVHPT entry.  */
    1.12      data = vhpt_lookup(iha);
    1.13      if (data == NULL) {
    1.14          data = __vtr_lookup(current, iha, DSIDE_TLB);
    1.15 @@ -285,17 +286,18 @@ u64 guest_vhpt_lookup(u64 iha, u64 *pte)
    1.16  
    1.17      asm volatile ("rsm psr.ic|psr.i;;"
    1.18                    "srlz.d;;"
    1.19 -                  "ld8.s r9=[%1];;"
    1.20 -                  "tnat.nz p6,p7=r9;;"
    1.21 -                  "(p6) mov %0=1;"
    1.22 -                  "(p6) mov r9=r0;"
    1.23 -                  "(p7) extr.u r9=r9,0,53;;"
    1.24 -                  "(p7) mov %0=r0;"
    1.25 -                  "(p7) st8 [%2]=r9;;"
    1.26 +                  "ld8.s %1=[%2];;"		/* Read VHPT entry.  */
    1.27 +                  "tnat.nz p6,p7=%1;;"		/* Success ?  */
    1.28 +                  "(p6) mov %0=1;"		/* No -> ret = 1.  */
    1.29 +                  "(p6) mov %1=r0;"
    1.30 +                  "(p7) extr.u %1=%1,0,53;;"	/* Yes -> mask ig bits.  */
    1.31 +                  "(p7) mov %0=r0;"		/*     -> ret = 0.  */
    1.32 +                  "(p7) st8 [%3]=%1;;"		/*     -> save.  */
    1.33                    "ssm psr.ic;;"
    1.34                    "srlz.d;;"
    1.35                    "ssm psr.i;;"
    1.36 -                  : "=r"(ret) : "r"(iha), "r"(pte):"memory");
    1.37 +                  : "=r"(ret), "=r"(tmp)
    1.38 +                  : "r"(iha), "r"(pte):"memory","p6","p7");
    1.39      return ret;
    1.40  }
    1.41