| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
|---|
| 3 | | - * Licensed under the GPL |
|---|
| 4 | 4 | */ |
|---|
| 5 | 5 | |
|---|
| 6 | 6 | #ifndef __UM_MMU_CONTEXT_H |
|---|
| .. | .. |
|---|
| 8 | 8 | |
|---|
| 9 | 9 | #include <linux/sched.h> |
|---|
| 10 | 10 | #include <linux/mm_types.h> |
|---|
| 11 | +#include <linux/mmap_lock.h> |
|---|
| 11 | 12 | |
|---|
| 12 | 13 | #include <asm/mmu.h> |
|---|
| 13 | 14 | |
|---|
| .. | .. |
|---|
| 22 | 23 | } |
|---|
| 23 | 24 | extern void arch_exit_mmap(struct mm_struct *mm); |
|---|
| 24 | 25 | static inline void arch_unmap(struct mm_struct *mm, |
|---|
| 25 | | - struct vm_area_struct *vma, |
|---|
| 26 | 26 | unsigned long start, unsigned long end) |
|---|
| 27 | 27 | { |
|---|
| 28 | 28 | } |
|---|
| 29 | | -static inline void arch_bprm_mm_init(struct mm_struct *mm, |
|---|
| 30 | | - struct vm_area_struct *vma) |
|---|
| 31 | | -{ |
|---|
| 32 | | -} |
|---|
| 33 | | - |
|---|
| 34 | 29 | static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, |
|---|
| 35 | 30 | bool write, bool execute, bool foreign) |
|---|
| 36 | 31 | { |
|---|
| .. | .. |
|---|
| 53 | 48 | * when the new ->mm is used for the first time. |
|---|
| 54 | 49 | */ |
|---|
| 55 | 50 | __switch_mm(&new->context.id); |
|---|
| 56 | | - down_write_nested(&new->mmap_sem, 1); |
|---|
| 51 | + mmap_write_lock_nested(new, SINGLE_DEPTH_NESTING); |
|---|
| 57 | 52 | uml_setup_stubs(new); |
|---|
| 58 | | - up_write(&new->mmap_sem); |
|---|
| 53 | + mmap_write_unlock(new); |
|---|
| 59 | 54 | } |
|---|
| 60 | 55 | |
|---|
| 61 | 56 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, |
|---|