aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/arm/setup.c
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@linaro.org>2013-07-24 18:01:36 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-07-29 16:54:39 +0100
commitc433774a6ea84c46c25fdf8ef7e2657aaf2c7f2b (patch)
tree6097b8fafd3e5625429a860ac7245033800357f3 /xen/arch/arm/setup.c
parentfc8dbb8b4546b31e0b7d1a7d84d00e02319f245a (diff)
downloadxen-c433774a6ea84c46c25fdf8ef7e2657aaf2c7f2b.tar.gz
xen-c433774a6ea84c46c25fdf8ef7e2657aaf2c7f2b.tar.bz2
xen-c433774a6ea84c46c25fdf8ef7e2657aaf2c7f2b.zip
xen/arm: Initialize PERCPU variables at the beginning of start_xen
PERCPU variables rely on HTPIDR (TPIDR_EL2) which is in an unknown state when a processor boot. For the boot CPU, the first use of PERCPU is in setup_pagetables. So initialize PERCPU and set the processor ID before. Bamvor Jian Zhang observed this failure on the sun6i processor which does not initialise HTPIDR and contributed a very similar patch. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> [ ijc -- added last para of commit message ]
Diffstat (limited to 'xen/arch/arm/setup.c')
-rw-r--r--xen/arch/arm/setup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 2f9fdc805e..1ec5e389a1 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -428,6 +428,9 @@ void __init start_xen(unsigned long boot_phys_offset,
setup_cache();
+ percpu_init_areas();
+ set_processor_id(0); /* needed early, for smp_processor_id() */
+
smp_clear_cpu_maps();
device_tree_flattened = (void *)BOOT_MISC_VIRT_START
@@ -458,8 +461,6 @@ void __init start_xen(unsigned long boot_phys_offset,
gic_init();
make_cpus_ready(cpus, boot_phys_offset);
- percpu_init_areas();
- set_processor_id(0); /* needed early, for smp_processor_id() */
set_current((struct vcpu *)0xfffff000); /* debug sanity */
idle_vcpu[0] = current;