From: Julien Grall Date: Wed, 24 Jul 2013 17:01:36 +0000 (+0100) Subject: xen/arm: Initialize PERCPU variables at the beginning of start_xen X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6603 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c433774a6ea84c46c25fdf8ef7e2657aaf2c7f2b;p=xen.git 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 Acked-by: Ian Campbell Acked-by: Tim Deegan [ ijc -- added last para of commit message ] --- 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;