From: Ian Campbell Subject: Re: [PATCH v3 02/13] xen/arm: allocate secondaries dom0 vcpus Date: Thu, 25 Apr 2013 11:08:12 +0100 Message-ID: <1366884492.20256.451.camel@zakaz.uk.xensource.com> References: <1366830463-12153-2-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366830463-12153-2-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Julien Grall , "xen-devel@lists.xensource.com" , "Tim (Xen.org)" List-Id: xen-devel@lists.xenproject.org On Wed, 2013-04-24 at 20:07 +0100, Stefano Stabellini wrote: > Signed-off-by: Stefano Stabellini > --- > xen/arch/arm/domain_build.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index a6d8e9d..5dfa592 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -363,7 +363,7 @@ static void dtb_load(struct kernel_info *kinfo) > int construct_dom0(struct domain *d) > { > struct kernel_info kinfo = {}; > - int rc; > + int rc, i, cpu = 0; I don't think you need to init cpu here. > struct vcpu *v = d->vcpu[0]; > struct cpu_user_regs *regs = &v->arch.cpu_info->guest_cpu_user_regs; > @@ -451,6 +451,12 @@ int construct_dom0(struct domain *d) > } > #endif > > + for ( i = 1; i < d->max_vcpus; i++ ) > + { > + cpu = cpumask_cycle(cpu, &cpu_online_map); > + (void)alloc_vcpu(d, i, cpu); Some sort of print on the first failure would be nice, or to be honest looking at the sorts of failure modes alloc_vcpu has just bailing on the whole thing might be best. > + } > + > local_abort_enable(); Aside: I wonder what led this to get put here. It doesn't happen on non-boot CPUs for one thing! Ian.