x86/entry/64: Use 'xorl' for faster register clearing
authorDominik Brodowski <[email protected]>
Wed, 14 Feb 2018 17:59:24 +0000 (18:59 +0100)
committerIngo Molnar <[email protected]>
Sat, 17 Feb 2018 10:14:33 +0000 (11:14 +0100)
commitced5d0bf603fa0baee8ea889e1d70971fd210894
tree6f9a705b89fc522ed4301049bdc58af4bcb7f21e
parent9e809d15d6b692fa061d74be7aaab1c79f6784b8
x86/entry/64: Use 'xorl' for faster register clearing

On some x86 CPU microarchitectures using 'xorq' to clear general-purpose
registers is slower than 'xorl'. As 'xorl' is sufficient to clear all
64 bits of these registers due to zero-extension [*], switch the x86
64-bit entry code to use 'xorl'.

No change in functionality and no change in code size.

[*] According to Intel 64 and IA-32 Architecture Software Developer's
    Manual, section 3.4.1.1, the result of 32-bit operands are "zero-
    extended to a 64-bit result in the destination general-purpose
    register." The AMD64 Architecture Programmer’s Manual Volume 3,
    Appendix B.1, describes the same behaviour.

Suggested-by: Denys Vlasenko <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ Improved on the changelog a bit. ]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/entry/calling.h
arch/x86/entry/entry_64_compat.S