x86/idle: Use MONITORX and MWAITX mnemonics in <asm/mwait.h>
PATCH 1/1 x86/idle: Use MONITORX and MWAITX mnemonics in <asm/mwait.h>
Current minimum required version of binutils is 2.30, which supports MONITORX and MWAITX instruction mnemonics.
Replace the byte-wise specification of MONITORX and MWAITX with these proper mnemonics.
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/include/asm/mwait.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
arch/x86/include/asm/mwait.h +2 -6
@@ -36,9 +36,7 @@ static __always_inline void __monitor(const void *eax, u32 ecx, u32 edx) static __always_inline void __monitorx(const void *eax, u32 ecx, u32 edx) { -/* "monitorx %eax, %ecx, %edx" */ - asmvolatile (".byte 0x0f, 0x01, 0xfa" - ::"a" (eax),"c" (ecx),"d" (edx)); + asmvolatile ("monitorx" ::"a" (eax),"c" (ecx),"d" (edx)); } static __always_inline void __mwait(u32 eax, u32 ecx)
@@ -82,9 +80,7 @@ static __always_inline void __mwaitx(u32 eax, u32 ebx, u32 ecx) {/* No MDS buffer clear as this is AMD/HYGON only */ -/* "mwaitx %eax, %ebx, %ecx" */ - asmvolatile (".byte 0x0f, 0x01, 0xfb" - ::"a" (eax),"b" (ebx),"c" (ecx)); + asmvolatile ("mwaitx" ::"a" (eax),"b" (ebx),"c" (ecx)); }/*
Signature · 1 line
2.49.0
The following commit has been merged into the x86/cleanups branch of tip:
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: d20a5d96eddb95b4faa33247ec653a580c48fdfa Gitweb: https://git.kernel.org/tip/d20a5d96eddb95b4faa33247ec653a580c48fdfa Author: Uros Bizjak <[email protected]> AuthorDate: Mon, 16 Jun 2025 10:30:41 +02:00 Committer: Borislav Petkov (AMD) <[email protected]> CommitterDate: Fri, 22 Aug 2025 13:52:21 +02:00
x86/idle: Use MONITORX and MWAITX mnemonics in <asm/mwait.h>
Current minimum required version of binutils is 2.30, which supports MONITORX and MWAITX instruction mnemonics.
Replace the byte-wise specification of MONITORX and MWAITX with these proper mnemonics.
No functional change intended.
Signed-off-by Uros Bizjak <[email protected]>
Signed-off-by Borislav Petkov (AMD) <[email protected]>
--- arch/x86/include/asm/mwait.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
arch/x86/include/asm/mwait.h +2 -6
@@ -36,9 +36,7 @@ static __always_inline void __monitor(const void *eax, u32 ecx, u32 edx) static __always_inline void __monitorx(const void *eax, u32 ecx, u32 edx) { -/* "monitorx %eax, %ecx, %edx" */ - asmvolatile (".byte 0x0f, 0x01, 0xfa" - ::"a" (eax),"c" (ecx),"d" (edx)); + asmvolatile ("monitorx" ::"a" (eax),"c" (ecx),"d" (edx)); } static __always_inline void __mwait(u32 eax, u32 ecx)
@@ -80,9 +78,7 @@ static __always_inline void __mwaitx(u32 eax, u32 ebx, u32 ecx) {/* No need for TSA buffer clearing on AMD */ -/* "mwaitx %eax, %ebx, %ecx" */ - asmvolatile (".byte 0x0f, 0x01, 0xfb" - ::"a" (eax),"b" (ebx),"c" (ecx)); + asmvolatile ("mwaitx" ::"a" (eax),"b" (ebx),"c" (ecx)); }/*