aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorRobin Getz <robin.getz@analog.com>2007-11-12 09:21:30 -0500
committerBryan Wu <bryan.wu@analog.com>2007-11-12 09:21:30 -0500
commitf26fbc48f130962fce15f37d079968f0f272e0c2 (patch)
treef92bda683343140b2ccf51b40c5dad71154b1595 /arch/blackfin
parent2ffbb8377c7a0713baf6644e285adc27a5654582 (diff)
Blackfin arch: ensure we work around ANOMALY_05000261 for null pointers
We currently do not. Also make it easier to handle cplb violations - in traps.c Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/traps.c10
-rw-r--r--arch/blackfin/mach-common/entry.S38
2 files changed, 33 insertions, 15 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index cfa05436c972..aaddb724a5fb 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -311,11 +311,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
311 printk(KERN_NOTICE EXC_0x22); 311 printk(KERN_NOTICE EXC_0x22);
312 CHK_DEBUGGER_TRAP(); 312 CHK_DEBUGGER_TRAP();
313 break; 313 break;
314 /* 0x23 - Data CPLB Protection Violation, 314 /* 0x23 - Data CPLB protection violation, handled here */
315 normal case is handled in _cplb_hdr */
316 case VEC_CPLB_VL: 315 case VEC_CPLB_VL:
317 info.si_code = ILL_CPLB_VI; 316 info.si_code = ILL_CPLB_VI;
318 sig = SIGILL; 317 sig = SIGBUS;
319 printk(KERN_NOTICE EXC_0x23); 318 printk(KERN_NOTICE EXC_0x23);
320 CHK_DEBUGGER_TRAP(); 319 CHK_DEBUGGER_TRAP();
321 break; 320 break;
@@ -382,11 +381,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
382 printk(KERN_NOTICE EXC_0x2A); 381 printk(KERN_NOTICE EXC_0x2A);
383 CHK_DEBUGGER_TRAP(); 382 CHK_DEBUGGER_TRAP();
384 break; 383 break;
385 /* 0x2B - Instruction CPLB protection Violation, 384 /* 0x2B - Instruction CPLB protection violation, handled here */
386 handled in _cplb_hdr */
387 case VEC_CPLB_I_VL: 385 case VEC_CPLB_I_VL:
388 info.si_code = ILL_CPLB_VI; 386 info.si_code = ILL_CPLB_VI;
389 sig = SIGILL; 387 sig = SIGBUS;
390 printk(KERN_NOTICE EXC_0x2B); 388 printk(KERN_NOTICE EXC_0x2B);
391 CHK_DEBUGGER_TRAP(); 389 CHK_DEBUGGER_TRAP();
392 break; 390 break;
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 1b13fa470977..54712f9a60ac 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -71,13 +71,18 @@ ENDPROC(_safe_speculative_execution)
71 * This one does not lower the level to IRQ5, and thus can be used to 71 * This one does not lower the level to IRQ5, and thus can be used to
72 * patch up CPLB misses on the kernel stack. 72 * patch up CPLB misses on the kernel stack.
73 */ 73 */
74ENTRY(_ex_dcplb)
75#if ANOMALY_05000261 74#if ANOMALY_05000261
75#define _ex_dviol _ex_workaround_261
76#define _ex_dmiss _ex_workaround_261
77#define _ex_dmult _ex_workaround_261
78
79ENTRY(_ex_workaround_261)
76 /* 80 /*
77 * Work around an anomaly: if we see a new DCPLB fault, return 81 * Work around an anomaly: if we see a new DCPLB fault, return
78 * without doing anything. Then, if we get the same fault again, 82 * without doing anything. Then, if we get the same fault again,
79 * handle it. 83 * handle it.
80 */ 84 */
85 P4 = R7; /* Store EXCAUSE */
81 p5.l = _last_cplb_fault_retx; 86 p5.l = _last_cplb_fault_retx;
82 p5.h = _last_cplb_fault_retx; 87 p5.h = _last_cplb_fault_retx;
83 r7 = [p5]; 88 r7 = [p5];
@@ -86,10 +91,24 @@ ENTRY(_ex_dcplb)
86 cc = r6 == r7; 91 cc = r6 == r7;
87 if !cc jump _return_from_exception; 92 if !cc jump _return_from_exception;
88 /* fall through */ 93 /* fall through */
94 R7 = P4;
95 R6 = 0x26; /* Data CPLB Miss */
96 cc = R6 == R7;
97 if cc jump _ex_dcplb_miss (BP);
98 /* Handle 0x23 Data CPLB Protection Violation
99 * and Data CPLB Multiple Hits - Linux Trap Zero
100 */
101 jump _ex_trap_c;
102ENDPROC(_ex_workaround_261)
103
104#else
105#define _ex_dviol _ex_trap_c
106#define _ex_dmiss _ex_dcplb_miss
107#define _ex_dmult _ex_trap_c
89#endif 108#endif
90ENDPROC(_ex_dcplb)
91 109
92ENTRY(_ex_icplb) 110ENTRY(_ex_dcplb_miss)
111ENTRY(_ex_icplb_miss)
93 (R7:6,P5:4) = [sp++]; 112 (R7:6,P5:4) = [sp++];
94 ASTAT = [sp++]; 113 ASTAT = [sp++];
95 SAVE_ALL_SYS 114 SAVE_ALL_SYS
@@ -98,7 +117,7 @@ ENTRY(_ex_icplb)
98 RESTORE_ALL_SYS 117 RESTORE_ALL_SYS
99 SP = EX_SCRATCH_REG; 118 SP = EX_SCRATCH_REG;
100 rtx; 119 rtx;
101ENDPROC(_ex_icplb) 120ENDPROC(_ex_icplb_miss)
102 121
103ENTRY(_ex_syscall) 122ENTRY(_ex_syscall)
104 DEBUG_START_HWTRACE(p5, r7) 123 DEBUG_START_HWTRACE(p5, r7)
@@ -908,6 +927,7 @@ ENDPROC(_early_trap)
908#else 927#else
909.data 928.data
910#endif 929#endif
930
911ENTRY(_ex_table) 931ENTRY(_ex_table)
912 /* entry for each EXCAUSE[5:0] 932 /* entry for each EXCAUSE[5:0]
913 * This table must be in sync with the table in ./kernel/traps.c 933 * This table must be in sync with the table in ./kernel/traps.c
@@ -952,16 +972,16 @@ ENTRY(_ex_table)
952 .long _ex_trap_c /* 0x20 - Reserved */ 972 .long _ex_trap_c /* 0x20 - Reserved */
953 .long _ex_trap_c /* 0x21 - Undefined Instruction */ 973 .long _ex_trap_c /* 0x21 - Undefined Instruction */
954 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */ 974 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
955 .long _ex_dcplb /* 0x23 - Data CPLB Protection Violation */ 975 .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */
956 .long _ex_trap_c /* 0x24 - Data access misaligned */ 976 .long _ex_trap_c /* 0x24 - Data access misaligned */
957 .long _ex_trap_c /* 0x25 - Unrecoverable Event */ 977 .long _ex_trap_c /* 0x25 - Unrecoverable Event */
958 .long _ex_dcplb /* 0x26 - Data CPLB Miss */ 978 .long _ex_dmiss /* 0x26 - Data CPLB Miss */
959 .long _ex_trap_c /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */ 979 .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
960 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */ 980 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
961 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */ 981 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
962 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */ 982 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
963 .long _ex_icplb /* 0x2B - Instruction CPLB protection Violation */ 983 .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */
964 .long _ex_icplb /* 0x2C - Instruction CPLB miss */ 984 .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */
965 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */ 985 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
966 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ 986 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
967 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ 987 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */