.. | .. |
---|
21 | 21 | |
---|
22 | 22 | #include <asm/elf.h> |
---|
23 | 23 | #include <asm/ia32.h> |
---|
24 | | -#include <asm/syscalls.h> |
---|
25 | | -#include <asm/mpx.h> |
---|
26 | 24 | |
---|
27 | 25 | /* |
---|
28 | 26 | * Align a virtual address to avoid aliasing in the I$ on AMD F15h. |
---|
.. | .. |
---|
70 | 68 | if (*str == 0) |
---|
71 | 69 | return 1; |
---|
72 | 70 | |
---|
73 | | - if (*str == '=') |
---|
74 | | - str++; |
---|
75 | | - |
---|
76 | 71 | if (!strcmp(str, "32")) |
---|
77 | 72 | va_align.flags = ALIGN_VA_32; |
---|
78 | 73 | else if (!strcmp(str, "64")) |
---|
.. | .. |
---|
82 | 77 | else if (!strcmp(str, "on")) |
---|
83 | 78 | va_align.flags = ALIGN_VA_32 | ALIGN_VA_64; |
---|
84 | 79 | else |
---|
85 | | - return 0; |
---|
| 80 | + pr_warn("invalid option value: 'align_va_addr=%s'\n", str); |
---|
86 | 81 | |
---|
87 | 82 | return 1; |
---|
88 | 83 | } |
---|
89 | | -__setup("align_va_addr", control_va_addr_alignment); |
---|
| 84 | +__setup("align_va_addr=", control_va_addr_alignment); |
---|
90 | 85 | |
---|
91 | 86 | SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, |
---|
92 | 87 | unsigned long, prot, unsigned long, flags, |
---|
.. | .. |
---|
105 | 100 | static void find_start_end(unsigned long addr, unsigned long flags, |
---|
106 | 101 | unsigned long *begin, unsigned long *end) |
---|
107 | 102 | { |
---|
108 | | - if (!in_compat_syscall() && (flags & MAP_32BIT)) { |
---|
| 103 | + if (!in_32bit_syscall() && (flags & MAP_32BIT)) { |
---|
109 | 104 | /* This is usually used needed to map code in small |
---|
110 | 105 | model, so it needs to be in the first 31bit. Limit |
---|
111 | 106 | it to that. This means we need to move the |
---|
.. | .. |
---|
122 | 117 | } |
---|
123 | 118 | |
---|
124 | 119 | *begin = get_mmap_base(1); |
---|
125 | | - if (in_compat_syscall()) |
---|
| 120 | + if (in_32bit_syscall()) |
---|
126 | 121 | *end = task_size_32bit(); |
---|
127 | 122 | else |
---|
128 | 123 | *end = task_size_64bit(addr > DEFAULT_MAP_WINDOW); |
---|
.. | .. |
---|
136 | 131 | struct vm_area_struct *vma; |
---|
137 | 132 | struct vm_unmapped_area_info info; |
---|
138 | 133 | unsigned long begin, end; |
---|
139 | | - |
---|
140 | | - addr = mpx_unmapped_area_check(addr, len, flags); |
---|
141 | | - if (IS_ERR_VALUE(addr)) |
---|
142 | | - return addr; |
---|
143 | 134 | |
---|
144 | 135 | if (flags & MAP_FIXED) |
---|
145 | 136 | return addr; |
---|
.. | .. |
---|
180 | 171 | unsigned long addr = addr0; |
---|
181 | 172 | struct vm_unmapped_area_info info; |
---|
182 | 173 | |
---|
183 | | - addr = mpx_unmapped_area_check(addr, len, flags); |
---|
184 | | - if (IS_ERR_VALUE(addr)) |
---|
185 | | - return addr; |
---|
186 | | - |
---|
187 | 174 | /* requested length too big for entire address space */ |
---|
188 | 175 | if (len > TASK_SIZE) |
---|
189 | 176 | return -ENOMEM; |
---|
.. | .. |
---|
193 | 180 | return addr; |
---|
194 | 181 | |
---|
195 | 182 | /* for MAP_32BIT mappings we force the legacy mmap base */ |
---|
196 | | - if (!in_compat_syscall() && (flags & MAP_32BIT)) |
---|
| 183 | + if (!in_32bit_syscall() && (flags & MAP_32BIT)) |
---|
197 | 184 | goto bottomup; |
---|
198 | 185 | |
---|
199 | 186 | /* requesting a specific address */ |
---|
.. | .. |
---|
217 | 204 | * If hint address is above DEFAULT_MAP_WINDOW, look for unmapped area |
---|
218 | 205 | * in the full address space. |
---|
219 | 206 | * |
---|
220 | | - * !in_compat_syscall() check to avoid high addresses for x32. |
---|
| 207 | + * !in_32bit_syscall() check to avoid high addresses for x32 |
---|
| 208 | + * (and make it no op on native i386). |
---|
221 | 209 | */ |
---|
222 | | - if (addr > DEFAULT_MAP_WINDOW && !in_compat_syscall()) |
---|
| 210 | + if (addr > DEFAULT_MAP_WINDOW && !in_32bit_syscall()) |
---|
223 | 211 | info.high_limit += TASK_SIZE_MAX - DEFAULT_MAP_WINDOW; |
---|
224 | 212 | |
---|
225 | 213 | info.align_mask = 0; |
---|