Skip to content

Commit 7227d70

Browse files
bwhacksgregkh
authored andcommitted
mips/mm: Convert to using lock_mm_and_find_vma()
commit 4bce37a upstream. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Samuel Mendoza-Jonas <[email protected]> Signed-off-by: David Woodhouse <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 82972ea commit 7227d70

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ config MIPS
9494
select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP
9595
select IRQ_FORCED_THREADING
9696
select ISA if EISA
97+
select LOCK_MM_AND_FIND_VMA
9798
select MODULES_USE_ELF_REL if MODULES
9899
select MODULES_USE_ELF_RELA if MODULES && 64BIT
99100
select PERF_USE_VMALLOC

arch/mips/mm/fault.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,13 @@ static void __do_page_fault(struct pt_regs *regs, unsigned long write,
9999

100100
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
101101
retry:
102-
mmap_read_lock(mm);
103-
vma = find_vma(mm, address);
102+
vma = lock_mm_and_find_vma(mm, address, regs);
104103
if (!vma)
105-
goto bad_area;
106-
if (vma->vm_start <= address)
107-
goto good_area;
108-
if (!(vma->vm_flags & VM_GROWSDOWN))
109-
goto bad_area;
110-
if (expand_stack(vma, address))
111-
goto bad_area;
104+
goto bad_area_nosemaphore;
112105
/*
113106
* Ok, we have a good vm_area for this memory access, so
114107
* we can handle it..
115108
*/
116-
good_area:
117109
si_code = SEGV_ACCERR;
118110

119111
if (write) {

0 commit comments

Comments
 (0)