Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lucas Stach and committed by
Russell King
bbeb9209 1f93e4a9

+14
+10
arch/arm/include/asm/irqflags.h
··· 54 54 55 55 #define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc") 56 56 #define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc") 57 + 58 + #ifndef CONFIG_CPU_V7M 59 + #define local_abt_enable() __asm__("cpsie a @ __sta" : : : "memory", "cc") 60 + #define local_abt_disable() __asm__("cpsid a @ __cla" : : : "memory", "cc") 61 + #else 62 + #define local_abt_enable() do { } while (0) 63 + #define local_abt_disable() do { } while (0) 64 + #endif 57 65 #else 58 66 59 67 /* ··· 144 136 : "memory", "cc"); \ 145 137 }) 146 138 139 + #define local_abt_enable() do { } while (0) 140 + #define local_abt_disable() do { } while (0) 147 141 #endif 148 142 149 143 /*
+1
arch/arm/kernel/smp.c
··· 400 400 401 401 local_irq_enable(); 402 402 local_fiq_enable(); 403 + local_abt_enable(); 403 404 404 405 /* 405 406 * OK, it's off to the idle thread for us
+3
arch/arm/mm/mmu.c
··· 1363 1363 */ 1364 1364 local_flush_tlb_all(); 1365 1365 flush_cache_all(); 1366 + 1367 + /* Enable asynchronous aborts */ 1368 + local_abt_enable(); 1366 1369 } 1367 1370 1368 1371 static void __init kmap_init(void)