ia64/xen-unstable

changeset 10147:29d31af10e57

[IA64] Add ptc.l emulation

This patch adds support for ptc.l emulation for xenlinux.
In 2.6.16 kernel it flush_tlb_range will call global_tlb_purge
directly, so ptc.l shouldn't be used when CONFIG_SMP enable.
But in order to enhance performance (maybe), 2.6.17 kernel in
smp environment will do mm check first. If mm is current->active_mm
and the mm (corresponding process) just runs on the local processor,
kernel only needs to do ptc.l at local processor instead of global purge.
So ptc.l emulation is necessary for 2.6.17 kernel.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
author awilliam@xenbuild.aw
date Wed May 24 08:48:21 2006 -0600 (2006-05-24)
parents 83c0449db67a
children 8fab4a407c52
files xen/arch/ia64/xen/privop.c xen/arch/ia64/xen/vcpu.c xen/include/asm-ia64/vcpu.h
line diff
     1.1 --- a/xen/arch/ia64/xen/privop.c	Tue May 23 17:05:27 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/privop.c	Wed May 24 08:48:21 2006 -0600
     1.3 @@ -129,10 +129,10 @@ IA64FAULT priv_cover(VCPU *vcpu, INST64 
     1.4  IA64FAULT priv_ptc_l(VCPU *vcpu, INST64 inst)
     1.5  {
     1.6  	UINT64 vadr = vcpu_get_gr(vcpu,inst.M45.r3);
     1.7 -	UINT64 addr_range;
     1.8 +	UINT64 log_range;
     1.9  
    1.10 -	addr_range = 1 << ((vcpu_get_gr(vcpu,inst.M45.r2) & 0xfc) >> 2);
    1.11 -	return vcpu_ptc_l(vcpu,vadr,addr_range);
    1.12 +	log_range = ((vcpu_get_gr(vcpu,inst.M45.r2) & 0xfc) >> 2);
    1.13 +	return vcpu_ptc_l(vcpu,vadr,log_range);
    1.14  }
    1.15  
    1.16  IA64FAULT priv_ptc_e(VCPU *vcpu, INST64 inst)
     2.1 --- a/xen/arch/ia64/xen/vcpu.c	Tue May 23 17:05:27 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/vcpu.c	Wed May 24 08:48:21 2006 -0600
     2.3 @@ -1848,12 +1848,17 @@ IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 
     2.4  	return IA64_NO_FAULT;
     2.5  }
     2.6  
     2.7 -IA64FAULT vcpu_ptc_l(VCPU *vcpu, UINT64 vadr, UINT64 addr_range)
     2.8 +IA64FAULT vcpu_ptc_l(VCPU *vcpu, UINT64 vadr, UINT64 log_range)
     2.9  {
    2.10 -	printk("vcpu_ptc_l: called, not implemented yet\n");
    2.11 -	return IA64_ILLOP_FAULT;
    2.12 +	/* Purge TC  */
    2.13 +	vcpu_purge_tr_entry(&PSCBX(vcpu,dtlb));
    2.14 +	vcpu_purge_tr_entry(&PSCBX(vcpu,itlb));
    2.15 +	
    2.16 +	/*Purge all tlb and vhpt*/
    2.17 +	vcpu_flush_tlb_vhpt_range (vadr, log_range);
    2.18 +
    2.19 +	return IA64_NO_FAULT;
    2.20  }
    2.21 -
    2.22  // At privlvl=0, fc performs no access rights or protection key checks, while
    2.23  // at privlvl!=0, fc performs access rights checks as if it were a 1-byte
    2.24  // read but no protection key check.  Thus in order to avoid an unexpected
     3.1 --- a/xen/include/asm-ia64/vcpu.h	Tue May 23 17:05:27 2006 -0600
     3.2 +++ b/xen/include/asm-ia64/vcpu.h	Wed May 24 08:48:21 2006 -0600
     3.3 @@ -145,7 +145,7 @@ extern IA64FAULT vcpu_itr_i(VCPU *vcpu, 
     3.4  		UINT64 itir, UINT64 ifa);
     3.5  extern IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 padr, UINT64 itir, UINT64 ifa);
     3.6  extern IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 padr, UINT64 itir, UINT64 ifa);
     3.7 -extern IA64FAULT vcpu_ptc_l(VCPU *vcpu, UINT64 vadr, UINT64 addr_range);
     3.8 +extern IA64FAULT vcpu_ptc_l(VCPU *vcpu, UINT64 vadr, UINT64 log_range);
     3.9  extern IA64FAULT vcpu_ptc_e(VCPU *vcpu, UINT64 vadr);
    3.10  extern IA64FAULT vcpu_ptc_g(VCPU *vcpu, UINT64 vadr, UINT64 addr_range);
    3.11  extern IA64FAULT vcpu_ptc_ga(VCPU *vcpu, UINT64 vadr, UINT64 addr_range);