Skip to contentSkip to conversation

xen: arm: Call init_xen_time earlier

PATCH In review Ian Campbell 2 participants 3 messages Dec 17, 2012 – Dec 19, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: arm: Call init_xen_time earlier

If we panic before calling init_xen_time then the "Rebooting in 5 seconds" delay ends up calling udelay which uses cntfrq before it has been initialised resulting in a divide by zero.

---
 xen/arch/arm/setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
xen/arch/arm/setup.c +2 -2
index 2076724..7b0a0f6 100644
@@ -219,6 +219,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
+    init_xen_time();
+
     gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
@@ -227,8 +229,6 @@ void __init start_xen(unsigned long boot_phys_offset,
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    init_xen_time();
-
     setup_mm(atag_paddr, fdt_size);
 
     /* Setup Hyp vector base */
Signature · 1 line
1.7.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Ian Campbell

If we panic before calling init_xen_time then the "Rebooting in 5 seconds" delay ends up calling udelay which uses cntfrq before it has been initialised resulting in a divide by zero.

Quoted 34 lines
 xen/arch/arm/setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
xen/arch/arm/setup.c +2 -2
index 2076724..7b0a0f6 100644
@@ -219,6 +219,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     console_init_preirq();
 #endif
 
+    init_xen_time();
+
     gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
@@ -227,8 +229,6 @@ void __init start_xen(unsigned long boot_phys_offset,
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    init_xen_time();
-
     setup_mm(atag_paddr, fdt_size);
 
     /* Setup Hyp vector base */
Signature · 7 lines
1.7.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel