Skip to content

Commit 2cd76c5

Browse files
committed
powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma()
This is one of the simple cases, except there's no pt_regs pointer. Which is fine, as lock_mm_and_find_vma() is set up to work fine with a NULL pt_regs. Powerpc already enabled LOCK_MM_AND_FIND_VMA for the main CPU faulting, so we can just use the helper without any extra work. Signed-off-by: Linus Torvalds <[email protected]>
1 parent a050ba1 commit 2cd76c5

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

arch/powerpc/mm/copro_fault.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,11 @@ int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
3333
if (mm->pgd == NULL)
3434
return -EFAULT;
3535

36-
mmap_read_lock(mm);
37-
ret = -EFAULT;
38-
vma = find_vma(mm, ea);
36+
vma = lock_mm_and_find_vma(mm, ea, NULL);
3937
if (!vma)
40-
goto out_unlock;
41-
42-
if (ea < vma->vm_start) {
43-
if (!(vma->vm_flags & VM_GROWSDOWN))
44-
goto out_unlock;
45-
if (expand_stack(vma, ea))
46-
goto out_unlock;
47-
}
38+
return -EFAULT;
4839

40+
ret = -EFAULT;
4941
is_write = dsisr & DSISR_ISSTORE;
5042
if (is_write) {
5143
if (!(vma->vm_flags & VM_WRITE))

0 commit comments

Comments
 (0)