]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/mm: Convert to LOCK_MM_AND_FIND_VMA
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 22 Oct 2024 12:06:01 +0000 (14:06 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 29 Oct 2024 10:49:19 +0000 (11:49 +0100)
With the gmap code gone s390 can be easily converted to
LOCK_MM_AND_FIND_VMA like it has been done for most other
architectures.

Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/r/20241022120601.167009-12-imbrenda@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/Kconfig
arch/s390/mm/fault.c

index d339fe4fdedf881fd9224020381a1c7f62998d59..8109446f7b2410514b3a2dc4562adb8068ae2d9e 100644 (file)
@@ -224,6 +224,7 @@ config S390
        select HAVE_VIRT_CPU_ACCOUNTING_IDLE
        select IOMMU_HELPER             if PCI
        select IOMMU_SUPPORT            if PCI
+       select LOCK_MM_AND_FIND_VMA
        select MMU_GATHER_MERGE_VMAS
        select MMU_GATHER_NO_GATHER
        select MMU_GATHER_RCU_TABLE_FREE
index 93ae097ef0e0801cefc1476690b0cae1810ce60c..8bd2b8d64273eb72dea63a9ebecbeed199dd9b8e 100644 (file)
@@ -308,18 +308,10 @@ static void do_exception(struct pt_regs *regs, int access)
                return;
        }
 lock_mmap:
-       mmap_read_lock(mm);
 retry:
-       vma = find_vma(mm, address);
+       vma = lock_mm_and_find_vma(mm, address, regs);
        if (!vma)
-               return handle_fault_error(regs, SEGV_MAPERR);
-       if (unlikely(vma->vm_start > address)) {
-               if (!(vma->vm_flags & VM_GROWSDOWN))
-                       return handle_fault_error(regs, SEGV_MAPERR);
-               vma = expand_stack(mm, address);
-               if (!vma)
-                       return handle_fault_error_nolock(regs, SEGV_MAPERR);
-       }
+               return handle_fault_error_nolock(regs, SEGV_MAPERR);
        if (unlikely(!(vma->vm_flags & access)))
                return handle_fault_error(regs, SEGV_ACCERR);
        fault = handle_mm_fault(vma, address, flags, regs);
@@ -337,7 +329,6 @@ retry:
        }
        if (fault & VM_FAULT_RETRY) {
                flags |= FAULT_FLAG_TRIED;
-               mmap_read_lock(mm);
                goto retry;
        }
        mmap_read_unlock(mm);