mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
UPSTREAM: powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma()
commit2cd76c50d0upstream. 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 <torvalds@linux-foundation.org> Signed-off-by: Samuel Mendoza-Jonas <samjonas@amazon.com> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I5736f498b2f45625e46554520d3aeb679e680907 (cherry picked from commit2cd76c50d0) Signed-off-by: Suren Baghdasaryan <surenb@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6c33246824
commit
4087cac574
@@ -33,19 +33,11 @@ int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
|
|||||||
if (mm->pgd == NULL)
|
if (mm->pgd == NULL)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
mmap_read_lock(mm);
|
vma = lock_mm_and_find_vma(mm, ea, NULL);
|
||||||
ret = -EFAULT;
|
|
||||||
vma = find_vma(mm, ea);
|
|
||||||
if (!vma)
|
if (!vma)
|
||||||
goto out_unlock;
|
return -EFAULT;
|
||||||
|
|
||||||
if (ea < vma->vm_start) {
|
|
||||||
if (!(vma->vm_flags & VM_GROWSDOWN))
|
|
||||||
goto out_unlock;
|
|
||||||
if (expand_stack(vma, ea))
|
|
||||||
goto out_unlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ret = -EFAULT;
|
||||||
is_write = dsisr & DSISR_ISSTORE;
|
is_write = dsisr & DSISR_ISSTORE;
|
||||||
if (is_write) {
|
if (is_write) {
|
||||||
if (!(vma->vm_flags & VM_WRITE))
|
if (!(vma->vm_flags & VM_WRITE))
|
||||||
|
|||||||
Reference in New Issue
Block a user