parisc: Enhance page fault termination message
In debugging kernel panics, I believe it is useful to know what type of page fault caused the termination. "Bad Address" is too vague. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
committed by
Helge Deller
parent
9d90a90855
commit
20dda87bdc
@@ -266,11 +266,14 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
|
|||||||
unsigned long acc_type;
|
unsigned long acc_type;
|
||||||
vm_fault_t fault = 0;
|
vm_fault_t fault = 0;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
|
char *msg;
|
||||||
|
|
||||||
tsk = current;
|
tsk = current;
|
||||||
mm = tsk->mm;
|
mm = tsk->mm;
|
||||||
if (!mm)
|
if (!mm) {
|
||||||
|
msg = "Page fault: no context";
|
||||||
goto no_context;
|
goto no_context;
|
||||||
|
}
|
||||||
|
|
||||||
flags = FAULT_FLAG_DEFAULT;
|
flags = FAULT_FLAG_DEFAULT;
|
||||||
if (user_mode(regs))
|
if (user_mode(regs))
|
||||||
@@ -406,6 +409,7 @@ bad_area:
|
|||||||
force_sig_fault(signo, si_code, (void __user *) address);
|
force_sig_fault(signo, si_code, (void __user *) address);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
msg = "Page fault: bad address";
|
||||||
|
|
||||||
no_context:
|
no_context:
|
||||||
|
|
||||||
@@ -413,11 +417,13 @@ no_context:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
parisc_terminate("Bad Address (null pointer deref?)", regs, code, address);
|
parisc_terminate(msg, regs, code, address);
|
||||||
|
|
||||||
out_of_memory:
|
out_of_memory:
|
||||||
mmap_read_unlock(mm);
|
mmap_read_unlock(mm);
|
||||||
if (!user_mode(regs))
|
if (!user_mode(regs)) {
|
||||||
|
msg = "Page fault: out of memory";
|
||||||
goto no_context;
|
goto no_context;
|
||||||
|
}
|
||||||
pagefault_out_of_memory();
|
pagefault_out_of_memory();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user