diff options
| -rw-r--r-- | arch/arc/include/asm/bug.h | 5 | ||||
| -rw-r--r-- | arch/arc/include/asm/kgdb.h | 4 | ||||
| -rw-r--r-- | arch/arc/include/asm/kprobes.h | 6 | ||||
| -rw-r--r-- | arch/arc/include/asm/processor.h | 1 | ||||
| -rw-r--r-- | arch/arc/include/asm/unaligned.h | 4 | ||||
| -rw-r--r-- | arch/arc/kernel/entry.S | 40 | ||||
| -rw-r--r-- | arch/arc/kernel/kgdb.c | 2 | ||||
| -rw-r--r-- | arch/arc/kernel/kprobes.c | 5 | ||||
| -rw-r--r-- | arch/arc/kernel/traps.c | 52 | ||||
| -rw-r--r-- | arch/arc/kernel/troubleshoot.c | 3 | ||||
| -rw-r--r-- | arch/arc/kernel/unaligned.c | 2 | ||||
| -rw-r--r-- | arch/arc/mm/fault.c | 12 | ||||
| -rw-r--r-- | arch/arc/mm/tlbex.S | 1 |
13 files changed, 59 insertions, 78 deletions
diff --git a/arch/arc/include/asm/bug.h b/arch/arc/include/asm/bug.h index 2ad8f9b1c54b..5b18e94c6678 100644 --- a/arch/arc/include/asm/bug.h +++ b/arch/arc/include/asm/bug.h | |||
| @@ -18,9 +18,8 @@ struct task_struct; | |||
| 18 | void show_regs(struct pt_regs *regs); | 18 | void show_regs(struct pt_regs *regs); |
| 19 | void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs); | 19 | void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs); |
| 20 | void show_kernel_fault_diag(const char *str, struct pt_regs *regs, | 20 | void show_kernel_fault_diag(const char *str, struct pt_regs *regs, |
| 21 | unsigned long address, unsigned long cause_reg); | 21 | unsigned long address); |
| 22 | void die(const char *str, struct pt_regs *regs, unsigned long address, | 22 | void die(const char *str, struct pt_regs *regs, unsigned long address); |
| 23 | unsigned long cause_reg); | ||
| 24 | 23 | ||
| 25 | #define BUG() do { \ | 24 | #define BUG() do { \ |
| 26 | dump_stack(); \ | 25 | dump_stack(); \ |
diff --git a/arch/arc/include/asm/kgdb.h b/arch/arc/include/asm/kgdb.h index 4930957ca3d3..b65fca7ffeb5 100644 --- a/arch/arc/include/asm/kgdb.h +++ b/arch/arc/include/asm/kgdb.h | |||
| @@ -31,7 +31,7 @@ static inline void arch_kgdb_breakpoint(void) | |||
| 31 | __asm__ __volatile__ ("trap_s 0x4\n"); | 31 | __asm__ __volatile__ ("trap_s 0x4\n"); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | extern void kgdb_trap(struct pt_regs *regs, int param); | 34 | extern void kgdb_trap(struct pt_regs *regs); |
| 35 | 35 | ||
| 36 | enum arc700_linux_regnums { | 36 | enum arc700_linux_regnums { |
| 37 | _R0 = 0, | 37 | _R0 = 0, |
| @@ -53,7 +53,7 @@ enum arc700_linux_regnums { | |||
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | #else | 55 | #else |
| 56 | #define kgdb_trap(regs, param) | 56 | #define kgdb_trap(regs) |
| 57 | #endif | 57 | #endif |
| 58 | 58 | ||
| 59 | #endif /* __ARC_KGDB_H__ */ | 59 | #endif /* __ARC_KGDB_H__ */ |
diff --git a/arch/arc/include/asm/kprobes.h b/arch/arc/include/asm/kprobes.h index 4d9c211fce70..944dbedb38b5 100644 --- a/arch/arc/include/asm/kprobes.h +++ b/arch/arc/include/asm/kprobes.h | |||
| @@ -50,11 +50,9 @@ struct kprobe_ctlblk { | |||
| 50 | 50 | ||
| 51 | int kprobe_fault_handler(struct pt_regs *regs, unsigned long cause); | 51 | int kprobe_fault_handler(struct pt_regs *regs, unsigned long cause); |
| 52 | void kretprobe_trampoline(void); | 52 | void kretprobe_trampoline(void); |
| 53 | void trap_is_kprobe(unsigned long cause, unsigned long address, | 53 | void trap_is_kprobe(unsigned long address, struct pt_regs *regs); |
| 54 | struct pt_regs *regs); | ||
| 55 | #else | 54 | #else |
| 56 | static void trap_is_kprobe(unsigned long cause, unsigned long address, | 55 | static void trap_is_kprobe(unsigned long address, struct pt_regs *regs) |
| 57 | struct pt_regs *regs) | ||
| 58 | { | 56 | { |
| 59 | } | 57 | } |
| 60 | #endif | 58 | #endif |
diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h index b0b5d2d9b3d3..15334ab66b56 100644 --- a/arch/arc/include/asm/processor.h +++ b/arch/arc/include/asm/processor.h | |||
| @@ -29,7 +29,6 @@ struct thread_struct { | |||
| 29 | unsigned long ksp; /* kernel mode stack pointer */ | 29 | unsigned long ksp; /* kernel mode stack pointer */ |
| 30 | unsigned long callee_reg; /* pointer to callee regs */ | 30 | unsigned long callee_reg; /* pointer to callee regs */ |
| 31 | unsigned long fault_address; /* dbls as brkpt holder as well */ | 31 | unsigned long fault_address; /* dbls as brkpt holder as well */ |
| 32 | unsigned long cause_code; /* Exception Cause Code (ECR) */ | ||
| 33 | #ifdef CONFIG_ARC_FPU_SAVE_RESTORE | 32 | #ifdef CONFIG_ARC_FPU_SAVE_RESTORE |
| 34 | struct arc_fpu fpu; | 33 | struct arc_fpu fpu; |
| 35 | #endif | 34 | #endif |
diff --git a/arch/arc/include/asm/unaligned.h b/arch/arc/include/asm/unaligned.h index 5dbe63f17b66..60702f3751d2 100644 --- a/arch/arc/include/asm/unaligned.h +++ b/arch/arc/include/asm/unaligned.h | |||
| @@ -16,11 +16,11 @@ | |||
| 16 | 16 | ||
| 17 | #ifdef CONFIG_ARC_MISALIGN_ACCESS | 17 | #ifdef CONFIG_ARC_MISALIGN_ACCESS |
| 18 | int misaligned_fixup(unsigned long address, struct pt_regs *regs, | 18 | int misaligned_fixup(unsigned long address, struct pt_regs *regs, |
| 19 | unsigned long cause, struct callee_regs *cregs); | 19 | struct callee_regs *cregs); |
| 20 | #else | 20 | #else |
| 21 | static inline int | 21 | static inline int |
| 22 | misaligned_fixup(unsigned long address, struct pt_regs *regs, | 22 | misaligned_fixup(unsigned long address, struct pt_regs *regs, |
| 23 | unsigned long cause, struct callee_regs *cregs) | 23 | struct callee_regs *cregs) |
| 24 | { | 24 | { |
| 25 | return 0; | 25 | return 0; |
| 26 | } | 26 | } |
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S index fb0fe3265637..1d7165156e17 100644 --- a/arch/arc/kernel/entry.S +++ b/arch/arc/kernel/entry.S | |||
| @@ -274,10 +274,8 @@ ARC_ENTRY instr_service | |||
| 274 | SWITCH_TO_KERNEL_STK | 274 | SWITCH_TO_KERNEL_STK |
| 275 | SAVE_ALL_SYS | 275 | SAVE_ALL_SYS |
| 276 | 276 | ||
| 277 | lr r0, [ecr] | 277 | lr r0, [efa] |
| 278 | lr r1, [efa] | 278 | mov r1, sp |
| 279 | |||
| 280 | mov r2, sp | ||
| 281 | 279 | ||
| 282 | FAKE_RET_FROM_EXCPN r9 | 280 | FAKE_RET_FROM_EXCPN r9 |
| 283 | 281 | ||
| @@ -298,9 +296,8 @@ ARC_ENTRY mem_service | |||
| 298 | SWITCH_TO_KERNEL_STK | 296 | SWITCH_TO_KERNEL_STK |
| 299 | SAVE_ALL_SYS | 297 | SAVE_ALL_SYS |
| 300 | 298 | ||
| 301 | lr r0, [ecr] | 299 | lr r0, [efa] |
| 302 | lr r1, [efa] | 300 | mov r1, sp |
| 303 | mov r2, sp | ||
| 304 | bl do_memory_error | 301 | bl do_memory_error |
| 305 | b ret_from_exception | 302 | b ret_from_exception |
| 306 | ARC_EXIT mem_service | 303 | ARC_EXIT mem_service |
| @@ -317,11 +314,11 @@ ARC_ENTRY EV_MachineCheck | |||
| 317 | SWITCH_TO_KERNEL_STK | 314 | SWITCH_TO_KERNEL_STK |
| 318 | SAVE_ALL_SYS | 315 | SAVE_ALL_SYS |
| 319 | 316 | ||
| 320 | lr r0, [ecr] | 317 | lr r2, [ecr] |
| 321 | lr r1, [efa] | 318 | lr r0, [efa] |
| 322 | mov r2, sp | 319 | mov r1, sp |
| 323 | 320 | ||
| 324 | lsr r3, r0, 8 | 321 | lsr r3, r2, 8 |
| 325 | bmsk r3, r3, 7 | 322 | bmsk r3, r3, 7 |
| 326 | brne r3, ECR_C_MCHK_DUP_TLB, 1f | 323 | brne r3, ECR_C_MCHK_DUP_TLB, 1f |
| 327 | 324 | ||
| @@ -384,12 +381,12 @@ ARC_ENTRY EV_TLBProtV | |||
| 384 | 381 | ||
| 385 | ;========== (6b) Non aligned access ============ | 382 | ;========== (6b) Non aligned access ============ |
| 386 | 4: | 383 | 4: |
| 387 | mov r0, r2 ; cause code | 384 | mov r0, r1 |
| 388 | mov r2, sp ; pt_regs | 385 | mov r1, sp ; pt_regs |
| 389 | 386 | ||
| 390 | #ifdef CONFIG_ARC_MISALIGN_ACCESS | 387 | #ifdef CONFIG_ARC_MISALIGN_ACCESS |
| 391 | SAVE_CALLEE_SAVED_USER | 388 | SAVE_CALLEE_SAVED_USER |
| 392 | mov r3, sp ; callee_regs | 389 | mov r2, sp ; callee_regs |
| 393 | 390 | ||
| 394 | bl do_misaligned_access | 391 | bl do_misaligned_access |
| 395 | 392 | ||
| @@ -416,9 +413,8 @@ ARC_ENTRY EV_PrivilegeV | |||
| 416 | SWITCH_TO_KERNEL_STK | 413 | SWITCH_TO_KERNEL_STK |
| 417 | SAVE_ALL_SYS | 414 | SAVE_ALL_SYS |
| 418 | 415 | ||
| 419 | lr r0, [ecr] | 416 | lr r0, [efa] |
| 420 | lr r1, [efa] | 417 | mov r1, sp |
| 421 | mov r2, sp | ||
| 422 | 418 | ||
| 423 | FAKE_RET_FROM_EXCPN r9 | 419 | FAKE_RET_FROM_EXCPN r9 |
| 424 | 420 | ||
| @@ -437,9 +433,8 @@ ARC_ENTRY EV_Extension | |||
| 437 | SWITCH_TO_KERNEL_STK | 433 | SWITCH_TO_KERNEL_STK |
| 438 | SAVE_ALL_SYS | 434 | SAVE_ALL_SYS |
| 439 | 435 | ||
| 440 | lr r0, [ecr] | 436 | lr r0, [efa] |
| 441 | lr r1, [efa] | 437 | mov r1, sp |
| 442 | mov r2, sp | ||
| 443 | bl do_extension_fault | 438 | bl do_extension_fault |
| 444 | b ret_from_exception | 439 | b ret_from_exception |
| 445 | ARC_EXIT EV_Extension | 440 | ARC_EXIT EV_Extension |
| @@ -495,9 +490,8 @@ tracesys_exit: | |||
| 495 | trap_with_param: | 490 | trap_with_param: |
| 496 | 491 | ||
| 497 | ; stop_pc info by gdb needs this info | 492 | ; stop_pc info by gdb needs this info |
| 498 | mov r0, r12 | 493 | lr r0, [efa] |
| 499 | lr r1, [efa] | 494 | mov r1, sp |
| 500 | mov r2, sp | ||
| 501 | 495 | ||
| 502 | ; Now that we have read EFA, its safe to do "fake" rtie | 496 | ; Now that we have read EFA, its safe to do "fake" rtie |
| 503 | ; and get out of CPU exception mode | 497 | ; and get out of CPU exception mode |
diff --git a/arch/arc/kernel/kgdb.c b/arch/arc/kernel/kgdb.c index 84f1bb8208b4..a7698fb14818 100644 --- a/arch/arc/kernel/kgdb.c +++ b/arch/arc/kernel/kgdb.c | |||
| @@ -169,7 +169,7 @@ int kgdb_arch_init(void) | |||
| 169 | return 0; | 169 | return 0; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | void kgdb_trap(struct pt_regs *regs, int param) | 172 | void kgdb_trap(struct pt_regs *regs) |
| 173 | { | 173 | { |
| 174 | /* trap_s 3 is used for breakpoints that overwrite existing | 174 | /* trap_s 3 is used for breakpoints that overwrite existing |
| 175 | * instructions, while trap_s 4 is used for compiled breakpoints. | 175 | * instructions, while trap_s 4 is used for compiled breakpoints. |
diff --git a/arch/arc/kernel/kprobes.c b/arch/arc/kernel/kprobes.c index 5a7b80e2d883..72f97822784a 100644 --- a/arch/arc/kernel/kprobes.c +++ b/arch/arc/kernel/kprobes.c | |||
| @@ -517,8 +517,7 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p) | |||
| 517 | return 0; | 517 | return 0; |
| 518 | } | 518 | } |
| 519 | 519 | ||
| 520 | void trap_is_kprobe(unsigned long cause, unsigned long address, | 520 | void trap_is_kprobe(unsigned long address, struct pt_regs *regs) |
| 521 | struct pt_regs *regs) | ||
| 522 | { | 521 | { |
| 523 | notify_die(DIE_TRAP, "kprobe_trap", regs, address, cause, SIGTRAP); | 522 | notify_die(DIE_TRAP, "kprobe_trap", regs, address, 0, SIGTRAP); |
| 524 | } | 523 | } |
diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c index 0471d9c9dd54..e21692d2fdab 100644 --- a/arch/arc/kernel/traps.c +++ b/arch/arc/kernel/traps.c | |||
| @@ -28,10 +28,9 @@ void __init trap_init(void) | |||
| 28 | return; | 28 | return; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | void die(const char *str, struct pt_regs *regs, unsigned long address, | 31 | void die(const char *str, struct pt_regs *regs, unsigned long address) |
| 32 | unsigned long cause_reg) | ||
| 33 | { | 32 | { |
| 34 | show_kernel_fault_diag(str, regs, address, cause_reg); | 33 | show_kernel_fault_diag(str, regs, address); |
| 35 | 34 | ||
| 36 | /* DEAD END */ | 35 | /* DEAD END */ |
| 37 | __asm__("flag 1"); | 36 | __asm__("flag 1"); |
| @@ -42,14 +41,13 @@ void die(const char *str, struct pt_regs *regs, unsigned long address, | |||
| 42 | * -for user faults enqueues requested signal | 41 | * -for user faults enqueues requested signal |
| 43 | * -for kernel, chk if due to copy_(to|from)_user, otherwise die() | 42 | * -for kernel, chk if due to copy_(to|from)_user, otherwise die() |
| 44 | */ | 43 | */ |
| 45 | static noinline int handle_exception(unsigned long cause, char *str, | 44 | static noinline int |
| 46 | struct pt_regs *regs, siginfo_t *info) | 45 | handle_exception(const char *str, struct pt_regs *regs, siginfo_t *info) |
| 47 | { | 46 | { |
| 48 | if (user_mode(regs)) { | 47 | if (user_mode(regs)) { |
| 49 | struct task_struct *tsk = current; | 48 | struct task_struct *tsk = current; |
| 50 | 49 | ||
| 51 | tsk->thread.fault_address = (__force unsigned int)info->si_addr; | 50 | tsk->thread.fault_address = (__force unsigned int)info->si_addr; |
| 52 | tsk->thread.cause_code = cause; | ||
| 53 | 51 | ||
| 54 | force_sig_info(info->si_signo, info, tsk); | 52 | force_sig_info(info->si_signo, info, tsk); |
| 55 | 53 | ||
| @@ -58,14 +56,14 @@ static noinline int handle_exception(unsigned long cause, char *str, | |||
| 58 | if (fixup_exception(regs)) | 56 | if (fixup_exception(regs)) |
| 59 | return 0; | 57 | return 0; |
| 60 | 58 | ||
| 61 | die(str, regs, (unsigned long)info->si_addr, cause); | 59 | die(str, regs, (unsigned long)info->si_addr); |
| 62 | } | 60 | } |
| 63 | 61 | ||
| 64 | return 1; | 62 | return 1; |
| 65 | } | 63 | } |
| 66 | 64 | ||
| 67 | #define DO_ERROR_INFO(signr, str, name, sicode) \ | 65 | #define DO_ERROR_INFO(signr, str, name, sicode) \ |
| 68 | int name(unsigned long cause, unsigned long address, struct pt_regs *regs) \ | 66 | int name(unsigned long address, struct pt_regs *regs) \ |
| 69 | { \ | 67 | { \ |
| 70 | siginfo_t info = { \ | 68 | siginfo_t info = { \ |
| 71 | .si_signo = signr, \ | 69 | .si_signo = signr, \ |
| @@ -73,7 +71,7 @@ int name(unsigned long cause, unsigned long address, struct pt_regs *regs) \ | |||
| 73 | .si_code = sicode, \ | 71 | .si_code = sicode, \ |
| 74 | .si_addr = (void __user *)address, \ | 72 | .si_addr = (void __user *)address, \ |
| 75 | }; \ | 73 | }; \ |
| 76 | return handle_exception(cause, str, regs, &info);\ | 74 | return handle_exception(str, regs, &info);\ |
| 77 | } | 75 | } |
| 78 | 76 | ||
| 79 | /* | 77 | /* |
| @@ -90,11 +88,11 @@ DO_ERROR_INFO(SIGBUS, "Misaligned Access", do_misaligned_error, BUS_ADRALN) | |||
| 90 | /* | 88 | /* |
| 91 | * Entry Point for Misaligned Data access Exception, for emulating in software | 89 | * Entry Point for Misaligned Data access Exception, for emulating in software |
| 92 | */ | 90 | */ |
| 93 | int do_misaligned_access(unsigned long cause, unsigned long address, | 91 | int do_misaligned_access(unsigned long address, struct pt_regs *regs, |
| 94 | struct pt_regs *regs, struct callee_regs *cregs) | 92 | struct callee_regs *cregs) |
| 95 | { | 93 | { |
| 96 | if (misaligned_fixup(address, regs, cause, cregs) != 0) | 94 | if (misaligned_fixup(address, regs, cregs) != 0) |
| 97 | return do_misaligned_error(cause, address, regs); | 95 | return do_misaligned_error(address, regs); |
| 98 | 96 | ||
| 99 | return 0; | 97 | return 0; |
| 100 | } | 98 | } |
| @@ -104,10 +102,9 @@ int do_misaligned_access(unsigned long cause, unsigned long address, | |||
| 104 | * Entry point for miscll errors such as Nested Exceptions | 102 | * Entry point for miscll errors such as Nested Exceptions |
| 105 | * -Duplicate TLB entry is handled seperately though | 103 | * -Duplicate TLB entry is handled seperately though |
| 106 | */ | 104 | */ |
| 107 | void do_machine_check_fault(unsigned long cause, unsigned long address, | 105 | void do_machine_check_fault(unsigned long address, struct pt_regs *regs) |
| 108 | struct pt_regs *regs) | ||
| 109 | { | 106 | { |
| 110 | die("Machine Check Exception", regs, address, cause); | 107 | die("Machine Check Exception", regs, address); |
| 111 | } | 108 | } |
| 112 | 109 | ||
| 113 | 110 | ||
| @@ -120,23 +117,22 @@ void do_machine_check_fault(unsigned long cause, unsigned long address, | |||
| 120 | * -1 used for software breakpointing (gdb) | 117 | * -1 used for software breakpointing (gdb) |
| 121 | * -2 used by kprobes | 118 | * -2 used by kprobes |
| 122 | */ | 119 | */ |
| 123 | void do_non_swi_trap(unsigned long cause, unsigned long address, | 120 | void do_non_swi_trap(unsigned long address, struct pt_regs *regs) |
| 124 | struct pt_regs *regs) | ||
| 125 | { | 121 | { |
| 126 | unsigned int param = cause & 0xff; | 122 | unsigned int param = regs->ecr_param; |
| 127 | 123 | ||
| 128 | switch (param) { | 124 | switch (param) { |
| 129 | case 1: | 125 | case 1: |
| 130 | trap_is_brkpt(cause, address, regs); | 126 | trap_is_brkpt(address, regs); |
| 131 | break; | 127 | break; |
| 132 | 128 | ||
| 133 | case 2: | 129 | case 2: |
| 134 | trap_is_kprobe(param, address, regs); | 130 | trap_is_kprobe(address, regs); |
| 135 | break; | 131 | break; |
| 136 | 132 | ||
| 137 | case 3: | 133 | case 3: |
| 138 | case 4: | 134 | case 4: |
| 139 | kgdb_trap(regs, param); | 135 | kgdb_trap(regs); |
| 140 | break; | 136 | break; |
| 141 | 137 | ||
| 142 | default: | 138 | default: |
| @@ -149,14 +145,14 @@ void do_non_swi_trap(unsigned long cause, unsigned long address, | |||
| 149 | * -For a corner case, ARC kprobes implementation resorts to using | 145 | * -For a corner case, ARC kprobes implementation resorts to using |
| 150 | * this exception, hence the check | 146 | * this exception, hence the check |
| 151 | */ | 147 | */ |
| 152 | void do_insterror_or_kprobe(unsigned long cause, | 148 | void do_insterror_or_kprobe(unsigned long address, struct pt_regs *regs) |
| 153 | unsigned long address, | ||
| 154 | struct pt_regs *regs) | ||
| 155 | { | 149 | { |
| 150 | int rc; | ||
| 151 | |||
| 156 | /* Check if this exception is caused by kprobes */ | 152 | /* Check if this exception is caused by kprobes */ |
| 157 | if (notify_die(DIE_IERR, "kprobe_ierr", regs, address, | 153 | rc = notify_die(DIE_IERR, "kprobe_ierr", regs, address, 0, SIGILL); |
| 158 | cause, SIGILL) == NOTIFY_STOP) | 154 | if (rc == NOTIFY_STOP) |
| 159 | return; | 155 | return; |
| 160 | 156 | ||
| 161 | insterror_is_error(cause, address, regs); | 157 | insterror_is_error(address, regs); |
| 162 | } | 158 | } |
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index 977464126be9..7f85bc3f7105 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c | |||
| @@ -209,10 +209,9 @@ void show_regs(struct pt_regs *regs) | |||
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | void show_kernel_fault_diag(const char *str, struct pt_regs *regs, | 211 | void show_kernel_fault_diag(const char *str, struct pt_regs *regs, |
| 212 | unsigned long address, unsigned long cause_reg) | 212 | unsigned long address) |
| 213 | { | 213 | { |
| 214 | current->thread.fault_address = address; | 214 | current->thread.fault_address = address; |
| 215 | current->thread.cause_code = cause_reg; | ||
| 216 | 215 | ||
| 217 | /* Caller and Callee regs */ | 216 | /* Caller and Callee regs */ |
| 218 | show_regs(regs); | 217 | show_regs(regs); |
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c index 4cd81633febd..c0f832f595d3 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c | |||
| @@ -187,7 +187,7 @@ fault: state->fault = 1; | |||
| 187 | * Returns 0 if successfully handled, 1 if some error happened | 187 | * Returns 0 if successfully handled, 1 if some error happened |
| 188 | */ | 188 | */ |
| 189 | int misaligned_fixup(unsigned long address, struct pt_regs *regs, | 189 | int misaligned_fixup(unsigned long address, struct pt_regs *regs, |
| 190 | unsigned long cause, struct callee_regs *cregs) | 190 | struct callee_regs *cregs) |
| 191 | { | 191 | { |
| 192 | struct disasm_state state; | 192 | struct disasm_state state; |
| 193 | char buf[TASK_COMM_LEN]; | 193 | char buf[TASK_COMM_LEN]; |
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index fdafeb1917cc..318164cabdfc 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c | |||
| @@ -52,15 +52,14 @@ bad_area: | |||
| 52 | return 1; | 52 | return 1; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | void do_page_fault(struct pt_regs *regs, unsigned long address, | 55 | void do_page_fault(struct pt_regs *regs, unsigned long address) |
| 56 | unsigned long cause_code) | ||
| 57 | { | 56 | { |
| 58 | struct vm_area_struct *vma = NULL; | 57 | struct vm_area_struct *vma = NULL; |
| 59 | struct task_struct *tsk = current; | 58 | struct task_struct *tsk = current; |
| 60 | struct mm_struct *mm = tsk->mm; | 59 | struct mm_struct *mm = tsk->mm; |
| 61 | siginfo_t info; | 60 | siginfo_t info; |
| 62 | int fault, ret; | 61 | int fault, ret; |
| 63 | int write = cause_code & (1 << ECR_C_BIT_DTLB_ST_MISS); /* ST/EX */ | 62 | int write = regs->ecr_cause & ECR_C_PROTV_STORE; /* ST/EX */ |
| 64 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | 63 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | |
| 65 | (write ? FAULT_FLAG_WRITE : 0); | 64 | (write ? FAULT_FLAG_WRITE : 0); |
| 66 | 65 | ||
| @@ -111,7 +110,8 @@ good_area: | |||
| 111 | 110 | ||
| 112 | /* Handle protection violation, execute on heap or stack */ | 111 | /* Handle protection violation, execute on heap or stack */ |
| 113 | 112 | ||
| 114 | if (cause_code == ((ECR_V_PROTV << 16) | ECR_C_PROTV_INST_FETCH)) | 113 | if ((regs->ecr_vec == ECR_V_PROTV) && |
| 114 | (regs->ecr_cause == ECR_C_PROTV_INST_FETCH)) | ||
| 115 | goto bad_area; | 115 | goto bad_area; |
| 116 | 116 | ||
| 117 | if (write) { | 117 | if (write) { |
| @@ -178,7 +178,6 @@ bad_area_nosemaphore: | |||
| 178 | /* User mode accesses just cause a SIGSEGV */ | 178 | /* User mode accesses just cause a SIGSEGV */ |
| 179 | if (user_mode(regs)) { | 179 | if (user_mode(regs)) { |
| 180 | tsk->thread.fault_address = address; | 180 | tsk->thread.fault_address = address; |
| 181 | tsk->thread.cause_code = cause_code; | ||
| 182 | info.si_signo = SIGSEGV; | 181 | info.si_signo = SIGSEGV; |
| 183 | info.si_errno = 0; | 182 | info.si_errno = 0; |
| 184 | /* info.si_code has been set above */ | 183 | /* info.si_code has been set above */ |
| @@ -199,7 +198,7 @@ no_context: | |||
| 199 | if (fixup_exception(regs)) | 198 | if (fixup_exception(regs)) |
| 200 | return; | 199 | return; |
| 201 | 200 | ||
| 202 | die("Oops", regs, address, cause_code); | 201 | die("Oops", regs, address); |
| 203 | 202 | ||
| 204 | out_of_memory: | 203 | out_of_memory: |
| 205 | if (is_global_init(tsk)) { | 204 | if (is_global_init(tsk)) { |
| @@ -220,7 +219,6 @@ do_sigbus: | |||
| 220 | goto no_context; | 219 | goto no_context; |
| 221 | 220 | ||
| 222 | tsk->thread.fault_address = address; | 221 | tsk->thread.fault_address = address; |
| 223 | tsk->thread.cause_code = cause_code; | ||
| 224 | info.si_signo = SIGBUS; | 222 | info.si_signo = SIGBUS; |
| 225 | info.si_errno = 0; | 223 | info.si_errno = 0; |
| 226 | info.si_code = BUS_ADRERR; | 224 | info.si_code = BUS_ADRERR; |
diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S index bd8bc90f61d3..8d61fdf7a43b 100644 --- a/arch/arc/mm/tlbex.S +++ b/arch/arc/mm/tlbex.S | |||
| @@ -382,7 +382,6 @@ do_slow_path_pf: | |||
| 382 | ; ------- setup args for Linux Page fault Hanlder --------- | 382 | ; ------- setup args for Linux Page fault Hanlder --------- |
| 383 | mov_s r0, sp | 383 | mov_s r0, sp |
| 384 | lr r1, [efa] | 384 | lr r1, [efa] |
| 385 | lr r2, [ecr] | ||
| 386 | 385 | ||
| 387 | ; We don't want exceptions to be disabled while the fault is handled. | 386 | ; We don't want exceptions to be disabled while the fault is handled. |
| 388 | ; Now that we have saved the context we return from exception hence | 387 | ; Now that we have saved the context we return from exception hence |
