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-changelog

[Xen-changelog] [xen-unstable] Don't assume vcpu_id's are contiguous in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Don't assume vcpu_id's are contiguous in alloc_vcpu
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Nov 2009 05:20:22 -0800
Delivery-date: Thu, 12 Nov 2009 05:21:05 -0800
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 1258031740 0
# Node ID accded2f185f4178f875b170a5c01544648a68d2
# Parent  b1b4d54629a430b9d9a44ef5d29d0e2e3a123a46
Don't assume vcpu_id's are contiguous in alloc_vcpu

When cpu hot-added, this assumption is broken because the hot-added
CPU may be brougt online by dom0 in arbitrary order. This patch avoids
making this assumption while still linking vcpus in ascending order of
identifier.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/domain.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -r b1b4d54629a4 -r accded2f185f xen/common/domain.c
--- a/xen/common/domain.c       Thu Nov 12 13:02:27 2009 +0000
+++ b/xen/common/domain.c       Thu Nov 12 13:15:40 2009 +0000
@@ -176,7 +176,14 @@ struct vcpu *alloc_vcpu(
 
     d->vcpu[vcpu_id] = v;
     if ( vcpu_id != 0 )
-        d->vcpu[v->vcpu_id-1]->next_in_list = v;
+    {
+        int prev_id = v->vcpu_id - 1;
+        while ( (prev_id >= 0) && (d->vcpu[prev_id] == NULL) )
+            prev_id--;
+        BUG_ON(prev_id < 0);
+        v->next_in_list = d->vcpu[prev_id]->next_in_list;
+        d->vcpu[prev_id]->next_in_list = v;
+    }
 
     /* Must be called after making new vcpu visible to for_each_vcpu(). */
     vcpu_check_shutdown(v);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Don't assume vcpu_id's are contiguous in alloc_vcpu, Xen patchbot-unstable <=