From afc24152bb55927297716c72ef37f9d529893c55 Mon Sep 17 00:00:00 2001 From: Benedikt Freisen Date: Fri, 14 Nov 2025 21:38:39 +0100 Subject: [PATCH] include: sbi: Ignore rs1 and rd fields in FENCE.TSO. While FENCE.TSO is only specified with them set to zero, it is a special case of FENCE, which needs to ignore these otherwise reserved fields, but in some implementations, namely XuanTie C906 and C910, apparently does not. See the RISCVuzz paper by Thomas et al. for details. Signed-off-by: Benedikt Freisen Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20251114203842.13396-5-b.freisen@gmx.net Signed-off-by: Anup Patel --- include/sbi/riscv_encoding.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sbi/riscv_encoding.h b/include/sbi/riscv_encoding.h index be2e8557..b5a4ce81 100644 --- a/include/sbi/riscv_encoding.h +++ b/include/sbi/riscv_encoding.h @@ -949,7 +949,7 @@ #define INSN_MASK_WFI 0xffffff00 #define INSN_MATCH_WFI 0x10500000 -#define INSN_MASK_FENCE_TSO 0xffffffff +#define INSN_MASK_FENCE_TSO 0xfff0707f #define INSN_MATCH_FENCE_TSO 0x8330000f #define INSN_MASK_VECTOR_UNIT_STRIDE 0xfdf0707f