Skip to content

Commit d20a5d9

Browse files
ubizjakbp3tk0v
authored andcommitted
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
1 parent 5be5021 commit d20a5d9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/x86/include/asm/mwait.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ static __always_inline void __monitor(const void *eax, u32 ecx, u32 edx)
3636

3737
static __always_inline void __monitorx(const void *eax, u32 ecx, u32 edx)
3838
{
39-
/* "monitorx %eax, %ecx, %edx" */
40-
asm volatile(".byte 0x0f, 0x01, 0xfa"
41-
:: "a" (eax), "c" (ecx), "d"(edx));
39+
asm volatile("monitorx" :: "a" (eax), "c" (ecx), "d"(edx));
4240
}
4341

4442
static __always_inline void __mwait(u32 eax, u32 ecx)
@@ -80,9 +78,7 @@ static __always_inline void __mwaitx(u32 eax, u32 ebx, u32 ecx)
8078
{
8179
/* No need for TSA buffer clearing on AMD */
8280

83-
/* "mwaitx %eax, %ebx, %ecx" */
84-
asm volatile(".byte 0x0f, 0x01, 0xfb"
85-
:: "a" (eax), "b" (ebx), "c" (ecx));
81+
asm volatile("mwaitx" :: "a" (eax), "b" (ebx), "c" (ecx));
8682
}
8783

8884
/*

0 commit comments

Comments
 (0)