mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Uros Bizjak" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Uros Bizjak <ubizjak@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	Brian Gerst <brgerst@gmail.com>, Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Rik van Riel <riel@surriel.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/mm] x86/idle: Use MONITOR and MWAIT mnemonics in <asm/mwait.h>
Date: Wed, 02 Apr 2025 20:43:52 -0000	[thread overview]
Message-ID: <174362663244.14745.8528127585586564065.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250402180827.3762-2-ubizjak@gmail.com>

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@gmail.com>
AuthorDate:    Wed, 02 Apr 2025 20:08:06 +02:00
Committer:     Ingo Molnar <mingo@kernel.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@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Linus Torvalds <torvalds@linux-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));
 }
 
 /*

  reply	other threads:[~2025-04-02 20:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 18:08 [PATCH -tip 1/4] x86/idle: Fix argument type for MONITOR{,X} and MWAIT{,X} instructions Uros Bizjak
2025-04-02 18:08 ` [PATCH -tip 2/4] x86/idle: Use MONITOR and MWAIT mnemonics in <asm/mwait.h> Uros Bizjak
2025-04-02 20:43   ` tip-bot2 for Uros Bizjak [this message]
2025-04-03 15:28   ` Andy Shevchenko
2025-04-03 15:30     ` Andy Shevchenko
2025-04-03 15:33       ` Ingo Molnar
2025-04-03 15:41         ` Andy Shevchenko
2025-04-02 18:08 ` [PATCH -tip 3/4] x86/idle: Remove unneeded delimiters from asm templates Uros Bizjak
2025-04-02 20:43   ` [tip: x86/mm] x86/idle: Remove .s output beautifying delimiters from simpler asm() templates tip-bot2 for Uros Bizjak
2025-04-03 11:27   ` tip-bot2 for Uros Bizjak
2025-04-02 18:08 ` [PATCH -tip 4/4] x86/idle: Remove CONFIG_AS_TPAUSE Uros Bizjak
2025-04-02 20:43   ` [tip: x86/mm] " tip-bot2 for Uros Bizjak
2025-04-02 20:55   ` tip-bot2 for Uros Bizjak
2025-04-03 11:27   ` tip-bot2 for Uros Bizjak
2025-04-02 20:43 ` [tip: x86/mm] x86/idle: Standardize argument types for MONITOR{,X} and MWAIT{,X} instruction wrappers on 'u32' tip-bot2 for Uros Bizjak
2025-04-02 23:26   ` Andrew Cooper
2025-04-02 20:48 ` [PATCH -tip 1/4] x86/idle: Fix argument type for MONITOR{,X} and MWAIT{,X} instructions Ingo Molnar
2025-04-02 21:18   ` Uros Bizjak
2025-04-03 12:50 [PATCH -tip v3] x86/idle: Use MONITOR and MWAIT mnemonics in <asm/mwait.h> Uros Bizjak
2025-04-03 13:56 ` [tip: x86/mm] " tip-bot2 for Uros Bizjak
2025-04-03 14:37 ` tip-bot2 for Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=174362663244.14745.8528127585586564065.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=andrew.cooper3@citrix.com \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=riel@surriel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®