From: Tim Deegan Subject: Re: [PATCH] xen/arm: Initialize PERCPU variables at the beginning of start_xen Date: Mon, 29 Jul 2013 16:34:48 +0100 Message-ID: <20130729153448.GK37169@ocelot.phlegethon.org> References: <1374685296-31812-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1374685296-31812-1-git-send-email-julien.grall@linaro.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: Julien Grall Cc: patches@linaro.org, ian.campbell@citrix.com, Stefano.Stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 18:01 +0100 on 24 Jul (1374688896), Julien Grall wrote: > 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. > > Signed-off-by: Julien Grall Acked-by: Tim Deegan > --- > xen/arch/arm/setup.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c > index 2f9fdc8..1ec5e38 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; > > -- > 1.7.10.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel