[PATCH v2 4/7] include: sbi: Ignore rs1 and rd fields in FENCE.TSO.

Anup Patel anup at brainfault.org
Mon Dec 15 07:48:44 PST 2025


On Sat, Nov 15, 2025 at 2:09 AM Benedikt Freisen <b.freisen at gmx.net> wrote:
>
> 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 <b.freisen at gmx.net>

LGTM.

Reviewed-by: Anup Patel <anup at brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  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 92cbc27..2970ba0 100644
> --- a/include/sbi/riscv_encoding.h
> +++ b/include/sbi/riscv_encoding.h
> @@ -944,7 +944,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
> --
> 2.51.1
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list