ia64/xen-unstable

changeset 8609:85d693e6f61a

Arch-specific per-vcpu info should be initialised to zero
when allocating a new vcpu structure, not copied from
CPU0's idle VCPU. Especially now that the idle VCPU itself
is dynamically allocated.

This should fix assertions people have been seeing in
getdomain_info_ctxt() relation to IOPL in eflags.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Jan 14 21:26:40 2006 +0100 (2006-01-14)
parents d8415ebc8c87
children 334dc7e6a23f
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Sat Jan 14 17:05:31 2006 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Sat Jan 14 21:26:40 2006 +0100
     1.3 @@ -215,14 +215,10 @@ struct vcpu *alloc_vcpu_struct(struct do
     1.4  
     1.5      memset(v, 0, sizeof(*v));
     1.6  
     1.7 -    memcpy(&v->arch, &idle_vcpu[0]->arch, sizeof(v->arch));
     1.8      v->arch.flags = TF_kernel_mode;
     1.9  
    1.10      if ( is_idle_domain(d) )
    1.11 -    {
    1.12          percpu_ctxt[vcpu_id].curr_vcpu = v;
    1.13 -        v->arch.schedule_tail = continue_idle_domain;
    1.14 -    }
    1.15  
    1.16      if ( (v->vcpu_id = vcpu_id) != 0 )
    1.17      {
    1.18 @@ -333,9 +329,10 @@ int arch_do_createdomain(struct vcpu *v)
    1.19          memset(d->shared_info, 0, PAGE_SIZE);
    1.20          v->vcpu_info = &d->shared_info->vcpu_info[v->vcpu_id];
    1.21          SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d);
    1.22 +    }
    1.23  
    1.24 -        v->arch.schedule_tail = continue_nonidle_domain;
    1.25 -    }
    1.26 +    v->arch.schedule_tail = is_idle_domain(d) ?
    1.27 +        continue_idle_domain : continue_nonidle_domain;
    1.28  
    1.29      return 0;
    1.30