microblaze: Fix do_page_fault for no context
authorMichal Simek <monstr@monstr.eu>
Thu, 16 Jul 2009 14:00:49 +0000 (16:00 +0200)
committerMichal Simek <monstr@monstr.eu>
Mon, 27 Jul 2009 05:39:55 +0000 (07:39 +0200)
Calling fixup when we are in kernel mode. This
prevent fault for copy_to/from_user. This fault
was find thanks to writev01/03/04 LTP tests.

Signed-off-by: Michal Simek <monstr@monstr.eu>
arch/microblaze/mm/fault.c

index 956607a63f4c21327b1b1d749031cbbd7510ee58..398c76117355db195a59310d30fe79ea999451e4 100644 (file)
@@ -122,15 +122,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
        }
 #endif /* CONFIG_KGDB */
 
-       if (in_atomic() || mm == NULL) {
-               /* FIXME */
-               if (kernel_mode(regs)) {
-                       printk(KERN_EMERG
-                               "Page fault in kernel mode - Oooou!!! pid %d\n",
-                               current->pid);
-                       _exception(SIGSEGV, regs, code, address);
-                       return;
-               }
+       if (in_atomic() || !mm) {
+               if (kernel_mode(regs))
+                       goto bad_area_nosemaphore;
+
                /* in_atomic() in user mode is really bad,
                   as is current->mm == NULL. */
                printk(KERN_EMERG "Page fault in user mode with "