Skip to content

Commit c92786e

Browse files
zcxGGmuavpatel
authored andcommitted
KVM: riscv: selftests: Use the existing RISCV_FENCE macro in rseq-riscv.h
To avoid redefinition issues with RISCV_FENCE, directly reference the existing macro in `rseq-riscv.h`. Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn> Signed-off-by: Dong Yang <dayss1224@gmail.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Link: https://lore.kernel.org/r/85e5e51757c9289ca463fbc4ba6d22f9c9db791b.1756710918.git.dayss1224@gmail.com Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent b4ab605 commit c92786e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tools/testing/selftests/rseq/rseq-riscv.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* exception when executed in all modes.
99
*/
1010
#include <endian.h>
11+
#include <asm/fence.h>
1112

1213
#if defined(__BYTE_ORDER) ? (__BYTE_ORDER == __LITTLE_ENDIAN) : defined(__LITTLE_ENDIAN)
1314
#define RSEQ_SIG 0xf1401073 /* csrr mhartid, x0 */
@@ -24,8 +25,6 @@
2425
#define REG_L __REG_SEL("ld ", "lw ")
2526
#define REG_S __REG_SEL("sd ", "sw ")
2627

27-
#define RISCV_FENCE(p, s) \
28-
__asm__ __volatile__ ("fence " #p "," #s : : : "memory")
2928
#define rseq_smp_mb() RISCV_FENCE(rw, rw)
3029
#define rseq_smp_rmb() RISCV_FENCE(r, r)
3130
#define rseq_smp_wmb() RISCV_FENCE(w, w)

0 commit comments

Comments
 (0)