浏览代码

ARM: 8422/1: enable imprecise aborts during early kernel startup

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>
Lucas Stach 10 年之前
父节点
当前提交
bbeb920951
共有 3 个文件被更改,包括 14 次插入0 次删除
  1. 10 0
      arch/arm/include/asm/irqflags.h
  2. 1 0
      arch/arm/kernel/smp.c
  3. 3 0
      arch/arm/mm/mmu.c

+ 10 - 0
arch/arm/include/asm/irqflags.h

@@ -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_enable()  __asm__("cpsie f	@ __stf" : : : "memory", "cc")
 #define local_fiq_disable() __asm__("cpsid f	@ __clf" : : : "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
 #else
 
 
 /*
 /*
@@ -136,6 +144,8 @@ static inline void arch_local_irq_disable(void)
 	: "memory", "cc");					\
 	: "memory", "cc");					\
 	})
 	})
 
 
+#define local_abt_enable()	do { } while (0)
+#define local_abt_disable()	do { } while (0)
 #endif
 #endif
 
 
 /*
 /*

+ 1 - 0
arch/arm/kernel/smp.c

@@ -400,6 +400,7 @@ asmlinkage void secondary_start_kernel(void)
 
 
 	local_irq_enable();
 	local_irq_enable();
 	local_fiq_enable();
 	local_fiq_enable();
+	local_abt_enable();
 
 
 	/*
 	/*
 	 * OK, it's off to the idle thread for us
 	 * OK, it's off to the idle thread for us

+ 3 - 0
arch/arm/mm/mmu.c

@@ -1363,6 +1363,9 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
 	 */
 	 */
 	local_flush_tlb_all();
 	local_flush_tlb_all();
 	flush_cache_all();
 	flush_cache_all();
+
+	/* Enable asynchronous aborts */
+	local_abt_enable();
 }
 }
 
 
 static void __init kmap_init(void)
 static void __init kmap_init(void)