diff options
Diffstat (limited to 'arch/x86/lib/copy_user_64.S')
-rw-r--r-- | arch/x86/lib/copy_user_64.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S index 5b2995f4557a..a30ca15be21c 100644 --- a/arch/x86/lib/copy_user_64.S +++ b/arch/x86/lib/copy_user_64.S | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/cpufeature.h> | 17 | #include <asm/cpufeature.h> |
18 | #include <asm/alternative-asm.h> | 18 | #include <asm/alternative-asm.h> |
19 | #include <asm/asm.h> | 19 | #include <asm/asm.h> |
20 | #include <asm/smap.h> | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * By placing feature2 after feature1 in altinstructions section, we logically | 23 | * By placing feature2 after feature1 in altinstructions section, we logically |
@@ -130,6 +131,7 @@ ENDPROC(bad_from_user) | |||
130 | */ | 131 | */ |
131 | ENTRY(copy_user_generic_unrolled) | 132 | ENTRY(copy_user_generic_unrolled) |
132 | CFI_STARTPROC | 133 | CFI_STARTPROC |
134 | ASM_STAC | ||
133 | cmpl $8,%edx | 135 | cmpl $8,%edx |
134 | jb 20f /* less then 8 bytes, go to byte copy loop */ | 136 | jb 20f /* less then 8 bytes, go to byte copy loop */ |
135 | ALIGN_DESTINATION | 137 | ALIGN_DESTINATION |
@@ -177,6 +179,7 @@ ENTRY(copy_user_generic_unrolled) | |||
177 | decl %ecx | 179 | decl %ecx |
178 | jnz 21b | 180 | jnz 21b |
179 | 23: xor %eax,%eax | 181 | 23: xor %eax,%eax |
182 | ASM_CLAC | ||
180 | ret | 183 | ret |
181 | 184 | ||
182 | .section .fixup,"ax" | 185 | .section .fixup,"ax" |
@@ -232,6 +235,7 @@ ENDPROC(copy_user_generic_unrolled) | |||
232 | */ | 235 | */ |
233 | ENTRY(copy_user_generic_string) | 236 | ENTRY(copy_user_generic_string) |
234 | CFI_STARTPROC | 237 | CFI_STARTPROC |
238 | ASM_STAC | ||
235 | andl %edx,%edx | 239 | andl %edx,%edx |
236 | jz 4f | 240 | jz 4f |
237 | cmpl $8,%edx | 241 | cmpl $8,%edx |
@@ -246,6 +250,7 @@ ENTRY(copy_user_generic_string) | |||
246 | 3: rep | 250 | 3: rep |
247 | movsb | 251 | movsb |
248 | 4: xorl %eax,%eax | 252 | 4: xorl %eax,%eax |
253 | ASM_CLAC | ||
249 | ret | 254 | ret |
250 | 255 | ||
251 | .section .fixup,"ax" | 256 | .section .fixup,"ax" |
@@ -273,12 +278,14 @@ ENDPROC(copy_user_generic_string) | |||
273 | */ | 278 | */ |
274 | ENTRY(copy_user_enhanced_fast_string) | 279 | ENTRY(copy_user_enhanced_fast_string) |
275 | CFI_STARTPROC | 280 | CFI_STARTPROC |
281 | ASM_STAC | ||
276 | andl %edx,%edx | 282 | andl %edx,%edx |
277 | jz 2f | 283 | jz 2f |
278 | movl %edx,%ecx | 284 | movl %edx,%ecx |
279 | 1: rep | 285 | 1: rep |
280 | movsb | 286 | movsb |
281 | 2: xorl %eax,%eax | 287 | 2: xorl %eax,%eax |
288 | ASM_CLAC | ||
282 | ret | 289 | ret |
283 | 290 | ||
284 | .section .fixup,"ax" | 291 | .section .fixup,"ax" |