Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9f336a53266f43ae1002f4aaad5373944589c828
Commit:     9f336a53266f43ae1002f4aaad5373944589c828
Parent:     15b3ad6a4b348ea53ea1a45f9b166ac31c4b3f39
Author:     Robin Getz <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 29 18:23:28 2007 +0800
Committer:  Bryan Wu <[EMAIL PROTECTED]>
CommitDate: Mon Oct 29 18:23:28 2007 +0800

    Blackfin arch: ensure that speculative loads of bad pointers don't cause us 
to do bad things.
    
    Fix/change formatting of a few more things.
    
    Signed-off-by: Robin Getz <[EMAIL PROTECTED]>
    Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/kernel/fixed_code.S  |   14 ++++++++++++++
 arch/blackfin/kernel/setup.c       |    2 ++
 arch/blackfin/mach-common/entry.S  |    2 +-
 include/asm-blackfin/bfin-global.h |    1 +
 include/asm-blackfin/fixed_code.h  |    4 +++-
 5 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/kernel/fixed_code.S 
b/arch/blackfin/kernel/fixed_code.S
index d8b1ebc..9026269 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 fc22ec8..934234f 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();
diff --git a/arch/blackfin/mach-common/entry.S 
b/arch/blackfin/mach-common/entry.S
index e3ad580..1b13fa4 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -917,7 +917,7 @@ ENTRY(_ex_table)
        .long _ex_soft_bp       /* 0x01 - User Defined - Software breakpoint */
        .long _ex_replaceable   /* 0x02 - User Defined */
        .long _ex_trap_c        /* 0x03 - User Defined - userspace stack 
overflow */
-       .long _ex_replaceable   /* 0x04 - User Defined */
+       .long _ex_trap_c        /* 0x04 - User Defined - dump trace buffer */
        .long _ex_replaceable   /* 0x05 - User Defined */
        .long _ex_replaceable   /* 0x06 - User Defined */
        .long _ex_replaceable   /* 0x07 - User Defined */
diff --git a/include/asm-blackfin/bfin-global.h 
b/include/asm-blackfin/bfin-global.h
index 14cb8d3..0212e18 100644
--- a/include/asm-blackfin/bfin-global.h
+++ b/include/asm-blackfin/bfin-global.h
@@ -80,6 +80,7 @@ extern int atomic_sub32(void);
 extern int atomic_ior32(void);
 extern int atomic_and32(void);
 extern int atomic_xor32(void);
+extern void safe_user_instruction(void);
 extern void sigreturn_stub(void);
 
 extern void *l1_data_A_sram_alloc(size_t);
diff --git a/include/asm-blackfin/fixed_code.h 
b/include/asm-blackfin/fixed_code.h
index e6df84e..37db66c 100644
--- a/include/asm-blackfin/fixed_code.h
+++ b/include/asm-blackfin/fixed_code.h
@@ -17,4 +17,6 @@
 
 #define ATOMIC_SEQS_END                0x480
 
-#define FIXED_CODE_END         0x480
+#define SAFE_USER_INSTRUCTION   0x480
+
+#define FIXED_CODE_END         0x490
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to