aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--arch/blackfin/kernel/fixed_code.S14
-rw-r--r--arch/blackfin/kernel/setup.c2
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/fixed_code.S b/arch/blackfin/kernel/fixed_code.S
index d8b1ebc70996..90262691b11a 100644
--- a/arch/blackfin/kernel/fixed_code.S
+++ b/arch/blackfin/kernel/fixed_code.S
@@ -129,4 +129,18 @@ ENTRY(_atomic_xor32)
rts;
ENDPROC (_atomic_ior32)
+.align 16
+ /*
+ * safe_user_instruction
+ * Four NOPS are enough to allow the pipeline to speculativily load
+ * execute anything it wants. After that, things have gone bad, and
+ * we are stuck - so panic. Since we might be in user space, we can't
+ * call panic, so just cause a unhandled exception, this should cause
+ * a dump of the trace buffer so we can tell were we are, and a reboot
+ */
+ENTRY(_safe_user_instruction)
+ NOP; NOP; NOP; NOP;
+ EXCPT 0x4;
+ENDPROC(_safe_user_instruction)
+
ENTRY(_fixed_code_end)
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index fc22ec8c2f47..934234f43839 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -431,6 +431,8 @@ void __init setup_arch(char **cmdline_p)
!= ATOMIC_AND32 - FIXED_CODE_START);
BUG_ON((char *)&atomic_xor32 - (char *)&fixed_code_start
!= ATOMIC_XOR32 - FIXED_CODE_START);
+ BUG_ON((char *)&safe_user_instruction - (char *)&fixed_code_start
+ != SAFE_USER_INSTRUCTION - FIXED_CODE_START);
init_exception_vectors();
bf53x_cache_init();