Skip to content

Commit 767ec72

Browse files
ubizjaksuryasaimadhu
authored andcommitted
x86/uaccess: Use XORL %0,%0 in __get_user_asm()
XORL %0,%0 is equivalent to XORQ %0,%0 as both will zero the entire register. Use XORL %0,%0 for all operand sizes to avoid REX prefix byte when legacy registers are used and to avoid size prefix byte when 16bit registers are used. Zeroing the full register is OK in this use case. As a result, the size of the .fixup section decreases by 20 bytes. [ bp: Massage commit message. ] Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com> Link: https://lkml.kernel.org/r/20200827180904.96399-1-ubizjak@gmail.com
1 parent f75aef3 commit 767ec72

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ do { \
343343
"2:\n" \
344344
".section .fixup,\"ax\"\n" \
345345
"3: mov %[efault],%[errout]\n" \
346-
" xor"itype" %[output],%[output]\n" \
346+
" xorl %k[output],%k[output]\n" \
347347
" jmp 2b\n" \
348348
".previous\n" \
349349
_ASM_EXTABLE_UA(1b, 3b) \

0 commit comments

Comments
 (0)