Commit 661c8019 authored by H. Peter Anvin's avatar H. Peter Anvin

x86-64, copy_user: Use leal to produce 32-bit results

When we are using lea to produce a 32-bit result, we can use the leal
form, rather than using leaq and worry about truncation elsewhere.

Make the leal explicit, both to be more obvious and since that is what
gcc generates and thus is less likely to trigger obscure gas bugs.

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1384634221-6006-1-git-send-email-fenghua.yu@intel.comSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent f4cb1cc1
...@@ -186,7 +186,7 @@ ENTRY(copy_user_generic_unrolled) ...@@ -186,7 +186,7 @@ ENTRY(copy_user_generic_unrolled)
30: shll $6,%ecx 30: shll $6,%ecx
addl %ecx,%edx addl %ecx,%edx
jmp 60f jmp 60f
40: lea (%rdx,%rcx,8),%rdx 40: leal (%rdx,%rcx,8),%edx
jmp 60f jmp 60f
50: movl %ecx,%edx 50: movl %ecx,%edx
60: jmp copy_user_handle_tail /* ecx is zerorest also */ 60: jmp copy_user_handle_tail /* ecx is zerorest also */
...@@ -252,7 +252,7 @@ ENTRY(copy_user_generic_string) ...@@ -252,7 +252,7 @@ ENTRY(copy_user_generic_string)
ret ret
.section .fixup,"ax" .section .fixup,"ax"
11: lea (%rdx,%rcx,8),%rcx 11: leal (%rdx,%rcx,8),%ecx
12: movl %ecx,%edx /* ecx is zerorest also */ 12: movl %ecx,%edx /* ecx is zerorest also */
jmp copy_user_handle_tail jmp copy_user_handle_tail
.previous .previous
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment