aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2013-06-10 02:30:01 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-06-13 11:46:41 -0400
commit83bee792d7cb20d250be57e99d97f8cc83d9b4d5 (patch)
tree4966fbdabeaae68ff9ca921ebc5bdd71072e383e /arch/mips/kernel
parent2c952e06e4f57716109b609956eda28c900faac0 (diff)
MIPS: Allow kernel to use coprocessor 2
Kernel threads should be able to use COP2 if the platform needs it. Do not call die_if_kernel() for a coprocessor unusable exception if the exception due to COP2 usage. Instead, the default notifier for COP2 exceptions is updated to call die_if_kernel. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Cc: ddaney.cavm@gmail.com Patchwork: https://patchwork.linux-mips.org/patch/5415/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/traps.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index beba1e616b6e..142d2bede024 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1056,15 +1056,9 @@ static int default_cu2_call(struct notifier_block *nfb, unsigned long action,
1056{ 1056{
1057 struct pt_regs *regs = data; 1057 struct pt_regs *regs = data;
1058 1058
1059 switch (action) { 1059 die_if_kernel("COP2: Unhandled kernel unaligned access or invalid "
1060 default:
1061 die_if_kernel("Unhandled kernel unaligned access or invalid "
1062 "instruction", regs); 1060 "instruction", regs);
1063 /* Fall through */ 1061 force_sig(SIGILL, current);
1064
1065 case CU2_EXCEPTION:
1066 force_sig(SIGILL, current);
1067 }
1068 1062
1069 return NOTIFY_OK; 1063 return NOTIFY_OK;
1070} 1064}
@@ -1080,10 +1074,11 @@ asmlinkage void do_cpu(struct pt_regs *regs)
1080 unsigned long __maybe_unused flags; 1074 unsigned long __maybe_unused flags;
1081 1075
1082 prev_state = exception_enter(); 1076 prev_state = exception_enter();
1083 die_if_kernel("do_cpu invoked from kernel context!", regs);
1084
1085 cpid = (regs->cp0_cause >> CAUSEB_CE) & 3; 1077 cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
1086 1078
1079 if (cpid != 2)
1080 die_if_kernel("do_cpu invoked from kernel context!", regs);
1081
1087 switch (cpid) { 1082 switch (cpid) {
1088 case 0: 1083 case 0:
1089 epc = (unsigned int __user *)exception_epc(regs); 1084 epc = (unsigned int __user *)exception_epc(regs);