summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorQuan Zhou <zhouquan@iscas.ac.cn>2025-09-01 15:35:49 +0800
committerAnup Patel <anup@brainfault.org>2025-09-16 10:53:52 +0530
commitc92786e179e0def2cf9a8003e7be0fcba73afb15 (patch)
tree61479939866c9a665d2e7d9fbb7d519cdaae5f43 /tools
parentb4ab605e2ff5ffdcbf26ccdd9dec938dc38c6970 (diff)
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/rseq/rseq-riscv.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/rseq/rseq-riscv.h b/tools/testing/selftests/rseq/rseq-riscv.h
index 67d544aaa9a3..06c840e81c8b 100644
--- a/tools/testing/selftests/rseq/rseq-riscv.h
+++ b/tools/testing/selftests/rseq/rseq-riscv.h
@@ -8,6 +8,7 @@
* exception when executed in all modes.
*/
#include <endian.h>
+#include <asm/fence.h>
#if defined(__BYTE_ORDER) ? (__BYTE_ORDER == __LITTLE_ENDIAN) : defined(__LITTLE_ENDIAN)
#define RSEQ_SIG 0xf1401073 /* csrr mhartid, x0 */
@@ -24,8 +25,6 @@
#define REG_L __REG_SEL("ld ", "lw ")
#define REG_S __REG_SEL("sd ", "sw ")
-#define RISCV_FENCE(p, s) \
- __asm__ __volatile__ ("fence " #p "," #s : : : "memory")
#define rseq_smp_mb() RISCV_FENCE(rw, rw)
#define rseq_smp_rmb() RISCV_FENCE(r, r)
#define rseq_smp_wmb() RISCV_FENCE(w, w)