From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Baozi Subject: Re: [PATCH V4 6/8] xen/arm: Set 'reg' of cpu node for dom0 to match MPIDR's affinity Date: Sat, 30 May 2015 10:10:17 +0800 Message-ID: <20150530021017.GC15126@cbz-thinkpad> References: <1432808109-31466-1-git-send-email-cbz@baozis.org> <1432808109-31466-7-git-send-email-cbz@baozis.org> <55688A96.1050206@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YyWDi-0007S6-Ay for xen-devel@lists.xenproject.org; Sat, 30 May 2015 02:09:54 +0000 Content-Disposition: inline In-Reply-To: <55688A96.1050206@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: Julien Grall Cc: xen-devel@lists.xenproject.org, Ian Campbell List-Id: xen-devel@lists.xenproject.org On Fri, May 29, 2015 at 04:49:42PM +0100, Julien Grall wrote: > Hi Chen, > > On 28/05/15 11:15, Chen Baozi wrote: > > From: Chen Baozi > > > > According to ARM CPUs bindings, the reg field should match the MPIDR's > > affinity bits. We will use AFF0 and AFF1 when constructing the reg value > > of the guest at the moment, for it is enough for the current max vcpu > > number. > > > > Signed-off-by: Chen Baozi > > --- > > xen/arch/arm/domain_build.c | 14 +++++++++++--- > > 1 file changed, 11 insertions(+), 3 deletions(-) > > > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > > index a156de9..5591d82 100644 > > --- a/xen/arch/arm/domain_build.c > > +++ b/xen/arch/arm/domain_build.c > > @@ -712,6 +712,7 @@ static int make_cpus_node(const struct domain *d, void *fdt, > > char buf[15]; > > u32 clock_frequency; > > bool_t clock_valid; > > + uint32_t mpidr_aff; > > > > DPRINT("Create cpus node\n"); > > > > @@ -761,9 +762,16 @@ static int make_cpus_node(const struct domain *d, void *fdt, > > > > for ( cpu = 0; cpu < d->max_vcpus; cpu++ ) > > { > > - DPRINT("Create cpu@%u node\n", cpu); > > + /* > > + * According to ARM CPUs bindings, the reg field should match > > + * the MPIDR's affinity bits. We will use AFF0 and AFF1 when > > + * constructing the reg value of the guest at the moment, for it > > + * is enough for the current max vcpu number. > > + */ > > + mpidr_aff = vcpuid_to_vaffinity(cpu); > > + DPRINT("Create cpu@%x node\n", mpidr_aff); > > I would print both the "logical CPUID" and the MPIDR. It will be easier > for debugging. Ok. > > > > > - snprintf(buf, sizeof(buf), "cpu@%u", cpu); > > + snprintf(buf, sizeof(buf), "cpu@%x", mpidr_aff); > > Changing cpu@ is not necessary. See my previous comment about this. Cheers, Baozi.