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] Reset sp on vcpu_prepare; this avoids 'leaking' stack af

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Reset sp on vcpu_prepare; this avoids 'leaking' stack after repeated
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 13 Feb 2006 12:34:08 +0000
Delivery-date: Mon, 13 Feb 2006 12:46:56 +0000
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/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 smh22@xxxxxxxxxxxxxxxxxxxx
# Node ID 0828f5f18b5609139d171ad64d5119c79ae02fdb
# Parent  260a09e9a9c16f5fede110cd592a11977c599deb
Reset sp on vcpu_prepare; this avoids 'leaking' stack after repeated 
save/restore/migrate iterations. 

Should fix various crashes observed with save/restore/migrate of multi
VCPU guests. 

Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx>

diff -r 260a09e9a9c1 -r 0828f5f18b56 
linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Fri Feb 10 16:14:56 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Fri Feb 10 16:57:13 2006
@@ -176,7 +176,7 @@
 
 #ifdef __i386__
        ctxt.user_regs.cs = __KERNEL_CS;
-       ctxt.user_regs.esp = idle->thread.esp;
+       ctxt.user_regs.esp = idle->thread.esp0 - sizeof(struct pt_regs);
 
        ctxt.kernel_ss = __KERNEL_DS;
        ctxt.kernel_sp = idle->thread.esp0;
@@ -187,9 +187,9 @@
        ctxt.failsafe_callback_eip = (unsigned long)failsafe_callback;
 
        ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT;
-#else
+#else /* __x86_64__ */
        ctxt.user_regs.cs = __KERNEL_CS | 3;
-       ctxt.user_regs.esp = idle->thread.rsp;
+       ctxt.user_regs.esp = idle->thread.rsp0 - sizeof(struct pt_regs);
 
        ctxt.kernel_ss = __KERNEL_DS;
        ctxt.kernel_sp = idle->thread.rsp0;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Reset sp on vcpu_prepare; this avoids 'leaking' stack after repeated, Xen patchbot -unstable <=