x86/asm: Replace "REP; NOP" with PAUSE mnemonic
PATCH 1/1 x86/asm: Replace "REP; NOP" with PAUSE mnemonic
Current minimum required version of binutils is 2.25, which supports PAUSE instruction mnemonic.
Replace "REP; NOP" with this proper mnemonic.
No functional change intended.
Signed-off-by Uros Bizjak <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
--- arch/x86/boot/boot.h | 2 +- arch/x86/include/asm/vdso/processor.h | 2 +- arch/x86/kernel/relocate_kernel_64.S | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/boot/boot.h +1 -1
@@ -34,7 +34,7 @@extern struct setup_header hdr;extern struct boot_params boot_params; -#define cpu_relax () asm volatile("rep; nop") +#define cpu_relax () asm volatile("pause")static inline void io_delay (void ) {
arch/x86/include/asm/vdso/processor.h +1 -1
@@ -10,7 +10,7 @@/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ static __always_inline void rep_nop(void) { - asmvolatile ("rep; nop" :::"memory" ); + asmvolatile ("pause" :::"memory" ); } static __always_inline void cpu_relax(void)
arch/x86/kernel/relocate_kernel_64.S +2 -2
@@ -405,7 +405,7 @@ SYM_CODE_START_LOCAL_NOALIGN(pr_char_8250) inb %dx, %al testb $XMTRDY, %al jnz .Lready - rep nop + pause jmp .Lxmtrdy_loop .Lready:
@@ -426,7 +426,7 @@ SYM_CODE_START_LOCAL_NOALIGN(pr_char_8250_mmio32) movb (LSR*4)(%rdx), %ah testb $XMTRDY, %ah jnz .Lready_mmio - rep nop + pause jmp .Lxmtrdy_loop_mmio .Lready_mmio:
Signature · 1 line
2.42.0
Quoted 5 lines · Uros Bizjak
Current minimum required version of binutils is 2.25, which supports PAUSE instruction mnemonic.
Replace "REP; NOP" with this proper mnemonic.
Quoted 8 lines
No functional change intended.
Signed-off-by Uros Bizjak <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc Borislav Petkov <[email protected]>Cc Dave Hansen <[email protected]>Cc "H. Peter Anvin" <[email protected]>
Reviewed-by Nikolay Borisov <[email protected]>