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 <ubizjak@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250616083056.157460-1-ubizjak@gmail.com
pull/1354/merge
Uros Bizjak 2025-06-16 10:30:41 +02:00 committed by Borislav Petkov (AMD)
parent 5be502174b
commit d20a5d96ed
1 changed files with 2 additions and 6 deletions

View File

@ -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) static __always_inline void __monitorx(const void *eax, u32 ecx, u32 edx)
{ {
/* "monitorx %eax, %ecx, %edx" */ asm volatile("monitorx" :: "a" (eax), "c" (ecx), "d"(edx));
asm volatile(".byte 0x0f, 0x01, 0xfa"
:: "a" (eax), "c" (ecx), "d"(edx));
} }
static __always_inline void __mwait(u32 eax, u32 ecx) 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 */ /* No need for TSA buffer clearing on AMD */
/* "mwaitx %eax, %ebx, %ecx" */ asm volatile("mwaitx" :: "a" (eax), "b" (ebx), "c" (ecx));
asm volatile(".byte 0x0f, 0x01, 0xfb"
:: "a" (eax), "b" (ebx), "c" (ecx));
} }
/* /*