summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-20 23:07:48 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-21 00:09:44 +0100
commit1cc99544dde9e48602979f16b9309fade6e93051 (patch)
tree034a5a92f899b0e9cbcddce136f2243bc3617a1a /arch/x86/mm
parent8f7661496cece8320137d5e26808825498fd2b26 (diff)
downloadop-kernel-dev-1cc99544dde9e48602979f16b9309fade6e93051.zip
op-kernel-dev-1cc99544dde9e48602979f16b9309fade6e93051.tar.gz
x86, mm: fault.c, unify oops handling
Impact: add oops-recursion check to 32-bit Unify the oops state-machine, to the 64-bit version. It is slightly more careful in that it does a recursion check in oops_begin(), and is thus more likely to show the relevant oops. It also means that 32-bit will print one more line at the end of pagefault triggered oopses: printk(KERN_EMERG "CR2: %016lx\n", address); Which is generally good information to be seen in partial-dump digital-camera jpegs ;-) The downside is the somewhat more complex critical path. Both variants have been tested well meanwhile by kernel developers crashing their boxes so i dont think this is a practical worry. This removes 3 ugly #ifdefs from no_context() and makes the function a lot nicer read. Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/fault.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index ebfaca3..8fe2dd2 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -659,11 +659,8 @@ no_context(struct pt_regs *regs, unsigned long error_code,
{
struct task_struct *tsk = current;
unsigned long *stackend;
-
-#ifdef CONFIG_X86_64
unsigned long flags;
int sig;
-#endif
/* Are we prepared to handle this kernel fault? */
if (fixup_exception(regs))
@@ -690,11 +687,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice:
*/
-#ifdef CONFIG_X86_32
- bust_spinlocks(1);
-#else
flags = oops_begin();
-#endif
show_fault_oops(regs, error_code, address);
@@ -702,15 +695,10 @@ no_context(struct pt_regs *regs, unsigned long error_code,
if (*stackend != STACK_END_MAGIC)
printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
- tsk->thread.cr2 = address;
- tsk->thread.trap_no = 14;
- tsk->thread.error_code = error_code;
+ tsk->thread.cr2 = address;
+ tsk->thread.trap_no = 14;
+ tsk->thread.error_code = error_code;
-#ifdef CONFIG_X86_32
- die("Oops", regs, error_code);
- bust_spinlocks(0);
- do_exit(SIGKILL);
-#else
sig = SIGKILL;
if (__die("Oops", regs, error_code))
sig = 0;
@@ -719,7 +707,6 @@ no_context(struct pt_regs *regs, unsigned long error_code,
printk(KERN_EMERG "CR2: %016lx\n", address);
oops_end(flags, regs, sig);
-#endif
}
/*
OpenPOWER on IntegriCloud