aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r--arch/x86/mm/fault.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 654be4ae3047..6d77c3866faa 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1011,9 +1011,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code)
1011 unsigned long address; 1011 unsigned long address;
1012 struct mm_struct *mm; 1012 struct mm_struct *mm;
1013 int fault; 1013 int fault;
1014 int write = error_code & PF_WRITE; 1014 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
1015 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
1016 (write ? FAULT_FLAG_WRITE : 0);
1017 1015
1018 tsk = current; 1016 tsk = current;
1019 mm = tsk->mm; 1017 mm = tsk->mm;
@@ -1083,6 +1081,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code)
1083 if (user_mode_vm(regs)) { 1081 if (user_mode_vm(regs)) {
1084 local_irq_enable(); 1082 local_irq_enable();
1085 error_code |= PF_USER; 1083 error_code |= PF_USER;
1084 flags |= FAULT_FLAG_USER;
1086 } else { 1085 } else {
1087 if (regs->flags & X86_EFLAGS_IF) 1086 if (regs->flags & X86_EFLAGS_IF)
1088 local_irq_enable(); 1087 local_irq_enable();
@@ -1109,6 +1108,9 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code)
1109 return; 1108 return;
1110 } 1109 }
1111 1110
1111 if (error_code & PF_WRITE)
1112 flags |= FAULT_FLAG_WRITE;
1113
1112 /* 1114 /*
1113 * When running in the kernel we expect faults to occur only to 1115 * When running in the kernel we expect faults to occur only to
1114 * addresses in user space. All other faults represent errors in 1116 * addresses in user space. All other faults represent errors in