]> err.no Git - linux-2.6/blobdiff - arch/x86/mm/fault_32.c
x86: printk kernel version in WARN_ON and other dump_stack users
[linux-2.6] / arch / x86 / mm / fault_32.c
index 4fc5e400cf0ab82a3f7769aa1d7e4aea1a95c214..a2273d44aa279fae2dd739d6247d60a487e93ea0 100644 (file)
@@ -303,6 +303,11 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
        int write, si_code;
        int fault;
 
+       /*
+        * We can fault from pretty much anywhere, with unknown IRQ state.
+        */
+       trace_hardirqs_fixup();
+
        /* get the address */
         address = read_cr2();
 
@@ -354,7 +359,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
 
        /* When running in the kernel we expect faults to occur only to
         * addresses in user space.  All other faults represent errors in the
-        * kernel and should generate an OOPS.  Unfortunatly, in the case of an
+        * kernel and should generate an OOPS.  Unfortunately, in the case of an
         * erroneous fault occurring in a code path which already holds mmap_sem
         * we will deadlock attempting to validate the fault against the
         * address space.  Luckily the kernel only validly references user
@@ -362,7 +367,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
         * exceptions table.
         *
         * As the vast majority of faults will be valid we will only perform
-        * the source reference check when there is a possibilty of a deadlock.
+        * the source reference check when there is a possibility of a deadlock.
         * Attempt to lock the address space, if we cannot we then validate the
         * source.  If this is invalid we can skip the address space check,
         * thus avoiding the deadlock.
@@ -471,8 +476,8 @@ bad_area_nosemaphore:
                    printk_ratelimit()) {
                        printk("%s%s[%d]: segfault at %08lx eip %08lx "
                            "esp %08lx error %lx\n",
-                           tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
-                           tsk->comm, tsk->pid, address, regs->eip,
+                           task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
+                           tsk->comm, task_pid_nr(tsk), address, regs->eip,
                            regs->esp, error_code);
                }
                tsk->thread.cr2 = address;
@@ -550,7 +555,7 @@ no_context:
                        page &= PAGE_MASK;
                        page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT)
                                                                 & (PTRS_PER_PMD - 1)];
-                       printk(KERN_ALERT "*pde = %016Lx ", page);
+                       printk(KERN_CONT "*pde = %016Lx ", page);
                        page &= ~_PAGE_NX;
                }
 #else
@@ -564,7 +569,8 @@ no_context:
                 * it's allocated already.
                 */
                if ((page >> PAGE_SHIFT) < max_low_pfn
-                   && (page & _PAGE_PRESENT)) {
+                   && (page & _PAGE_PRESENT)
+                   && !(page & _PAGE_PSE)) {
                        page &= PAGE_MASK;
                        page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT)
                                                                 & (PTRS_PER_PTE - 1)];