Skip to content

Commit

Permalink
stress-nop: fix 14 and 15 byte no-ops for x86
Browse files Browse the repository at this point in the history
Somehow the 13 byte versions were being used, fix this with extra
prefixes.

Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Dec 18, 2024
1 parent 127a1b7 commit 62b7a20
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions stress-nop.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ STRESS_NOP_SPIN_OP(x86_pause, stress_asm_x86_pause)

#if defined(HAVE_ASM_X86_TPAUSE) && \
!defined(HAVE_COMPILER_PCC)
static inline void stress_op_x86_tpause(void)
static inline ALWAYS_INLINE void stress_op_x86_tpause(void)
{
uint64_t tsc;

Expand All @@ -111,74 +111,74 @@ STRESS_NOP_SPIN_OP(arm_yield, stress_asm_arm_yield);
#endif

#if defined(STRESS_ARCH_X86)
static inline void stress_op_x86_nop2(void)
static inline ALWAYS_INLINE void stress_op_x86_nop2(void)
{
__asm__ __volatile__(".byte 0x66, 0x90;\n");
}

static inline void stress_op_x86_nop3(void)
static inline ALWAYS_INLINE void stress_op_x86_nop3(void)
{
__asm__ __volatile__(".byte 0x0f, 0x1f, 0x00;\n");
}

static inline void stress_op_x86_nop4(void)
static inline ALWAYS_INLINE void stress_op_x86_nop4(void)
{
__asm__ __volatile__(".byte 0x0f, 0x1f, 0x40, 0x00;\n");
}

static inline void stress_op_x86_nop5(void)
static inline ALWAYS_INLINE void stress_op_x86_nop5(void)
{
__asm__ __volatile__(".byte 0x0f, 0x1f, 0x44, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop6(void)
static inline ALWAYS_INLINE void stress_op_x86_nop6(void)
{
__asm__ __volatile__(".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop7(void)
static inline ALWAYS_INLINE void stress_op_x86_nop7(void)
{
__asm__ __volatile__(".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop8(void)
static inline ALWAYS_INLINE void stress_op_x86_nop8(void)
{
__asm__ __volatile__(".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop9(void)
static inline ALWAYS_INLINE void stress_op_x86_nop9(void)
{
__asm__ __volatile__(".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop10(void)
static inline ALWAYS_INLINE void stress_op_x86_nop10(void)
{
__asm__ __volatile__(".byte 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop11(void)
static inline ALWAYS_INLINE void stress_op_x86_nop11(void)
{
__asm__ __volatile__(".byte 0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop12(void)
static inline ALWAYS_INLINE void stress_op_x86_nop12(void)
{
__asm__ __volatile__(".byte 0x66, 0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop13(void)
static inline ALWAYS_INLINE void stress_op_x86_nop13(void)
{
__asm__ __volatile__(".byte 0x66, 0x66, 0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop14(void)
static inline ALWAYS_INLINE void stress_op_x86_nop14(void)
{
__asm__ __volatile__(".byte 0x66, 0x66, 0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
__asm__ __volatile__(".byte 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

static inline void stress_op_x86_nop15(void)
static inline ALWAYS_INLINE void stress_op_x86_nop15(void)
{
__asm__ __volatile__(".byte 0x66, 0x66, 0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
__asm__ __volatile__(".byte 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00;\n");
}

STRESS_NOP_SPIN_OP(x86_nop2, stress_op_x86_nop2)
Expand Down

0 comments on commit 62b7a20

Please sign in to comment.