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] x86: Initialise percpu areas as early as

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Initialise percpu areas as early as possible during bootstrap.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Dec 2009 07:15:14 -0800
Delivery-date: Tue, 29 Dec 2009 07:15:15 -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 1262099507 0
# Node ID 3f654b88e201a1341786a0e8725c25f40c1162b7
# Parent  a4a24cf98691670cafda86ecbc93992fd8f45b12
x86: Initialise percpu areas as early as possible during bootstrap.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/setup.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff -r a4a24cf98691 -r 3f654b88e201 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Tue Dec 29 15:04:17 2009 +0000
+++ b/xen/arch/x86/setup.c      Tue Dec 29 15:11:47 2009 +0000
@@ -202,21 +202,32 @@ static void __init percpu_init_areas(voi
 static void __init percpu_init_areas(void)
 {
     unsigned int i, data_size = __per_cpu_data_end - __per_cpu_start;
-    unsigned int first_unused;
 
     BUG_ON(data_size > PERCPU_SIZE);
 
     /* Initialise per-cpu data area for all possible secondary CPUs. */
-    for ( i = 1; (i < NR_CPUS) && cpu_possible(i); i++ )
+    for ( i = 1; i < NR_CPUS; i++ )
         memcpy(__per_cpu_start + (i << PERCPU_SHIFT),
                __per_cpu_start,
                data_size);
+}
+
+static void __init percpu_free_unused_areas(void)
+{
+    unsigned int i, data_size = __per_cpu_data_end - __per_cpu_start;
+    unsigned int first_unused;
+
+    /* Find first 'impossible' secondary CPU. */
+    for ( i = 1; i < NR_CPUS; i++ )
+        if ( !cpu_possible(i) )
+            break;
     first_unused = i;
 
     /* Check that there are no holes in cpu_possible_map. */
     for ( ; i < NR_CPUS; i++ )
         BUG_ON(cpu_possible(i));
 
+    /* Free all unused per-cpu data areas. */
     free_xen_data(&__per_cpu_start[first_unused << PERCPU_SHIFT], __bss_start);
 
     data_size = (data_size + PAGE_SIZE + 1) & PAGE_MASK;
@@ -447,6 +458,8 @@ void __init __start_xen(unsigned long mb
         .parity    = 'n',
         .stop_bits = 1
     };
+
+    percpu_init_areas();
 
     set_intr_gate(TRAP_page_fault, &early_page_fault);
 
@@ -995,7 +1008,7 @@ void __init __start_xen(unsigned long mb
 
     init_apic_mappings();
 
-    percpu_init_areas();
+    percpu_free_unused_areas();
 
     init_IRQ();
 

_______________________________________________
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] x86: Initialise percpu areas as early as possible during bootstrap., Xen patchbot-unstable <=