RISC-V: Add support for Ztso
authorPalmer Dabbelt <palmer@rivosinc.com>
Wed, 7 Feb 2024 12:22:54 +0000 (13:22 +0100)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 8 Mar 2024 09:47:48 +0000 (19:47 +1000)
commit09c4e887595a5df9d80006a3632d43249b986c54
tree7c7fd9e27bf688ced5c38f1319406359ac048ebe
parent4c1608caa4d567de5e73265ac79fdfd517a4189a
RISC-V: Add support for Ztso

The Ztso extension is already ratified, this adds it as a CPU property
and adds various fences throughout the port in order to allow TSO
targets to function on weaker hosts.  We need no fences for AMOs as
they're already SC, the places we need barriers are described.
These fences are placed in the RISC-V backend rather than TCG as is
planned for x86-on-arm64 because RISC-V allows heterogeneous (and
likely soon dynamic) hart memory models.

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Message-ID: <20240207122256.902627-2-christoph.muellner@vrull.eu>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.c
target/riscv/cpu_cfg.h
target/riscv/insn_trans/trans_rva.c.inc
target/riscv/insn_trans/trans_rvi.c.inc
target/riscv/insn_trans/trans_rvv.c.inc
target/riscv/translate.c