WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] Re: [PATCH] fix vmx_vcpu_flush_tlb_all()

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] Re: [PATCH] fix vmx_vcpu_flush_tlb_all()
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 1 Aug 2008 10:34:29 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 31 Jul 2008 18:34:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20080731111333.GG551%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20080731111333.GG551%yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Yamahata-san,

I think that calling ptc_ga_remote_func() during __thash_purge_all()
is harmless.
Because all that ptc_ga_remote_func() does is to set the 
invalid value(1UL << 63) to a tag in vcpu->arch.vtlb. 
It doesn't affect __thash_purge_all() at all.

__thash_purge_all() takes over 10 milliseconds. 
IMHO, it's not so good to disable interrupts for such a long period.

Thanks,
Kouya

Isaku Yamahata writes:
> [IA64] fix vmx_vcpu_flush_tlb_all()
> 
> There is a race between vmx_vcpu_flush_tlb_all() and vmx_vcpu_ptc_ga().
> __thash_purge_all() can be called without interrupt disabled so that
> vmx_vcpu_ptc_ga() may issue ipi to call ptc_ga_remote_func() on that
> pCPU during __thash_purge_all() is executing. And both of the functions
> manipulate vcpu->arch.vtlb.
> To avoid the race, mask interrupts in __thash_purge_all().
> 
> Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
> 
> diff -r b5c925071c07 xen/arch/ia64/vmx/vtlb.c
> --- a/xen/arch/ia64/vmx/vtlb.c        Thu Jul 31 19:01:03 2008 +0900
> +++ b/xen/arch/ia64/vmx/vtlb.c        Thu Jul 31 20:14:47 2008 +0900
> @@ -626,9 +626,14 @@
>  static void __thash_purge_all(void *arg)
>  {
>      struct vcpu *v = arg;
> +    unsigned long flags;
>  
>      BUG_ON(vcpu_runnable(v) || v->is_running);
> +
> +    /* we are racing with vmx_vcpu_ptc_ga() */
> +    local_irq_save(flags);
>      thash_purge_all(v);
> +    local_irq_restore(flags);
>  }
>  
>  void vmx_vcpu_flush_vtlb_all(VCPU *v)
> 
> -- 
> yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

<Prev in Thread] Current Thread [Next in Thread>