Commit cd613aaa2d48ac39812da203d386d5cf8b8dbd97

Authored by Lucas Stach
Committed by Tero Kristo
1 parent 6d749b28cf

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

commit bbeb9209515989ff47802d4e5d5702178c8e42c4 upstream.

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>
Signed-off-by: Nishanth Menon <nm@ti.com>

Showing 3 changed files with 14 additions and 0 deletions Side-by-side Diff

arch/arm/include/asm/irqflags.h
... ... @@ -51,7 +51,15 @@
51 51  
52 52 #define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc")
53 53 #define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc")
  54 +
  55 +#ifndef CONFIG_CPU_V7M
  56 +#define local_abt_enable() __asm__("cpsie a @ __sta" : : : "memory", "cc")
  57 +#define local_abt_disable() __asm__("cpsid a @ __cla" : : : "memory", "cc")
54 58 #else
  59 +#define local_abt_enable() do { } while (0)
  60 +#define local_abt_disable() do { } while (0)
  61 +#endif
  62 +#else
55 63  
56 64 /*
57 65 * Save the current interrupt enable state & disable IRQs
... ... @@ -130,6 +138,8 @@
130 138 : "memory", "cc"); \
131 139 })
132 140  
  141 +#define local_abt_enable() do { } while (0)
  142 +#define local_abt_disable() do { } while (0)
133 143 #endif
134 144  
135 145 /*
arch/arm/kernel/smp.c
... ... @@ -385,6 +385,7 @@
385 385  
386 386 local_irq_enable();
387 387 local_fiq_enable();
  388 + local_abt_enable();
388 389  
389 390 /*
390 391 * OK, it's off to the idle thread for us
... ... @@ -1313,6 +1313,9 @@
1313 1313 */
1314 1314 local_flush_tlb_all();
1315 1315 flush_cache_all();
  1316 +
  1317 + /* Enable asynchronous aborts */
  1318 + local_abt_enable();
1316 1319 }
1317 1320  
1318 1321 static void __init kmap_init(void)