ia64/xen-unstable

changeset 8723:61e7afb7344b

The memset in init_switch_stack is overwriting the processor stack.
We need to avoid manipulating the switch stack area of the currently
running cpu. Original patch by Kevin Tian.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Feb 01 00:56:19 2006 +0100 (2006-02-01)
parents f081663ba941
children a3fbce644bcc
files xen/arch/ia64/xen/domain.c
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Wed Feb 01 00:48:17 2006 +0100
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Wed Feb 01 00:56:19 2006 +0100
     1.3 @@ -157,15 +157,15 @@ struct vcpu *alloc_vcpu_struct(struct do
     1.4  	    if ((v = alloc_xenheap_pages(KERNEL_STACK_SIZE_ORDER)) == NULL)
     1.5  		return NULL;
     1.6  	    memset(v, 0, sizeof(*v)); 
     1.7 +
     1.8 +	    ti = alloc_thread_info(v);
     1.9 +	    /* Clear thread_info to clear some important fields, like
    1.10 +	     * preempt_count
    1.11 +	     */
    1.12 +	    memset(ti, 0, sizeof(struct thread_info));
    1.13 +	    init_switch_stack(v);
    1.14  	}
    1.15  
    1.16 -	ti = alloc_thread_info(v);
    1.17 -	/* Clear thread_info to clear some important fields, like
    1.18 -	 * preempt_count
    1.19 -	 */
    1.20 -	memset(ti, 0, sizeof(struct thread_info));
    1.21 -	init_switch_stack(v);
    1.22 -
    1.23  	if (!is_idle_domain(d)) {
    1.24  	    v->arch.privregs = 
    1.25  		alloc_xenheap_pages(get_order(sizeof(mapped_regs_t)));