aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/hexagon/mm')
-rw-r--r--arch/hexagon/mm/vm_fault.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/hexagon/mm/vm_fault.c b/arch/hexagon/mm/vm_fault.c
index 1bd276dbec7d..8704c9320032 100644
--- a/arch/hexagon/mm/vm_fault.c
+++ b/arch/hexagon/mm/vm_fault.c
@@ -53,8 +53,7 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)
53 int si_code = SEGV_MAPERR; 53 int si_code = SEGV_MAPERR;
54 int fault; 54 int fault;
55 const struct exception_table_entry *fixup; 55 const struct exception_table_entry *fixup;
56 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | 56 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
57 (cause > 0 ? FAULT_FLAG_WRITE : 0);
58 57
59 /* 58 /*
60 * If we're in an interrupt or have no user context, 59 * If we're in an interrupt or have no user context,
@@ -65,6 +64,8 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)
65 64
66 local_irq_enable(); 65 local_irq_enable();
67 66
67 if (user_mode(regs))
68 flags |= FAULT_FLAG_USER;
68retry: 69retry:
69 down_read(&mm->mmap_sem); 70 down_read(&mm->mmap_sem);
70 vma = find_vma(mm, address); 71 vma = find_vma(mm, address);
@@ -96,6 +97,7 @@ good_area:
96 case FLT_STORE: 97 case FLT_STORE:
97 if (!(vma->vm_flags & VM_WRITE)) 98 if (!(vma->vm_flags & VM_WRITE))
98 goto bad_area; 99 goto bad_area;
100 flags |= FAULT_FLAG_WRITE;
99 break; 101 break;
100 } 102 }
101 103