ia64/xen-unstable

changeset 10515:3dca270188da

[IA64] ptc.g virtualization fix

VMM only needs to switch rr0 and pta when emulating ptc.g.
Because VMM only use rr0 and pta to do global purge on other LPs.
VMM doesn't need to switch rr7, it is time consuming operation.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild.aw
date Mon Jun 26 14:33:01 2006 -0600 (2006-06-26)
parents d4e799a1fa9c
children 7c9692adcca7
files xen/arch/ia64/vmx/vmmu.c xen/arch/ia64/vmx/vtlb.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmmu.c	Fri Jun 23 16:10:32 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmmu.c	Mon Jun 26 14:33:01 2006 -0600
     1.3 @@ -517,7 +517,7 @@ struct ptc_ga_args {
     1.4  
     1.5  static void ptc_ga_remote_func (void *varg)
     1.6  {
     1.7 -    u64 oldrid, moldrid;
     1.8 +    u64 oldrid, moldrid, mpta;
     1.9      struct ptc_ga_args *args = (struct ptc_ga_args *)varg;
    1.10      VCPU *v = args->vcpu;
    1.11  
    1.12 @@ -525,10 +525,13 @@ static void ptc_ga_remote_func (void *va
    1.13      VMX(v, vrr[0]) = args->rid;
    1.14      moldrid = ia64_get_rr(0x0);
    1.15      ia64_set_rr(0x0,vrrtomrr(v,args->rid));
    1.16 +    mpta = ia64_get_pta();
    1.17 +    ia64_set_pta(v->arch.arch_vmx.mpta);
    1.18      ia64_srlz_d();
    1.19      vmx_vcpu_ptc_l(v, args->vadr, args->ps);
    1.20      VMX(v, vrr[0]) = oldrid; 
    1.21      ia64_set_rr(0x0,moldrid);
    1.22 +    ia64_set_pta(mpta);
    1.23      ia64_dv_serialize_data();
    1.24  }
    1.25  
     2.1 --- a/xen/arch/ia64/vmx/vtlb.c	Fri Jun 23 16:10:32 2006 -0600
     2.2 +++ b/xen/arch/ia64/vmx/vtlb.c	Mon Jun 26 14:33:01 2006 -0600
     2.3 @@ -267,14 +267,6 @@ static void vtlb_purge(VCPU *v, u64 va, 
     2.4  //    machine_tlb_purge(va, ps);
     2.5  }
     2.6  
     2.7 -static void
     2.8 -switch_rr7_and_pta(VCPU* v)
     2.9 -{
    2.10 -    if (VMX_DOMAIN(v))
    2.11 -        vmx_load_rr7_and_pta(v);
    2.12 -    else
    2.13 -        load_region_reg7_and_pta(v);
    2.14 -}
    2.15  
    2.16  /*
    2.17   *  purge VHPT and machine TLB
    2.18 @@ -287,8 +279,6 @@ static void vhpt_purge(VCPU *v, u64 va, 
    2.19      size = PSIZE(ps);
    2.20      start = va & (-size);
    2.21      end = start + size;
    2.22 -    if (current != v)
    2.23 -        switch_rr7_and_pta(v);
    2.24      while(start < end){
    2.25          hash_table = (thash_data_t *)ia64_thash(start);
    2.26          tag = ia64_ttag(start);
    2.27 @@ -310,8 +300,6 @@ static void vhpt_purge(VCPU *v, u64 va, 
    2.28          start += PAGE_SIZE;
    2.29      }
    2.30      machine_tlb_purge(va, ps);
    2.31 -    if (current != v)
    2.32 -        switch_rr7_and_pta(current);
    2.33  }
    2.34  
    2.35  /*