x86: last of trivial fault_32|64.c unification
Comments, indentation, printk format. Uses task_pid_nr() on X86_64 now, but this is always defined to task->pid. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
608566b4ed
commit
6f4d368ef9
2 changed files with 31 additions and 18 deletions
|
@ -460,8 +460,12 @@ bad_area_nosemaphore:
|
||||||
|
|
||||||
if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
|
if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
|
||||||
printk_ratelimit()) {
|
printk_ratelimit()) {
|
||||||
printk("%s%s[%d]: segfault at %08lx ip %08lx "
|
printk(
|
||||||
"sp %08lx error %lx\n",
|
#ifdef CONFIG_X86_32
|
||||||
|
"%s%s[%d]: segfault at %08lx ip %08lx sp %08lx error %lx\n",
|
||||||
|
#else
|
||||||
|
"%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
|
||||||
|
#endif
|
||||||
task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
|
task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
|
||||||
tsk->comm, task_pid_nr(tsk), address, regs->ip,
|
tsk->comm, task_pid_nr(tsk), address, regs->ip,
|
||||||
regs->sp, error_code);
|
regs->sp, error_code);
|
||||||
|
|
|
@ -440,8 +440,11 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
|
||||||
if (!(vma->vm_flags & VM_GROWSDOWN))
|
if (!(vma->vm_flags & VM_GROWSDOWN))
|
||||||
goto bad_area;
|
goto bad_area;
|
||||||
if (error_code & PF_USER) {
|
if (error_code & PF_USER) {
|
||||||
/* Allow userspace just enough access below the stack pointer
|
/*
|
||||||
* to let the 'enter' instruction work.
|
* Accessing the stack below %sp is always a bug.
|
||||||
|
* The large cushion allows instructions like enter
|
||||||
|
* and pusha to work. ("enter $65535,$31" pushes
|
||||||
|
* 32 pointers and then decrements %sp by 65535.)
|
||||||
*/
|
*/
|
||||||
if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp)
|
if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp)
|
||||||
goto bad_area;
|
goto bad_area;
|
||||||
|
@ -522,9 +525,13 @@ bad_area_nosemaphore:
|
||||||
if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
|
if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
|
||||||
printk_ratelimit()) {
|
printk_ratelimit()) {
|
||||||
printk(
|
printk(
|
||||||
|
#ifdef CONFIG_X86_32
|
||||||
|
"%s%s[%d]: segfault at %08lx ip %08lx sp %08lx error %lx\n",
|
||||||
|
#else
|
||||||
"%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
|
"%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
|
||||||
tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
|
#endif
|
||||||
tsk->comm, tsk->pid, address, regs->ip,
|
task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
|
||||||
|
tsk->comm, task_pid_nr(tsk), address, regs->ip,
|
||||||
regs->sp, error_code);
|
regs->sp, error_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,10 +616,12 @@ LIST_HEAD(pgd_list);
|
||||||
|
|
||||||
void vmalloc_sync_all(void)
|
void vmalloc_sync_all(void)
|
||||||
{
|
{
|
||||||
/* Note that races in the updates of insync and start aren't
|
/*
|
||||||
problematic:
|
* Note that races in the updates of insync and start aren't
|
||||||
insync can only get set bits added, and updates to start are only
|
* problematic: insync can only get set bits added, and updates to
|
||||||
improving performance (without affecting correctness if undone). */
|
* start are only improving performance (without affecting correctness
|
||||||
|
* if undone).
|
||||||
|
*/
|
||||||
static DECLARE_BITMAP(insync, PTRS_PER_PGD);
|
static DECLARE_BITMAP(insync, PTRS_PER_PGD);
|
||||||
static unsigned long start = VMALLOC_START & PGDIR_MASK;
|
static unsigned long start = VMALLOC_START & PGDIR_MASK;
|
||||||
unsigned long address;
|
unsigned long address;
|
||||||
|
|
Loading…
Add table
Reference in a new issue