s390/mm: Convert to LOCK_MM_AND_FIND_VMA

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>
This commit is contained in:
Heiko Carstens 2024-10-22 14:06:01 +02:00
parent a12d622ad5
commit 57d1da4fd8
2 changed files with 3 additions and 11 deletions

View 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

View 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 @@ static void do_exception(struct pt_regs *regs, int access)
}
if (fault & VM_FAULT_RETRY) {
flags |= FAULT_FLAG_TRIED;
mmap_read_lock(mm);
goto retry;
}
mmap_read_unlock(mm);