]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/mm/fault.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6-omap-h63xx.git] / arch / x86 / mm / fault.c
index ec08d83898505171ca31b146d4bb0360690ae884..8bcb6f40ccb6c61b762fac7def5c26a8eb01ba4b 100644 (file)
@@ -497,6 +497,11 @@ static int vmalloc_fault(unsigned long address)
        unsigned long pgd_paddr;
        pmd_t *pmd_k;
        pte_t *pte_k;
+
+       /* Make sure we are in vmalloc area */
+       if (!(address >= VMALLOC_START && address < VMALLOC_END))
+               return -1;
+
        /*
         * Synchronize this task's top level page-table
         * with the 'reference' page table.
@@ -639,7 +644,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
 #ifdef CONFIG_X86_32
        /* It's safe to allow irq's after cr2 has been saved and the vmalloc
           fault has been handled. */
-       if (regs->flags & (X86_EFLAGS_IF|VM_MASK))
+       if (regs->flags & (X86_EFLAGS_IF | X86_VM_MASK))
                local_irq_enable();
 
        /*
@@ -976,9 +981,5 @@ void vmalloc_sync_all(void)
                if (address == start)
                        start = address + PGDIR_SIZE;
        }
-       /* Check that there is no need to do the same for the modules area. */
-       BUILD_BUG_ON(!(MODULES_VADDR > __START_KERNEL));
-       BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) ==
-                               (__START_KERNEL & PGDIR_MASK)));
 #endif
 }