]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: Init traps very early
authorJulien Grall <julien.grall@linaro.org>
Thu, 19 Jun 2014 14:02:16 +0000 (15:02 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 27 Jun 2014 13:13:22 +0000 (14:13 +0100)
The function init_traps sets up the handler taken when Xen hits a
BUG_ON/ASSERT.

If an error happen before init_traps is called, we lose the backtrace.

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.
    - initialize current, even though it's not used for the time being. Move
      the debug sanity earlier.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Tested-by: Naresh Bhat <naresh.bhat@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- fixed typos and rewrapped commit log ]

xen/arch/arm/setup.c

index b9ce7a939e921e0e78977077bdfac348b8a534c1..78dc7f5fc56b7b93876c0fb3bf071a0bff1b3294 100644 (file)
@@ -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 occurred */
+    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();