x86/idle: undo use of MONITOR/MWAIT mnemonics
PATCH 1/1 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 <[email protected]>
xen/arch/x86/acpi/cpu_idle.c +3 -3
@@ -70,20 +70,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. */ - asmvolatile ("monitor" + asmvolatile (".byte 0x0f, 0x01, 0xc8" /* monitor */ ::"a" (addr),"c" (ecx),"d" (edx) :"memory" ); } static always_inline void mwait(unsigned int eax, unsigned int ecx) { - asmvolatile ("mwait" + asmvolatile (".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. */ - asmvolatile ("sti; mwait; cli" + asmvolatile ("sti; .byte 0x0f, 0x01, 0xc9;" /* mwait */ " cli" ::"a" (eax),"c" (ecx) ); }
Ack. Sorry for forgetting this
Quoted 37 lines · On Wed, 9 Jul 2025, 10:44 Jan Beulich, <[email protected]> wrote:
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 <[email protected]>xen/arch/x86/acpi/cpu_idle.c +0
-0@@ -70,20 +70,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. */xen/arch/x86/acpi/cpu_idle.c +2
-2- asmvolatile ("monitor" + asmvolatile (".byte 0x0f, 0x01, 0xc8" /* monitor */ ::"a" (addr),"c" (ecx),"d" (edx) :"memory" ); } static always_inline void mwait(unsigned int eax, unsigned int ecx) { - asmvolatile ("mwait" + asmvolatile (".byte 0x0f, 0x01, 0xc9" /* mwait */ ::"a" (eax),"c" (ecx) ); } static always_inline void sti_mwait_cli(unsigned int eax, unsigned intecx)
{ /* STI shadow covers MWAIT. */xen/arch/x86/acpi/cpu_idle.c +1
-1- asmvolatile ("sti; mwait; cli" + asmvolatile ("sti; .byte 0x0f, 0x01, 0xc9;" /* mwait */ " cli" ::"a" (eax),"c" (ecx) ); }