direct-io.hg

changeset 13469:9cbb1d6fb34a

[IA64] fix domain_flush_vtlb_all()

It might called by another domain's vcpu.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild2.aw
date Thu Jan 11 17:03:25 2007 -0700 (2007-01-11)
parents 91be8436952d
children 8835443fa3b3
files xen/arch/ia64/xen/mm.c xen/arch/ia64/xen/vhpt.c xen/include/asm-ia64/tlbflush.h
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Wed Jan 10 10:37:41 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Thu Jan 11 17:03:25 2007 -0700
     1.3 @@ -972,7 +972,7 @@ ioports_deny_access(struct domain *d, un
     1.4          // clear pte
     1.5          old_pte = ptep_get_and_clear(mm, mpaddr, pte);
     1.6      }
     1.7 -    domain_flush_vtlb_all();
     1.8 +    domain_flush_vtlb_all(d);
     1.9      return 0;
    1.10  }
    1.11  
    1.12 @@ -1730,7 +1730,7 @@ domain_page_flush_and_put(struct domain*
    1.13  #ifndef CONFIG_XEN_IA64_TLB_TRACK
    1.14      //XXX sledgehammer.
    1.15      //    flush finer range.
    1.16 -    domain_flush_vtlb_all();
    1.17 +    domain_flush_vtlb_all(d);
    1.18      put_page(page);
    1.19  #else
    1.20      switch (tlb_track_search_and_remove(d->arch.tlb_track,
    1.21 @@ -1749,7 +1749,7 @@ domain_page_flush_and_put(struct domain*
    1.22           * queue the page and flush vTLB only once.
    1.23           * I.e. The caller must call dfree_flush() explicitly.
    1.24           */
    1.25 -        domain_flush_vtlb_all();
    1.26 +        domain_flush_vtlb_all(d);
    1.27          put_page(page);
    1.28          break;
    1.29      case TLB_TRACK_NOT_FOUND:
    1.30 @@ -1783,7 +1783,7 @@ domain_page_flush_and_put(struct domain*
    1.31           * So we abondaned to track virtual addresses.
    1.32           * full vTLB flush is necessary.
    1.33           */
    1.34 -        domain_flush_vtlb_all();
    1.35 +        domain_flush_vtlb_all(d);
    1.36          put_page(page);
    1.37          break;
    1.38      case TLB_TRACK_AGAIN:
     2.1 --- a/xen/arch/ia64/xen/vhpt.c	Wed Jan 10 10:37:41 2007 -0700
     2.2 +++ b/xen/arch/ia64/xen/vhpt.c	Thu Jan 11 17:03:25 2007 -0700
     2.3 @@ -258,12 +258,13 @@ static void __vcpu_flush_vtlb_all(void *
     2.4  	vcpu_flush_vtlb_all((struct vcpu*)vcpu);
     2.5  }
     2.6  
     2.7 -void domain_flush_vtlb_all (void)
     2.8 +// caller must incremented reference count to d somehow.
     2.9 +void domain_flush_vtlb_all(struct domain* d)
    2.10  {
    2.11  	int cpu = smp_processor_id ();
    2.12  	struct vcpu *v;
    2.13  
    2.14 -	for_each_vcpu (current->domain, v) {
    2.15 +	for_each_vcpu(d, v) {
    2.16  		if (!test_bit(_VCPUF_initialised, &v->vcpu_flags))
    2.17  			continue;
    2.18  
     3.1 --- a/xen/include/asm-ia64/tlbflush.h	Wed Jan 10 10:37:41 2007 -0700
     3.2 +++ b/xen/include/asm-ia64/tlbflush.h	Thu Jan 11 17:03:25 2007 -0700
     3.3 @@ -17,7 +17,7 @@ void vcpu_flush_vtlb_all(struct vcpu *v)
     3.4  void vcpu_flush_tlb_vhpt_range (u64 vadr, u64 log_range);
     3.5  
     3.6  /* Global all flush of vTLB  */
     3.7 -void domain_flush_vtlb_all (void);
     3.8 +void domain_flush_vtlb_all(struct domain *d);
     3.9  
    3.10  /* Global range-flush of vTLB.  */
    3.11  void domain_flush_vtlb_range (struct domain *d, u64 vadr, u64 addr_range);