aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-01-30 07:32:59 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:59 -0500
commit318aa296c329625916c47703eab906d6ebf13930 (patch)
treeb62ce3ff3c281f1f85eb9f73cdc2dbbbc8fd07e4
parenta604b38036bee1483fb98a520c69895d5d6276a6 (diff)
x86: more users of PF_ constants in fault_32|64.c
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>
-rw-r--r--arch/x86/mm/fault_32.c7
-rw-r--r--arch/x86/mm/fault_64.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c
index b1893ebf6456..421e276770ad 100644
--- a/arch/x86/mm/fault_32.c
+++ b/arch/x86/mm/fault_32.c
@@ -404,7 +404,8 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
404 * protection error (error_code & 9) == 0. 404 * protection error (error_code & 9) == 0.
405 */ 405 */
406 if (unlikely(address >= TASK_SIZE)) { 406 if (unlikely(address >= TASK_SIZE)) {
407 if (!(error_code & 0x0000000d) && vmalloc_fault(address) >= 0) 407 if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
408 vmalloc_fault(address) >= 0)
408 return; 409 return;
409 if (notify_page_fault(regs)) 410 if (notify_page_fault(regs))
410 return; 411 return;
@@ -603,7 +604,7 @@ no_context:
603 __typeof__(pte_val(__pte(0))) page; 604 __typeof__(pte_val(__pte(0))) page;
604 605
605#ifdef CONFIG_X86_PAE 606#ifdef CONFIG_X86_PAE
606 if (error_code & 16) { 607 if (error_code & PF_INSTR) {
607 pte_t *pte = lookup_address(address); 608 pte_t *pte = lookup_address(address);
608 609
609 if (pte && pte_present(*pte) && !pte_exec_kernel(*pte)) 610 if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
@@ -674,7 +675,7 @@ out_of_memory:
674 goto survive; 675 goto survive;
675 } 676 }
676 printk("VM: killing process %s\n", tsk->comm); 677 printk("VM: killing process %s\n", tsk->comm);
677 if (error_code & 4) 678 if (error_code & PF_USER)
678 do_group_exit(SIGKILL); 679 do_group_exit(SIGKILL);
679 goto no_context; 680 goto no_context;
680 681
diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c
index 058b04cb96d4..95f142f5b5cc 100644
--- a/arch/x86/mm/fault_64.c
+++ b/arch/x86/mm/fault_64.c
@@ -677,7 +677,7 @@ out_of_memory:
677 goto again; 677 goto again;
678 } 678 }
679 printk("VM: killing process %s\n", tsk->comm); 679 printk("VM: killing process %s\n", tsk->comm);
680 if (error_code & 4) 680 if (error_code & PF_USER)
681 do_group_exit(SIGKILL); 681 do_group_exit(SIGKILL);
682 goto no_context; 682 goto no_context;
683 683