This is one of the big patches that the RISC-V fork has that we don't. After this it should be straight forward to upstream the remaining patches.
Michael Clark (3): RISC-V: Implement modular CSR helper interface RISC-V: Implement atomic mip/sip CSR updates RISC-V: Implement existential predicates for CSRs target/riscv/Makefile.objs | 2 +- target/riscv/cpu.c | 6 + target/riscv/cpu.h | 41 +- target/riscv/cpu_helper.c | 7 +- target/riscv/csr.c | 863 +++++++++++++++++++++++++++++++++++++ target/riscv/gdbstub.c | 10 +- target/riscv/op_helper.c | 613 +------------------------- 7 files changed, 933 insertions(+), 609 deletions(-) create mode 100644 target/riscv/csr.c -- 2.19.1