]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86: more users of PF_ constants in fault_32|64.c
authorHarvey Harrison <harvey.harrison@gmail.com>
Wed, 30 Jan 2008 12:32:59 +0000 (13:32 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:32:59 +0000 (13:32 +0100)
Should be the last of the error_code tests that could use
the PF_ defines.  Makes X86_32|64 a little closer.

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>
arch/x86/mm/fault_32.c
arch/x86/mm/fault_64.c

index b1893ebf645624989e63a8f0c8946f7999c22dbb..421e276770ad3f27ba508d0ee2a1e0330e983222 100644 (file)
@@ -404,7 +404,8 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
         * protection error (error_code & 9) == 0.
         */
        if (unlikely(address >= TASK_SIZE)) {
-               if (!(error_code & 0x0000000d) && vmalloc_fault(address) >= 0)
+               if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
+                   vmalloc_fault(address) >= 0)
                        return;
                if (notify_page_fault(regs))
                        return;
@@ -603,7 +604,7 @@ no_context:
                __typeof__(pte_val(__pte(0))) page;
 
 #ifdef CONFIG_X86_PAE
-               if (error_code & 16) {
+               if (error_code & PF_INSTR) {
                        pte_t *pte = lookup_address(address);
 
                        if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
@@ -674,7 +675,7 @@ out_of_memory:
                goto survive;
        }
        printk("VM: killing process %s\n", tsk->comm);
-       if (error_code & 4)
+       if (error_code & PF_USER)
                do_group_exit(SIGKILL);
        goto no_context;
 
index 058b04cb96d4d81b5dd0a8fc2f80f50335b120f9..95f142f5b5cc6053f2adeb694e0730450d7787f0 100644 (file)
@@ -677,7 +677,7 @@ out_of_memory:
                goto again;
        }
        printk("VM: killing process %s\n", tsk->comm);
-       if (error_code & 4)
+       if (error_code & PF_USER)
                do_group_exit(SIGKILL);
        goto no_context;