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] [linux-2.6.18-xen] Do not allocate vcpu_guest_context on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Do not allocate vcpu_guest_context on the stack when initialising a
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 01 Feb 2008 08:00:33 -0800
Delivery-date: Fri, 01 Feb 2008 08:02:00 -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 1201864272 0
# Node ID 687ef5a4fcb7c6a0c8fe90ab25ce58a465c1cb4b
# Parent  e32fe4703ab68245dedcf32d76510623ba86953a
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>
---
 drivers/xen/core/smpboot.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff -r e32fe4703ab6 -r 687ef5a4fcb7 drivers/xen/core/smpboot.c
--- a/drivers/xen/core/smpboot.c        Tue Jan 29 11:53:33 2008 +0000
+++ b/drivers/xen/core/smpboot.c        Fri Feb 01 11:11:12 2008 +0000
@@ -182,7 +182,11 @@ static void __cpuinit cpu_bringup_and_id
 
 static void __cpuinit 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];
@@ -192,6 +196,8 @@ static void __cpuinit cpu_initialize_con
 
        if (cpu_test_and_set(cpu, cpu_initialized_map))
                return;
+
+       spin_lock(&ctxt_lock);
 
        memset(&ctxt, 0, sizeof(ctxt));
 
@@ -242,7 +248,10 @@ static void __cpuinit cpu_initialize_con
        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] [linux-2.6.18-xen] Do not allocate vcpu_guest_context on the stack when initialising a, Xen patchbot-linux-2.6.18-xen <=