From: Andrew Morton Implement pause_on_oops() on x86_64. Cc: Andi Kleen Signed-off-by: Andrew Morton --- arch/x86_64/kernel/traps.c | 5 ++++- arch/x86_64/mm/fault.c | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff -puN arch/x86_64/kernel/traps.c~x86_64-wire-up-oops_enter-oops_exit arch/x86_64/kernel/traps.c --- a/arch/x86_64/kernel/traps.c~x86_64-wire-up-oops_enter-oops_exit +++ a/arch/x86_64/kernel/traps.c @@ -623,11 +623,14 @@ void __kprobes __die(const char * str, s void die(const char * str, struct pt_regs * regs, long err) { - unsigned long flags = oops_begin(); + unsigned long flags; + oops_enter(); + flags = oops_begin(); handle_BUG(regs); __die(str, regs, err); oops_end(flags); + oops_exit(); do_exit(SIGSEGV); } diff -puN arch/x86_64/mm/fault.c~x86_64-wire-up-oops_enter-oops_exit arch/x86_64/mm/fault.c --- a/arch/x86_64/mm/fault.c~x86_64-wire-up-oops_enter-oops_exit +++ a/arch/x86_64/mm/fault.c @@ -255,9 +255,11 @@ int unhandled_signal(struct task_struct static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs, unsigned long error_code) { - unsigned long flags = oops_begin(); + unsigned long flags; struct task_struct *tsk; + oops_enter(); + flags = oops_begin(); printk(KERN_ALERT "%s: Corrupted page table at address %lx\n", current->comm, address); dump_pagetable(address); @@ -267,6 +269,7 @@ static noinline void pgtable_bad(unsigne tsk->thread.error_code = error_code; __die("Bad pagetable", regs, error_code); oops_end(flags); + oops_exit(); do_exit(SIGKILL); } @@ -556,6 +559,7 @@ no_context: * terminate things with extreme prejudice. */ + oops_enter(); flags = oops_begin(); if (address < PAGE_SIZE) @@ -572,6 +576,7 @@ no_context: /* Executive summary in case the body of the oops scrolled away */ printk(KERN_EMERG "CR2: %016lx\n", address); oops_end(flags); + oops_exit(); do_exit(SIGKILL); /* _