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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] When flush tlb mask, we need consider the

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] When flush tlb mask, we need consider the cpu_online_map.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Mar 2010 03:20:17 -0700
Delivery-date: Tue, 30 Mar 2010 03:20:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1269934276 -3600
# Node ID 8ab60a883fd5ea6294227adbeddcc124dab67df6
# Parent  f3db0ae08304d0707eda8cfc08182f444f12b35b
When flush tlb mask, we need consider the cpu_online_map.

The same is true for EPT flushes.

We noticed sometime system hang on cpu online/offline stress test. The
reason is because flush_tlb_mask from __get_page_type is deadloop.

This should be caused by a small windows in cpu offline.  The
cpu_online_map is changed and the interrupt is disabled at
take_cpu_down() for the to-be-offline CPU.

However, the __sync_lazy_execstate() called from idle_task_exit() in
the idle_loop() for the to-be-offline CPU. At that time, the
stop_machine_run is finished already, and __get_page_type may be
called in other CPU before the __sync_lazy_execstate().

Thanks Jan pointing out issue in my original patch.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@xxxxxxxxx>
 xen/arch/x86/hvm/vmx/vmx.c |    4 +++-
 xen/arch/x86/smp.c         |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff -r f3db0ae08304 -r 8ab60a883fd5 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Sat Mar 27 16:01:35 2010 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Mar 30 08:31:16 2010 +0100
@@ -1234,7 +1234,9 @@ void ept_sync_domain(struct domain *d)
      * the ept_synced mask before on_selected_cpus() reads it, resulting in
      * unnecessary extra flushes, to avoid allocating a cpumask_t on the stack.
-    d->arch.hvm_domain.vmx.ept_synced = d->domain_dirty_cpumask;
+    cpus_and(d->arch.hvm_domain.vmx.ept_synced,
+             d->domain_dirty_cpumask, cpu_online_map);
                      __ept_sync_domain, d, 1);
diff -r f3db0ae08304 -r 8ab60a883fd5 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c        Sat Mar 27 16:01:35 2010 +0000
+++ b/xen/arch/x86/smp.c        Tue Mar 30 08:31:16 2010 +0100
@@ -228,7 +228,8 @@ void flush_area_mask(const cpumask_t *ma
     if ( !cpus_subset(*mask, *cpumask_of(smp_processor_id())) )
-        cpus_andnot(flush_cpumask, *mask, *cpumask_of(smp_processor_id()));
+        cpus_and(flush_cpumask, *mask, cpu_online_map);
+        cpu_clear(smp_processor_id(), flush_cpumask);
         flush_va      = va;
         flush_flags   = flags;
         send_IPI_mask(&flush_cpumask, INVALIDATE_TLB_VECTOR);

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] When flush tlb mask, we need consider the cpu_online_map., Xen patchbot-unstable <=