From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH V6 06/10] tools/libxl: Set 'reg' of cpu node equal to MPIDR affinity for domU Date: Fri, 5 Jun 2015 17:12:35 +0100 Message-ID: <1433520755.7108.340.camel@citrix.com> References: <1433163388-16970-1-git-send-email-cbz@baozis.org> <1433163388-16970-7-git-send-email-cbz@baozis.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z0uEc-00043o-3V for xen-devel@lists.xenproject.org; Fri, 05 Jun 2015 16:12:42 +0000 In-Reply-To: <1433163388-16970-7-git-send-email-cbz@baozis.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chen Baozi Cc: Julien Grall , xen-devel@lists.xenproject.org, Chen Baozi List-Id: xen-devel@lists.xenproject.org On Mon, 2015-06-01 at 20:56 +0800, 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 > Reviewed-by: Julien Grall Actually, please ignore previous ack. [...] > + uint64_t mpidr_aff; [...] > + name = GCSPRINTF("cpu@%lx", mpidr_aff); The correct format specifier for a uint64_t is "%"PRIx64", otherwise you will break 32 bit build. With that changed you can put the ack back... Ian. > > res = fdt_begin_node(fdt, name); > if (res) return res; > @@ -297,7 +307,7 @@ static int make_cpus_node(libxl__gc *gc, void *fdt, int nr_cpus, > res = fdt_property_string(fdt, "enable-method", "psci"); > if (res) return res; > > - res = fdt_property_regs(gc, fdt, 1, 0, 1, (uint64_t)i); > + res = fdt_property_regs(gc, fdt, 1, 0, 1, mpidr_aff); > if (res) return res; > > res = fdt_end_node(fdt);