Skip to content

Commit 661c801

Browse files
author
H. Peter Anvin
committed
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.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1 parent f4cb1cc commit 661c801

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/lib/copy_user_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ ENTRY(copy_user_generic_unrolled)
186186
30: shll $6,%ecx
187187
addl %ecx,%edx
188188
jmp 60f
189-
40: lea (%rdx,%rcx,8),%rdx
189+
40: leal (%rdx,%rcx,8),%edx
190190
jmp 60f
191191
50: movl %ecx,%edx
192192
60: jmp copy_user_handle_tail /* ecx is zerorest also */
@@ -252,7 +252,7 @@ ENTRY(copy_user_generic_string)
252252
ret
253253

254254
.section .fixup,"ax"
255-
11: lea (%rdx,%rcx,8),%rcx
255+
11: leal (%rdx,%rcx,8),%ecx
256256
12: movl %ecx,%edx /* ecx is zerorest also */
257257
jmp copy_user_handle_tail
258258
.previous

0 commit comments

Comments
 (0)