.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de) |
---|
3 | 4 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
---|
4 | | - * Licensed under the GPL |
---|
5 | 5 | */ |
---|
6 | 6 | |
---|
7 | 7 | #include <linux/mm.h> |
---|
.. | .. |
---|
9 | 9 | #include <linux/slab.h> |
---|
10 | 10 | |
---|
11 | 11 | #include <asm/pgalloc.h> |
---|
12 | | -#include <asm/pgtable.h> |
---|
13 | 12 | #include <asm/sections.h> |
---|
14 | 13 | #include <as-layout.h> |
---|
15 | 14 | #include <os.h> |
---|
.. | .. |
---|
19 | 18 | unsigned long kernel) |
---|
20 | 19 | { |
---|
21 | 20 | pgd_t *pgd; |
---|
| 21 | + p4d_t *p4d; |
---|
22 | 22 | pud_t *pud; |
---|
23 | 23 | pmd_t *pmd; |
---|
24 | 24 | pte_t *pte; |
---|
25 | 25 | |
---|
26 | 26 | pgd = pgd_offset(mm, proc); |
---|
27 | | - pud = pud_alloc(mm, pgd, proc); |
---|
28 | | - if (!pud) |
---|
| 27 | + |
---|
| 28 | + p4d = p4d_alloc(mm, pgd, proc); |
---|
| 29 | + if (!p4d) |
---|
29 | 30 | goto out; |
---|
| 31 | + |
---|
| 32 | + pud = pud_alloc(mm, p4d, proc); |
---|
| 33 | + if (!pud) |
---|
| 34 | + goto out_pud; |
---|
30 | 35 | |
---|
31 | 36 | pmd = pmd_alloc(mm, pud, proc); |
---|
32 | 37 | if (!pmd) |
---|
.. | .. |
---|
44 | 49 | pmd_free(mm, pmd); |
---|
45 | 50 | out_pmd: |
---|
46 | 51 | pud_free(mm, pud); |
---|
| 52 | + out_pud: |
---|
| 53 | + p4d_free(mm, p4d); |
---|
47 | 54 | out: |
---|
48 | 55 | return -ENOMEM; |
---|
49 | 56 | } |
---|
.. | .. |
---|
63 | 70 | if (current->mm != NULL && current->mm != &init_mm) |
---|
64 | 71 | from_mm = ¤t->mm->context; |
---|
65 | 72 | |
---|
66 | | - block_signals(); |
---|
| 73 | + block_signals_trace(); |
---|
67 | 74 | if (from_mm) |
---|
68 | 75 | to_mm->id.u.pid = copy_context_skas0(stack, |
---|
69 | 76 | from_mm->id.u.pid); |
---|
70 | 77 | else to_mm->id.u.pid = start_userspace(stack); |
---|
71 | | - unblock_signals(); |
---|
| 78 | + unblock_signals_trace(); |
---|
72 | 79 | |
---|
73 | 80 | if (to_mm->id.u.pid < 0) { |
---|
74 | 81 | ret = to_mm->id.u.pid; |
---|
.. | .. |
---|
107 | 114 | mm->context.stub_pages[0] = virt_to_page(__syscall_stub_start); |
---|
108 | 115 | mm->context.stub_pages[1] = virt_to_page(mm->context.id.stack); |
---|
109 | 116 | |
---|
110 | | - /* dup_mmap already holds mmap_sem */ |
---|
| 117 | + /* dup_mmap already holds mmap_lock */ |
---|
111 | 118 | err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START, |
---|
112 | 119 | VM_READ | VM_MAYREAD | VM_EXEC | |
---|
113 | 120 | VM_MAYEXEC | VM_DONTCOPY | VM_PFNMAP, |
---|
.. | .. |
---|
119 | 126 | return; |
---|
120 | 127 | |
---|
121 | 128 | out: |
---|
122 | | - force_sigsegv(SIGSEGV, current); |
---|
| 129 | + force_sigsegv(SIGSEGV); |
---|
123 | 130 | } |
---|
124 | 131 | |
---|
125 | 132 | void arch_exit_mmap(struct mm_struct *mm) |
---|