ia64/xen-unstable

changeset 8836:0828f5f18b56

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@xensource.com>
author smh22@firebug.cl.cam.ac.uk
date Fri Feb 10 17:57:13 2006 +0100 (2006-02-10)
parents 260a09e9a9c1
children 4a9a39d08a06
files linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Fri Feb 10 17:14:56 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Fri Feb 10 17:57:13 2006 +0100
     1.3 @@ -176,7 +176,7 @@ void vcpu_prepare(int vcpu)
     1.4  
     1.5  #ifdef __i386__
     1.6  	ctxt.user_regs.cs = __KERNEL_CS;
     1.7 -	ctxt.user_regs.esp = idle->thread.esp;
     1.8 +	ctxt.user_regs.esp = idle->thread.esp0 - sizeof(struct pt_regs);
     1.9  
    1.10  	ctxt.kernel_ss = __KERNEL_DS;
    1.11  	ctxt.kernel_sp = idle->thread.esp0;
    1.12 @@ -187,9 +187,9 @@ void vcpu_prepare(int vcpu)
    1.13  	ctxt.failsafe_callback_eip = (unsigned long)failsafe_callback;
    1.14  
    1.15  	ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT;
    1.16 -#else
    1.17 +#else /* __x86_64__ */
    1.18  	ctxt.user_regs.cs = __KERNEL_CS | 3;
    1.19 -	ctxt.user_regs.esp = idle->thread.rsp;
    1.20 +	ctxt.user_regs.esp = idle->thread.rsp0 - sizeof(struct pt_regs);
    1.21  
    1.22  	ctxt.kernel_ss = __KERNEL_DS;
    1.23  	ctxt.kernel_sp = idle->thread.rsp0;