]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: 8422/1: enable imprecise aborts during early kernel startup
authorLucas Stach <l.stach@pengutronix.de>
Tue, 25 Aug 2015 12:52:09 +0000 (13:52 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 22 Sep 2015 07:13:56 +0000 (08:13 +0100)
This patch adds imprecise abort enable/disable macros and uses them to
enable imprecise aborts early when starting the kernel.

This helps in tracking down the real cause for such imprecise abort, as
they are handled as soon as they occur. Until now those aborts would
only be enabled when entering the userspace and as a consequence crash
the first userspace process if any abort had been raised during kernel
startup.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/irqflags.h
arch/arm/kernel/smp.c
arch/arm/mm/mmu.c

index 43908146a5cf05c473967d603247a792f73b5663..e6b70d9d084ea5d369c237f9a3f81c92e331a429 100644 (file)
@@ -54,6 +54,14 @@ static inline void arch_local_irq_disable(void)
 
 #define local_fiq_enable()  __asm__("cpsie f   @ __stf" : : : "memory", "cc")
 #define local_fiq_disable() __asm__("cpsid f   @ __clf" : : : "memory", "cc")
+
+#ifndef CONFIG_CPU_V7M
+#define local_abt_enable()  __asm__("cpsie a   @ __sta" : : : "memory", "cc")
+#define local_abt_disable() __asm__("cpsid a   @ __cla" : : : "memory", "cc")
+#else
+#define local_abt_enable()     do { } while (0)
+#define local_abt_disable()    do { } while (0)
+#endif
 #else
 
 /*
@@ -136,6 +144,8 @@ static inline void arch_local_irq_disable(void)
        : "memory", "cc");                                      \
        })
 
+#define local_abt_enable()     do { } while (0)
+#define local_abt_disable()    do { } while (0)
 #endif
 
 /*
index 48185a773852d4ec501702ae3a6471d38b03ce10..36045e8ced01a829069f642f4078337d4da21781 100644 (file)
@@ -400,6 +400,7 @@ asmlinkage void secondary_start_kernel(void)
 
        local_irq_enable();
        local_fiq_enable();
+       local_abt_enable();
 
        /*
         * OK, it's off to the idle thread for us
index 7cd15143a507740155ad6dbe01e3dbef371111fe..f65a6f344b6dcdf6c3d23edf226b44ab8e2ee092 100644 (file)
@@ -1363,6 +1363,9 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
         */
        local_flush_tlb_all();
        flush_cache_all();
+
+       /* Enable asynchronous aborts */
+       local_abt_enable();
 }
 
 static void __init kmap_init(void)