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-3.1-testing] Do not allocate vcpu_guest_context on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] Do not allocate vcpu_guest_context on the stack when initialising a
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 05 Feb 2008 11:10:50 -0800
Delivery-date: Tue, 05 Feb 2008 11:11:38 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 1202135097 0
# Node ID 41cf298709339f07f60f315f0e4f6fbe09027237
# Parent  8af83080ec8981570b7d747094099b80d42b0e4f
Do not allocate vcpu_guest_context on the stack when initialising a
new VCPU. It is too big for 4kB stacks.
Original patch by Donald Dutile <ddutile@xxxxxxxxxx> backported from
upstream pv_ops work.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
linux-2.6.18-xen changeset:   402:687ef5a4fcb7c6a0c8fe90ab25ce58a465c1cb4b
linux-2.6.18-xen date:        Fri Feb 01 11:11:12 2008 +0000
---
 linux-2.6-xen-sparse/drivers/xen/core/smpboot.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff -r 8af83080ec89 -r 41cf29870933 
linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Mon Feb 04 14:22:33 
2008 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Mon Feb 04 14:24:57 
2008 +0000
@@ -183,7 +183,11 @@ static void cpu_bringup_and_idle(void)
 
 static void cpu_initialize_context(unsigned int cpu)
 {
-       vcpu_guest_context_t ctxt;
+       /* vcpu_guest_context_t is too large to allocate on the stack.
+        * Hence we allocate statically and protect it with a lock */
+       static vcpu_guest_context_t ctxt;
+       static DEFINE_SPINLOCK(ctxt_lock);
+
        struct task_struct *idle = idle_task(cpu);
 #ifdef __x86_64__
        struct desc_ptr *gdt_descr = &cpu_gdt_descr[cpu];
@@ -193,6 +197,8 @@ static void cpu_initialize_context(unsig
 
        if (cpu_test_and_set(cpu, cpu_initialized_map))
                return;
+
+       spin_lock(&ctxt_lock);
 
        memset(&ctxt, 0, sizeof(ctxt));
 
@@ -243,7 +249,10 @@ static void cpu_initialize_context(unsig
        ctxt.gs_base_kernel = (unsigned long)(cpu_pda(cpu));
 #endif
 
-       BUG_ON(HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, &ctxt));
+       if (HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, &ctxt))
+               BUG();
+
+       spin_unlock(&ctxt_lock);
 }
 
 void __init smp_prepare_cpus(unsigned int max_cpus)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] Do not allocate vcpu_guest_context on the stack when initialising a, Xen patchbot-3.1-testing <=