diff options
Diffstat (limited to 'arch/mips/mm/fault.c')
-rw-r--r-- | arch/mips/mm/fault.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 94d3a31ab144..becc42bb1849 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c | |||
@@ -42,8 +42,7 @@ static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long write, | |||
42 | const int field = sizeof(unsigned long) * 2; | 42 | const int field = sizeof(unsigned long) * 2; |
43 | siginfo_t info; | 43 | siginfo_t info; |
44 | int fault; | 44 | int fault; |
45 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | 45 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; |
46 | (write ? FAULT_FLAG_WRITE : 0); | ||
47 | 46 | ||
48 | #if 0 | 47 | #if 0 |
49 | printk("Cpu%d[%s:%d:%0*lx:%ld:%0*lx]\n", raw_smp_processor_id(), | 48 | printk("Cpu%d[%s:%d:%0*lx:%ld:%0*lx]\n", raw_smp_processor_id(), |
@@ -93,6 +92,8 @@ static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long write, | |||
93 | if (in_atomic() || !mm) | 92 | if (in_atomic() || !mm) |
94 | goto bad_area_nosemaphore; | 93 | goto bad_area_nosemaphore; |
95 | 94 | ||
95 | if (user_mode(regs)) | ||
96 | flags |= FAULT_FLAG_USER; | ||
96 | retry: | 97 | retry: |
97 | down_read(&mm->mmap_sem); | 98 | down_read(&mm->mmap_sem); |
98 | vma = find_vma(mm, address); | 99 | vma = find_vma(mm, address); |
@@ -114,6 +115,7 @@ good_area: | |||
114 | if (write) { | 115 | if (write) { |
115 | if (!(vma->vm_flags & VM_WRITE)) | 116 | if (!(vma->vm_flags & VM_WRITE)) |
116 | goto bad_area; | 117 | goto bad_area; |
118 | flags |= FAULT_FLAG_WRITE; | ||
117 | } else { | 119 | } else { |
118 | if (cpu_has_rixi) { | 120 | if (cpu_has_rixi) { |
119 | if (address == regs->cp0_epc && !(vma->vm_flags & VM_EXEC)) { | 121 | if (address == regs->cp0_epc && !(vma->vm_flags & VM_EXEC)) { |