direct-io.hg

changeset 10390:7da52d016bcc

[IA64] add memory barrier to domain_flush_vtlb_range()

add memory barrier to domain_flush_vtlb_range().
vtlb purge must be visible before vhpt invalidation.
added some BUG_ON().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Fri Jun 09 10:35:38 2006 -0600 (2006-06-09)
parents ececeade018f
children 2f9878d01e2b
files xen/arch/ia64/xen/vcpu.c xen/arch/ia64/xen/vhpt.c
line diff
     1.1 --- a/xen/arch/ia64/xen/vcpu.c	Fri Jun 09 10:35:37 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/vcpu.c	Fri Jun 09 10:35:38 2006 -0600
     1.3 @@ -2016,6 +2016,8 @@ IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 
     1.4  
     1.5  IA64FAULT vcpu_ptc_l(VCPU *vcpu, UINT64 vadr, UINT64 log_range)
     1.6  {
     1.7 +	BUG_ON(vcpu != current);
     1.8 +
     1.9  	/* Purge TC  */
    1.10  	vcpu_purge_tr_entry(&PSCBX(vcpu,dtlb));
    1.11  	vcpu_purge_tr_entry(&PSCBX(vcpu,itlb));
    1.12 @@ -2082,6 +2084,7 @@ IA64FAULT vcpu_ptr_d(VCPU *vcpu,UINT64 v
    1.13  	unsigned long rid, rr;
    1.14  	int i;
    1.15  	TR_ENTRY *trp;
    1.16 +	BUG_ON(vcpu != current);
    1.17  
    1.18  	rr = PSCB(vcpu,rrs)[region];
    1.19  	rid = rr & RR_RID_MASK;
    1.20 @@ -2110,6 +2113,7 @@ IA64FAULT vcpu_ptr_i(VCPU *vcpu,UINT64 v
    1.21  	unsigned long rid, rr;
    1.22  	int i;
    1.23  	TR_ENTRY *trp;
    1.24 +	BUG_ON(vcpu != current);
    1.25  
    1.26  	rr = PSCB(vcpu,rrs)[region];
    1.27  	rid = rr & RR_RID_MASK;
     2.1 --- a/xen/arch/ia64/xen/vhpt.c	Fri Jun 09 10:35:37 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/vhpt.c	Fri Jun 09 10:35:38 2006 -0600
     2.3 @@ -202,10 +202,14 @@ void domain_flush_vtlb_range (struct dom
     2.4  		   FIXME: clear only if match.  */
     2.5  		vcpu_purge_tr_entry(&PSCBX(v,dtlb));
     2.6  		vcpu_purge_tr_entry(&PSCBX(v,itlb));
     2.7 +	}
     2.8 +	smp_mb();
     2.9  
    2.10 +	for_each_vcpu (d, v) {
    2.11  		/* Invalidate VHPT entries.  */
    2.12  		cpu_flush_vhpt_range (v->processor, vadr, addr_range);
    2.13  	}
    2.14 +	// ptc.ga has release semantics.
    2.15  
    2.16  	/* ptc.ga  */
    2.17  	ia64_global_tlb_purge(vadr,vadr+addr_range,PAGE_SHIFT);