Skip to contentSkip to conversation

um/asm: Rename rep_nop() to native_pause()

PATCH New Uros Bizjak 1 participant 2 messages Apr 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 um/asm: Rename rep_nop() to native_pause()

Rename rep_nop() function to what it really does.

No functional change intended.

Cc Richard Weinberger <[email protected]>
Cc Anton Ivanov <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc David Laight <[email protected]>

---
v2: Rename rep_nop() to native_pause() first.

---
 arch/x86/um/asm/processor.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/um/asm/processor.h +2 -2
index 478710384b34..d50549e0089c 100644
@@ -22,7 +22,7 @@
 #include <asm/user.h>
 
 /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
-static __always_inline void rep_nop(void)
+static __always_inline void native_pause(void)
 {
 	__asm__ __volatile__("rep;nop": : :"memory");
 }
@@ -33,7 +33,7 @@ static __always_inline void cpu_relax(void)
 	    time_travel_mode == TT_MODE_EXTERNAL)
 		time_travel_ndelay(1);
 	else
-		rep_nop();
+		native_pause();
 }
 
 #define task_pt_regs(t) (&(t)->thread.regs)
Signature · 1 line
2.49.0
#1 lore raw

PATCH v2 2/2 um/asm: Replace "REP; NOP" with PAUSE mnemonic

Current minimum required version of binutils is 2.25, which supports PAUSE instruction mnemonic.

Replace "REP; NOP" with this proper mnemonic.

No functional change intended.

Cc Richard Weinberger <[email protected]>
Cc Anton Ivanov <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc David Laight <[email protected]>

---
v2: Rename rep_nop() to native_pause() first.

---
 arch/x86/um/asm/processor.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/um/asm/processor.h +2 -2
index d50549e0089c..e222d2ae28fd 100644
@@ -21,10 +21,10 @@
 
 #include <asm/user.h>
 
-/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+/* PAUSE is a good thing to insert into busy-wait loops. */
 static __always_inline void native_pause(void)
 {
-	__asm__ __volatile__("rep;nop": : :"memory");
+	__asm__ __volatile__("pause": : :"memory");
 }
 
 static __always_inline void cpu_relax(void)
Signature · 1 line
2.49.0