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 ]
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
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;