[xtensa-cvscommit] linux/arch/xtensa/kernel traps.c,1.16,1.17
Brought to you by:
zankel
|
From: <joe...@us...> - 2004-01-07 23:09:19
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv14851/arch/xtensa/kernel
Modified Files:
traps.c
Log Message:
Instead of panic()'ing, kill user processes that cause unhandled exceptions (e.g., privilege instructions).
Index: traps.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** traps.c 7 Jul 2003 22:41:25 -0000 1.16
--- traps.c 7 Jan 2004 23:09:15 -0000 1.17
***************
*** 101,124 ****
{ XCHAL_EXCCAUSE_SPECULATION, "Speculation" },
{ XCHAL_EXCCAUSE_PRIVILEGED, "Privileged Instruction" },
! { XCHAL_EXCCAUSE_ITLB_MISS, "ITlb Miss Exception" },
! { XCHAL_EXCCAUSE_ITLB_MULTIHIT, "ITlb Mutltihit Exception" },
! { XCHAL_EXCCAUSE_ITLB_PRIVILEGE, "ITlb Privilege Exception" },
! { XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION, "ITlb Size Restriction Exception" },
! { XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE, "Fetch Cache Attribute Exception" },
! { XCHAL_EXCCAUSE_DTLB_MISS, "DTlb Miss Exception" },
! { XCHAL_EXCCAUSE_DTLB_MULTIHIT, "DTlb Multihit Exception" },
! { XCHAL_EXCCAUSE_DTLB_PRIVILEGE, "DTlb Privilege Exception" },
! { XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION, "DTlb Size Restriction Exception" },
! { XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE, "Load Cache Attribute Exception" },
! { XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE, "Store Cache Attribute Exception" },
! { 32+0, "Coprocessor 0 Disabled Exception" },
! { 32+1, "Coprocessor 1 Disabled Exception" },
! { 32+2, "Coprocessor 2 Disabled Exception" },
! { 32+3, "Coprocessor 3 Disabled Exception" },
! { 32+4, "Coprocessor 4 Disabled Exception" },
! { 32+5, "Coprocessor 5 Disabled Exception" },
! { 32+6, "Coprocessor 6 Disabled Exception" },
! { 32+7, "Coprocessor 7 Disabled Exception" },
! { XCHAL_EXCCAUSE_FLOATING_POINT, "Floating Point Exception" }
};
--- 101,124 ----
{ XCHAL_EXCCAUSE_SPECULATION, "Speculation" },
{ XCHAL_EXCCAUSE_PRIVILEGED, "Privileged Instruction" },
! { XCHAL_EXCCAUSE_ITLB_MISS, "ITlb Miss" },
! { XCHAL_EXCCAUSE_ITLB_MULTIHIT, "ITlb Mutltihit" },
! { XCHAL_EXCCAUSE_ITLB_PRIVILEGE, "ITlb Privilege" },
! { XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION, "ITlb Size Restriction" },
! { XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE, "Fetch Cache Attribute" },
! { XCHAL_EXCCAUSE_DTLB_MISS, "DTlb Miss" },
! { XCHAL_EXCCAUSE_DTLB_MULTIHIT, "DTlb Multihit" },
! { XCHAL_EXCCAUSE_DTLB_PRIVILEGE, "DTlb Privilege" },
! { XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION, "DTlb Size Restriction" },
! { XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE, "Load Cache Attribute" },
! { XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE, "Store Cache Attribute" },
! { 32+0, "Coprocessor 0 Disabled" },
! { 32+1, "Coprocessor 1 Disabled" },
! { 32+2, "Coprocessor 2 Disabled" },
! { 32+3, "Coprocessor 3 Disabled" },
! { 32+4, "Coprocessor 4 Disabled" },
! { 32+5, "Coprocessor 5 Disabled" },
! { 32+6, "Coprocessor 6 Disabled" },
! { 32+7, "Coprocessor 7 Disabled" },
! { XCHAL_EXCCAUSE_FLOATING_POINT, "Floating Point" }
};
***************
*** 127,136 ****
void do_unhandled(struct pt_regs *regs)
{
- /*
- * Game over - no way to handle this if it ever occurs.
- * Most probably caused by a new unknown cpu type or
- * after another deadly hard/software error.
- */
-
int i;
char *str = missing_translation;
--- 127,130 ----
***************
*** 142,157 ****
}
! panic("Caught unhandled exception - should not happen.\n"
! "\tEXCCAUSE is %d, %s", regs->exccause, str);
! }
!
! void do_reserved(struct pt_regs *regs)
! {
! /*
! * Game over - no way to handle this if it ever occurs.
! * Most probably caused by a new unknown cpu type or
! * after another deadly hard/software error.
! */
! panic("Caught reserved exception - should not happen.");
}
--- 136,150 ----
}
! if (user_mode(regs)) {
! /* If in user mode, kill it. */
! printk("Caught unhandled exception (%s, exccause=%d)"
! " in '%s' (pid=%d, pc=%#010x)\n",
! str, regs->exccause, current->comm, current->pid, regs->pc);
! force_sig(SIGKILL, current);
! } else {
! /* If in kernel mode, we're in trouble. */
! panic("Caught unhandled exception (%s, exccause=%d, pc=%#010x)\n",
! str, regs->exccause, regs->pc);
! }
}
|