diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2020-08-27 20:09:04 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-09-03 22:49:03 +0200 |
commit | 767ec7289e83721fee205a13b459f12fb2cf922f (patch) | |
tree | 50b0f7faf3f76692834c001e0f84037b6cba8be8 /arch/x86/include/asm/uaccess.h | |
parent | f75aef392f869018f78cfedf3c320a6b3fcfda6b (diff) | |
download | linux-767ec7289e83721fee205a13b459f12fb2cf922f.tar.bz2 |
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
Diffstat (limited to 'arch/x86/include/asm/uaccess.h')
-rw-r--r-- | arch/x86/include/asm/uaccess.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index ecefaffd15d4..2bffba2a1b23 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -343,7 +343,7 @@ do { \ "2:\n" \ ".section .fixup,\"ax\"\n" \ "3: mov %[efault],%[errout]\n" \ - " xor"itype" %[output],%[output]\n" \ + " xorl %k[output],%k[output]\n" \ " jmp 2b\n" \ ".previous\n" \ _ASM_EXTABLE_UA(1b, 3b) \ |