diff options
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r-- | arch/mips/kernel/traps.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 9be3df1fa8a4..cf7ac5483f53 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -13,6 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | #include <linux/bug.h> | 14 | #include <linux/bug.h> |
15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
16 | #include <linux/kexec.h> | ||
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
@@ -409,6 +410,9 @@ void __noreturn die(const char *str, struct pt_regs *regs) | |||
409 | panic("Fatal exception"); | 410 | panic("Fatal exception"); |
410 | } | 411 | } |
411 | 412 | ||
413 | if (regs && kexec_should_crash(current)) | ||
414 | crash_kexec(regs); | ||
415 | |||
412 | do_exit(sig); | 416 | do_exit(sig); |
413 | } | 417 | } |
414 | 418 | ||
@@ -1021,6 +1025,24 @@ asmlinkage void do_cpu(struct pt_regs *regs) | |||
1021 | 1025 | ||
1022 | return; | 1026 | return; |
1023 | 1027 | ||
1028 | case 3: | ||
1029 | /* | ||
1030 | * Old (MIPS I and MIPS II) processors will set this code | ||
1031 | * for COP1X opcode instructions that replaced the original | ||
1032 | * COP3 space. We don't limit COP1 space instructions in | ||
1033 | * the emulator according to the CPU ISA, so we want to | ||
1034 | * treat COP1X instructions consistently regardless of which | ||
1035 | * code the CPU chose. Therefore we redirect this trap to | ||
1036 | * the FP emulator too. | ||
1037 | * | ||
1038 | * Then some newer FPU-less processors use this code | ||
1039 | * erroneously too, so they are covered by this choice | ||
1040 | * as well. | ||
1041 | */ | ||
1042 | if (raw_cpu_has_fpu) | ||
1043 | break; | ||
1044 | /* Fall through. */ | ||
1045 | |||
1024 | case 1: | 1046 | case 1: |
1025 | if (used_math()) /* Using the FPU again. */ | 1047 | if (used_math()) /* Using the FPU again. */ |
1026 | own_fpu(1); | 1048 | own_fpu(1); |
@@ -1044,9 +1066,6 @@ asmlinkage void do_cpu(struct pt_regs *regs) | |||
1044 | case 2: | 1066 | case 2: |
1045 | raw_notifier_call_chain(&cu2_chain, CU2_EXCEPTION, regs); | 1067 | raw_notifier_call_chain(&cu2_chain, CU2_EXCEPTION, regs); |
1046 | return; | 1068 | return; |
1047 | |||
1048 | case 3: | ||
1049 | break; | ||
1050 | } | 1069 | } |
1051 | 1070 | ||
1052 | force_sig(SIGILL, current); | 1071 | force_sig(SIGILL, current); |