From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, ian.campbell@citrix.com,
Julien Grall <julien.grall@linaro.org>,
stefano.stabellini@eu.citrix.com
Subject: [PATCH v3 6/6] xen/arm: Use the hardware ID to boot correctly secondary cpus
Date: Wed, 18 Sep 2013 14:15:22 +0100 [thread overview]
Message-ID: <1379510122-9467-7-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1379510122-9467-1-git-send-email-julien.grall@linaro.org>
Secondary CPUs will spin in head.S until their MPIDR[23:0] correspond to
the smp_up_cpu. Actually Xen will set the value with the logical CPU ID
which is wrong. Use the cpu_logical_map to get the correct CPU ID.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
Changes in v2:
- Replace Acked-by by a s-o-b
- s/TMP/to in commit title
---
xen/arch/arm/smpboot.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index c0d25de..1952287 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -124,8 +124,7 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
for ( i = 1; i < max_cpus; i++ )
{
/* Tell the next CPU to get ready */
- /* TODO: handle boards where CPUIDs are not contiguous */
- *gate = i;
+ *gate = cpu_logical_map(i);
flush_xen_dcache(*gate);
isb();
sev();
@@ -139,11 +138,22 @@ make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
/* Boot the current CPU */
void __cpuinit start_secondary(unsigned long boot_phys_offset,
unsigned long fdt_paddr,
- unsigned long cpuid)
+ unsigned long hwid)
{
+ unsigned int cpuid;
+
memset(get_cpu_info(), 0, sizeof (struct cpu_info));
- /* TODO: handle boards where CPUIDs are not contiguous */
+ /* Browse the logical map and find the associate logical cpu ID */
+ for ( cpuid = 1; cpuid < nr_cpu_ids; cpuid++ )
+ {
+ if ( cpu_logical_map(cpuid) == hwid )
+ break;
+ }
+
+ if ( cpuid == nr_cpu_ids )
+ panic("Can't find logical CPU id for cpu MPIDR[23:0] = 0x%lx\n", hwid);
+
set_processor_id(cpuid);
current_cpu_data = boot_cpu_data;
@@ -232,7 +242,7 @@ int __cpu_up(unsigned int cpu)
/* Unblock the CPU. It should be waiting in the loop in head.S
* for an event to arrive when smp_up_cpu matches its cpuid. */
- smp_up_cpu = cpu;
+ smp_up_cpu = cpu_logical_map(cpu);
/* we need to make sure that the change to smp_up_cpu is visible to
* secondary cpus with D-cache off */
flush_xen_dcache(smp_up_cpu);
--
1.7.10.4
next prev parent reply other threads:[~2013-09-18 13:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 13:15 [PATCH v3 0/6] Dissociate logical and gic/hardware CPU ID Julien Grall
2013-09-18 13:15 ` [PATCH v3 1/6] xen/arm: use cpumask_t to describe cpu mask in gic_route_dt_irq Julien Grall
2013-09-25 15:36 ` Ian Campbell
2013-09-18 13:15 ` [PATCH v3 2/6] xen/arm: Initialize correctly IRQ routing Julien Grall
2013-09-25 15:37 ` Ian Campbell
2013-09-18 13:15 ` [PATCH v3 3/6] xen/arm: gic: Use the correct CPU ID Julien Grall
2013-09-20 12:44 ` Julien Grall
2013-09-20 13:36 ` Ian Campbell
2013-09-20 13:49 ` Julien Grall
2013-09-20 15:03 ` Julien Grall
2013-09-20 15:44 ` Ian Campbell
2013-09-20 15:58 ` Julien Grall
2013-09-20 16:06 ` Ian Campbell
2013-09-20 18:48 ` Julien Grall
2013-09-25 15:35 ` Ian Campbell
2013-09-25 15:42 ` Julien Grall
2013-09-25 15:48 ` Ian Campbell
2013-09-25 15:53 ` Ian Campbell
2013-09-25 16:34 ` Tim Deegan
2013-09-18 13:15 ` [PATCH v3 4/6] xen/arm: Fix assert in send_SGI_one Julien Grall
2013-09-25 15:37 ` Ian Campbell
2013-09-18 13:15 ` [PATCH v3 5/6] xen/arm: Dissociate logical and hardware CPU ID Julien Grall
2013-09-25 15:38 ` Ian Campbell
2013-09-18 13:15 ` Julien Grall [this message]
2013-09-25 15:41 ` [PATCH v3 6/6] xen/arm: Use the hardware ID to boot correctly secondary cpus Ian Campbell
2013-09-26 10:18 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379510122-9467-7-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=patches@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).