[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.17] x86/idle: undo use of MONITOR/MWAIT mnemonics



commit 5da8dd30b7829bab8d41639c4e893a6fe1f555d6
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Jul 9 12:21:28 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 9 12:21:28 2025 +0200

    x86/idle: undo use of MONITOR/MWAIT mnemonics
    
    While the change is fine on staging, where the toolchain baseline was
    moved, we need to remain compatible with older gas on stable branches
    for now.
    
    Fixes: fa254938f00a ("x86/idle: Move monitor()/mwait() wrappers into 
cpu-idle.c")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/acpi/cpu_idle.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 3ba1bd500d..2d2b2ee244 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -69,20 +69,20 @@ static always_inline void monitor(
      * The memory clobber is a compiler barrier.  Subseqeunt reads from the
      * monitored cacheline must not be reordered over MONITOR.
      */
-    asm volatile ( "monitor"
+    asm volatile ( ".byte 0x0f, 0x01, 0xc8" /* monitor */
                    :: "a" (addr), "c" (ecx), "d" (edx) : "memory" );
 }
 
 static always_inline void mwait(unsigned int eax, unsigned int ecx)
 {
-    asm volatile ( "mwait"
+    asm volatile ( ".byte 0x0f, 0x01, 0xc9" /* mwait */
                    :: "a" (eax), "c" (ecx) );
 }
 
 static always_inline void sti_mwait_cli(unsigned int eax, unsigned int ecx)
 {
     /* STI shadow covers MWAIT. */
-    asm volatile ( "sti; mwait; cli"
+    asm volatile ( "sti; .byte 0x0f, 0x01, 0xc9;" /* mwait */ " cli"
                    :: "a" (eax), "c" (ecx) );
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.