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] [PATCH] fix vmx_vcpu_flush_tlb_all()

To: Kouya Shimura <kouya@xxxxxxxxxxxxxx>, KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] fix vmx_vcpu_flush_tlb_all()
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 31 Jul 2008 20:13:33 +0900
Cc:
Delivery-date: Thu, 31 Jul 2008 04:13:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
[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>