From: kaf24@firebug.cl.cam.ac.uk Date: Sat, 14 Jan 2006 20:26:40 +0000 (+0100) Subject: Arch-specific per-vcpu info should be initialised to zero X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16541^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6294397fbafa4fefe6e0671afe62d3f35e9e7b12;p=xen.git 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 --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 19c29d084c..db764760b1 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -215,14 +215,10 @@ struct vcpu *alloc_vcpu_struct(struct domain *d, unsigned int vcpu_id) memset(v, 0, sizeof(*v)); - memcpy(&v->arch, &idle_vcpu[0]->arch, sizeof(v->arch)); v->arch.flags = TF_kernel_mode; if ( is_idle_domain(d) ) - { percpu_ctxt[vcpu_id].curr_vcpu = v; - v->arch.schedule_tail = continue_idle_domain; - } if ( (v->vcpu_id = vcpu_id) != 0 ) { @@ -333,10 +329,11 @@ int arch_do_createdomain(struct vcpu *v) memset(d->shared_info, 0, PAGE_SIZE); v->vcpu_info = &d->shared_info->vcpu_info[v->vcpu_id]; SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d); - - v->arch.schedule_tail = continue_nonidle_domain; } + v->arch.schedule_tail = is_idle_domain(d) ? + continue_idle_domain : continue_nonidle_domain; + return 0; fail_nomem: