
From: "Andi Kleen" <ak@suse.de>

Always print segfaults for init. 

This gives better debugging output when something is really wrong with the
kernel.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/x86_64/mm/fault.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -puN arch/x86_64/mm/fault.c~x86_64-always-print-segfaults-for-init arch/x86_64/mm/fault.c
--- 25/arch/x86_64/mm/fault.c~x86_64-always-print-segfaults-for-init	2004-11-28 01:54:44.114890624 -0800
+++ 25-akpm/arch/x86_64/mm/fault.c	2004-11-28 01:54:44.117890168 -0800
@@ -212,6 +212,8 @@ static int is_errata93(struct pt_regs *r
 
 int unhandled_signal(struct task_struct *tsk, int sig)
 {
+	if (tsk->pid == 1)
+		return 1;
 	/* Warn for strace, but not for gdb */
 	if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) &&
 	    (tsk->ptrace & PT_PTRACED))
@@ -483,8 +485,9 @@ bad_area_nosemaphore:
 			return;
 
 		if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
-			printk(KERN_INFO
-		       "%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
+			printk(
+		       "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
+					tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
 					tsk->comm, tsk->pid, address, regs->rip,
 					regs->rsp, error_code);
 		}
_
