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 9be3df1fa8a..cf7ac5483f5 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -13,6 +13,7 @@   */  #include <linux/bug.h>  #include <linux/compiler.h> +#include <linux/kexec.h>  #include <linux/init.h>  #include <linux/kernel.h>  #include <linux/module.h> @@ -409,6 +410,9 @@ void __noreturn die(const char *str, struct pt_regs *regs)  		panic("Fatal exception");  	} +	if (regs && kexec_should_crash(current)) +		crash_kexec(regs); +  	do_exit(sig);  } @@ -1021,6 +1025,24 @@ asmlinkage void do_cpu(struct pt_regs *regs)  		return; +	case 3: +		/* +		 * Old (MIPS I and MIPS II) processors will set this code +		 * for COP1X opcode instructions that replaced the original +		 * COP3 space.  We don't limit COP1 space instructions in +		 * the emulator according to the CPU ISA, so we want to +		 * treat COP1X instructions consistently regardless of which +		 * code the CPU chose.  Therefore we redirect this trap to +		 * the FP emulator too. +		 * +		 * Then some newer FPU-less processors use this code +		 * erroneously too, so they are covered by this choice +		 * as well. +		 */ +		if (raw_cpu_has_fpu) +			break; +		/* Fall through.  */ +  	case 1:  		if (used_math())	/* Using the FPU again.  */  			own_fpu(1); @@ -1044,9 +1066,6 @@ asmlinkage void do_cpu(struct pt_regs *regs)  	case 2:  		raw_notifier_call_chain(&cu2_chain, CU2_EXCEPTION, regs);  		return; - -	case 3: -		break;  	}  	force_sig(SIGILL, current);  |