diff options
| -rw-r--r-- | arch/x86/lib/memcpy_64.S | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S index 54c971892db5..5709f3ec22a4 100644 --- a/arch/x86/lib/memcpy_64.S +++ b/arch/x86/lib/memcpy_64.S | |||
| @@ -204,13 +204,14 @@ ENTRY(__memcpy_mcsafe) | |||
| 204 | subl $8, %ecx | 204 | subl $8, %ecx |
| 205 | negl %ecx | 205 | negl %ecx |
| 206 | subl %ecx, %edx | 206 | subl %ecx, %edx |
| 207 | .L_copy_leading_bytes: | 207 | .L_read_leading_bytes: |
| 208 | movb (%rsi), %al | 208 | movb (%rsi), %al |
| 209 | .L_write_leading_bytes: | ||
| 209 | movb %al, (%rdi) | 210 | movb %al, (%rdi) |
| 210 | incq %rsi | 211 | incq %rsi |
| 211 | incq %rdi | 212 | incq %rdi |
| 212 | decl %ecx | 213 | decl %ecx |
| 213 | jnz .L_copy_leading_bytes | 214 | jnz .L_read_leading_bytes |
| 214 | 215 | ||
| 215 | .L_8byte_aligned: | 216 | .L_8byte_aligned: |
| 216 | movl %edx, %ecx | 217 | movl %edx, %ecx |
| @@ -218,13 +219,14 @@ ENTRY(__memcpy_mcsafe) | |||
| 218 | shrl $3, %ecx | 219 | shrl $3, %ecx |
| 219 | jz .L_no_whole_words | 220 | jz .L_no_whole_words |
| 220 | 221 | ||
| 221 | .L_copy_words: | 222 | .L_read_words: |
| 222 | movq (%rsi), %r8 | 223 | movq (%rsi), %r8 |
| 224 | .L_write_words: | ||
| 223 | movq %r8, (%rdi) | 225 | movq %r8, (%rdi) |
| 224 | addq $8, %rsi | 226 | addq $8, %rsi |
| 225 | addq $8, %rdi | 227 | addq $8, %rdi |
| 226 | decl %ecx | 228 | decl %ecx |
| 227 | jnz .L_copy_words | 229 | jnz .L_read_words |
| 228 | 230 | ||
| 229 | /* Any trailing bytes? */ | 231 | /* Any trailing bytes? */ |
| 230 | .L_no_whole_words: | 232 | .L_no_whole_words: |
| @@ -233,13 +235,14 @@ ENTRY(__memcpy_mcsafe) | |||
| 233 | 235 | ||
| 234 | /* Copy trailing bytes */ | 236 | /* Copy trailing bytes */ |
| 235 | movl %edx, %ecx | 237 | movl %edx, %ecx |
| 236 | .L_copy_trailing_bytes: | 238 | .L_read_trailing_bytes: |
| 237 | movb (%rsi), %al | 239 | movb (%rsi), %al |
| 240 | .L_write_trailing_bytes: | ||
| 238 | movb %al, (%rdi) | 241 | movb %al, (%rdi) |
| 239 | incq %rsi | 242 | incq %rsi |
| 240 | incq %rdi | 243 | incq %rdi |
| 241 | decl %ecx | 244 | decl %ecx |
| 242 | jnz .L_copy_trailing_bytes | 245 | jnz .L_read_trailing_bytes |
| 243 | 246 | ||
| 244 | /* Copy successful. Return zero */ | 247 | /* Copy successful. Return zero */ |
| 245 | .L_done_memcpy_trap: | 248 | .L_done_memcpy_trap: |
| @@ -256,7 +259,7 @@ EXPORT_SYMBOL_GPL(__memcpy_mcsafe) | |||
| 256 | 259 | ||
| 257 | .previous | 260 | .previous |
| 258 | 261 | ||
| 259 | _ASM_EXTABLE_FAULT(.L_copy_leading_bytes, .L_memcpy_mcsafe_fail) | 262 | _ASM_EXTABLE_FAULT(.L_read_leading_bytes, .L_memcpy_mcsafe_fail) |
| 260 | _ASM_EXTABLE_FAULT(.L_copy_words, .L_memcpy_mcsafe_fail) | 263 | _ASM_EXTABLE_FAULT(.L_read_words, .L_memcpy_mcsafe_fail) |
| 261 | _ASM_EXTABLE_FAULT(.L_copy_trailing_bytes, .L_memcpy_mcsafe_fail) | 264 | _ASM_EXTABLE_FAULT(.L_read_trailing_bytes, .L_memcpy_mcsafe_fail) |
| 262 | #endif | 265 | #endif |
