direct-io.hg

changeset 11301:50837fb04807

[IA64] vti bugs fix

Bug fixes:
- Do not read long-format vhpt as short-format.
- Avoid infinite loop in vtlb_purge.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Mon Aug 14 11:46:40 2006 -0600 (2006-08-14)
parents 9105cc8a738c
children 7c79d49033c6
files xen/arch/ia64/vmx/vtlb.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vtlb.c	Mon Aug 14 11:35:33 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vtlb.c	Mon Aug 14 11:46:40 2006 -0600
     1.3 @@ -214,12 +214,22 @@ u64 guest_vhpt_lookup(u64 iha, u64 *pte)
     1.4  {
     1.5      u64 ret;
     1.6      thash_data_t * data;
     1.7 +    PTA vpta;
     1.8 +
     1.9      data = vhpt_lookup(iha);
    1.10      if (data == NULL) {
    1.11          data = vtlb_lookup(current, iha, DSIDE_TLB);
    1.12          if (data != NULL)
    1.13              thash_vhpt_insert(current, data->page_flags, data->itir ,iha);
    1.14      }
    1.15 +
    1.16 +    /* VHPT long format is not read.  */
    1.17 +    vmx_vcpu_get_pta(current, &vpta.val);
    1.18 +    if (vpta.vf == 1) {
    1.19 +        *pte = 0;
    1.20 +        return 0;
    1.21 +    }
    1.22 +
    1.23      asm volatile ("rsm psr.ic|psr.i;;"
    1.24                    "srlz.d;;"
    1.25                    "ld8.s r9=[%1];;"
    1.26 @@ -231,7 +241,7 @@ u64 guest_vhpt_lookup(u64 iha, u64 *pte)
    1.27                    "ssm psr.ic;;"
    1.28                    "srlz.d;;"
    1.29                    "ssm psr.i;;"
    1.30 -             : "=r"(ret) : "r"(iha), "r"(pte):"memory");
    1.31 +                  : "=r"(ret) : "r"(iha), "r"(pte):"memory");
    1.32      return ret;
    1.33  }
    1.34  
    1.35 @@ -257,7 +267,8 @@ void vtlb_purge(VCPU *v, u64 va, u64 ps)
    1.36          psbits &= ~(1UL << ps);
    1.37          def_size = PSIZE(ps);
    1.38          vrr.ps = ps;
    1.39 -        while (curadr < end) {
    1.40 +        /* Be careful about overflow.  */
    1.41 +        while (curadr < end && curadr >= start) {
    1.42              cur = vsa_thash(hcb->pta, curadr, vrr.rrval, &tag);
    1.43              while (cur) {
    1.44                  if (cur->etag == tag && cur->ps == ps)