x86: Drop rep_nop() and use the PAUSE mnemonic directly
PATCH 1/1 x86: Drop rep_nop() and use the PAUSE mnemonic directly
In udelay(), use cpu_relax() directly which, for better or worse, is the common way to refer to the PAUSE instruction.
No functional change.
Signed-off-by Andrew Cooper <[email protected]>
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
--- xen/arch/x86/delay.c | 2 +- xen/arch/x86/include/asm/processor.h | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-)
xen/arch/x86/delay.c +1 -1
@@ -23,7 +23,7 @@ void udelay(unsigned long usecs) s =rdtsc_ordered ();do { -rep_nop (); +cpu_relax (); e =rdtsc_ordered (); }while ((e-s) < ticks); }
xen/arch/x86/include/asm/processor.h +2 -7
@@ -340,13 +340,8 @@ DECLARE_PER_CPU(root_pgentry_t *, root_pgt);extern void write_ptbase (struct vcpu *v); -/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ -static always_inline void rep_nop(void) -{ - asmvolatile ("rep;nop" : : :"memory" ); -} - -#define cpu_relax () rep_nop() +/* PAUSE (encoding: REP NOP) is a good thing to insert into busy-wait loops. */ +#define cpu_relax () asm volatile ( "pause" ::: "memory" )void show_code (const struct cpu_user_regs *regs);void show_stack_overflow (unsigned int cpu,const struct cpu_user_regs *regs);
Signature · 1 line
2.39.5
Quoted 6 lines · Andrew Cooper
In
udelay(), usecpu_relax()directly which, for better or worse, is the common way to refer to the PAUSE instruction.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
Reviewed-by Jan Beulich <[email protected]>