[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174362663244.14745.8528127585586564065.tip-bot2@tip-bot2>
Date: Wed, 02 Apr 2025 20:43:52 -0000
From: "tip-bot2 for Uros Bizjak" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Uros Bizjak <ubizjak@...il.com>, Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...nel.org>, Brian Gerst <brgerst@...il.com>,
Juergen Gross <jgross@...e.com>, Andrew Cooper <andrew.cooper3@...rix.com>,
Rik van Riel <riel@...riel.com>, "H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject:
[tip: x86/mm] x86/idle: Use MONITOR and MWAIT mnemonics in <asm/mwait.h>
The following commit has been merged into the x86/mm branch of tip:
Commit-ID: cd3b85b27542968198e3d588a2bc0591930ee2ee
Gitweb: https://git.kernel.org/tip/cd3b85b27542968198e3d588a2bc0591930ee2ee
Author: Uros Bizjak <ubizjak@...il.com>
AuthorDate: Wed, 02 Apr 2025 20:08:06 +02:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Wed, 02 Apr 2025 22:26:17 +02:00
x86/idle: Use MONITOR and MWAIT mnemonics in <asm/mwait.h>
Current minimum required version of binutils is 2.25,
which supports MONITOR and MWAIT instruction mnemonics.
Replace the byte-wise specification of MONITOR and
MWAIT with these proper mnemonics.
No functional change intended.
Signed-off-by: Uros Bizjak <ubizjak@...il.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Juergen Gross <jgross@...e.com>
Cc: Andrew Cooper <andrew.cooper3@...rix.com>
Cc: Rik van Riel <riel@...riel.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Link: https://lore.kernel.org/r/20250402180827.3762-2-ubizjak@gmail.com
---
arch/x86/include/asm/mwait.h | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index 3377869..006b150 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -27,9 +27,7 @@
static __always_inline void __monitor(const void *eax, u32 ecx, u32 edx)
{
- /* "monitor %eax, %ecx, %edx;" */
- asm volatile(".byte 0x0f, 0x01, 0xc8;"
- :: "a" (eax), "c" (ecx), "d"(edx));
+ asm volatile("monitor %0, %1, %2" :: "a" (eax), "c" (ecx), "d" (edx));
}
static __always_inline void __monitorx(const void *eax, u32 ecx, u32 edx)
@@ -43,9 +41,7 @@ static __always_inline void __mwait(u32 eax, u32 ecx)
{
mds_idle_clear_cpu_buffers();
- /* "mwait %eax, %ecx;" */
- asm volatile(".byte 0x0f, 0x01, 0xc9;"
- :: "a" (eax), "c" (ecx));
+ asm volatile("mwait %0, %1" :: "a" (eax), "c" (ecx));
}
/*
@@ -95,9 +91,8 @@ static __always_inline void __mwaitx(u32 eax, u32 ebx, u32 ecx)
static __always_inline void __sti_mwait(u32 eax, u32 ecx)
{
mds_idle_clear_cpu_buffers();
- /* "mwait %eax, %ecx;" */
- asm volatile("sti; .byte 0x0f, 0x01, 0xc9;"
- :: "a" (eax), "c" (ecx));
+
+ asm volatile("sti; mwait %0, %1" :: "a" (eax), "c" (ecx));
}
/*
Powered by blists - more mailing lists