From: Chen Baozi Subject: [PATCH V2 8/8] xen/arm: Set logical CPUID in DT node for dom0 the same as MPIDR Date: Sat, 23 May 2015 21:52:33 +0800 Message-ID: <1432389153-28207-9-git-send-email-cbz@baozis.org> References: <1432389153-28207-1-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yw9s0-0007gX-7Y for xen-devel@lists.xenproject.org; Sat, 23 May 2015 13:53:44 +0000 In-Reply-To: <1432389153-28207-1-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: xen-devel@lists.xenproject.org Cc: Julien Grall , Chen Baozi , Ian Campbell List-Id: xen-devel@lists.xenproject.org From: Chen Baozi This patch does the same thing as the previous one but for dom0 kernel. Signed-off-by: Chen Baozi --- xen/arch/arm/domain_build.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index a156de9..28b4f75 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 cpu_id; DPRINT("Create cpus node\n"); @@ -761,9 +762,13 @@ 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); + /* + * Linux kernel assumes that MPIDR is equal to logical CPUID + */ + cpu_id = vcpuid_to_vaffinity(cpu); + DPRINT("Create cpu@%x node\n", cpu_id); - snprintf(buf, sizeof(buf), "cpu@%u", cpu); + snprintf(buf, sizeof(buf), "cpu@%x", cpu_id); res = fdt_begin_node(fdt, buf); if ( res ) return res; @@ -776,7 +781,7 @@ static int make_cpus_node(const struct domain *d, void *fdt, if ( res ) return res; - res = fdt_property_cell(fdt, "reg", cpu); + res = fdt_property_cell(fdt, "reg", cpu_id); if ( res ) return res; -- 2.1.4