From: Ian Campbell Subject: Re: [PATCH v2] xen/arm: Init traps very early Date: Fri, 27 Jun 2014 14:37:02 +0100 Message-ID: <1403876222.3169.43.camel@kazak.uk.xensource.com> References: <1403186536-17770-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: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X0WLM-0003rl-P5 for xen-devel@lists.xenproject.org; Fri, 27 Jun 2014 13:37:32 +0000 In-Reply-To: <1403186536-17770-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: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com, Naresh Bhat List-Id: xen-devel@lists.xenproject.org On Thu, 2014-06-19 at 15:02 +0100, Julien Grall wrote: > The function init_traps setups the handler taken when Xen hits a BUG_ON/ASSERT. "sets up" > If an error happen before init_traps is called, we loose the backtrace. "lose" > > When a trap is taken from HYP mode, we need to: > - get the processor ID, percpu has to be initialized and the > smp_processor_id correctly set. Wrapping. > - initialize current, even tho it's not used for the time being. Move the "though" > debug sanity ealier. "earlier" > > Signed-off-by: Julien Grall > Tested-by: Naresh Bhat > > --- > Changes in v2: > - Update a comment in the code to explain why we need to be set > early. > - Move the call after smp_processor_id as it's requires to be > there. > - Move set_current(...) ealier > --- > xen/arch/arm/setup.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c > index b9ce7a9..8c505cb 100644 > --- a/xen/arch/arm/setup.c > +++ b/xen/arch/arm/setup.c > @@ -670,6 +670,12 @@ void __init start_xen(unsigned long 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; > + > + /* Initialize traps early allow us to get backtrace when an error occured */ "occurred". Typos fixed + acked + applied. > + init_traps(); > + > smp_clear_cpu_maps(); > > /* This is mapped by head.S */ > @@ -706,11 +712,6 @@ void __init start_xen(unsigned long boot_phys_offset, > > gic_init(); > > - set_current((struct vcpu *)0xfffff000); /* debug sanity */ > - idle_vcpu[0] = current; > - > - init_traps(); > - > setup_virt_paging(); > > p2m_vmid_allocator_init();