target-riscv: Add full-system emulation support for the RISC-V Instruction Set Architecture (RV64G, RV32G)
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest18 patches 26 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | target-riscv: Add RISC-V target stubs and MaintainerMAINTAINERS arch_init.c cpus.c +3 more | +31 | 1 reply | |
| 2/18 | target-riscv: Add RISC-V Target stubs inside target-riscv/target-riscv/ target-riscv/ target-riscv/ +4 more | +886 | 2 replies | |
| 3/18 | target-riscv: Add initialization for translationtarget-riscv/ target-riscv/ target-riscv/ | +273 | 1 reply | |
| 4/18 | target-riscv: Add framework for instruction decodetarget-riscv/ target-riscv/ | +392 | 1 reply | |
| 5/18 | target-riscv: Add Arithmetic instructionstarget-riscv/ target-riscv/ target-riscv/ | +352 | 1 reply | |
| 6/18 | target-riscv: Add JALR, Branch Instructionstarget-riscv/ | +107 | 1 reply | |
| 7/18 | target-riscv: Add Loads/Stores, FP Loads/Storestarget-riscv/ | +117 | 1 reply | |
| 8/18 | target-riscv: Add Atomic Instructionstarget-riscv/ | +154 | 1 reply | |
| 9/18 | target-riscv: Add FMADD, FMSUB, FNMADD, FNMSUB Instructions,fpu/ target-riscv/ target-riscv/ +2 more | +271 | 2 replies | |
| 10/18 | target-riscv: Add Single Precision Floating-Point Instructionstarget-riscv/ target-riscv/ target-riscv/ | +380 | 1 reply | |
| 11/18 | target-riscv: Add Double Precision Floating-Point Instructionstarget-riscv/ target-riscv/ target-riscv/ | +390 | 1 reply | |
| 12/18 | target-riscv: Add system instructionstarget-riscv/ target-riscv/ target-riscv/ | +274 | 5 replies | |
| 13/18 | target-riscv: Add CSR read/write helperstarget-riscv/ | +324 | 0 replies | |
| 14/18 | target-riscv: softmmu/address translation supporttarget-riscv/ target-riscv/ | +238 | 1 reply | |
| 15/18 | target-riscv: Interrupt Handlingtarget-riscv/ | +154 | 1 reply | |
| 16/18 | target-riscv: Timer Supporthw/ hw/ hw/ +3 more | +278 | 0 replies | |
| 17/18 | target-riscv: Add support for Host-Target Interface (HTIF) Deviceshw/ hw/ hw/ +2 more | +852 | 0 replies | |
| 18/18 | target-riscv: Add generic test board, activate targetconfigure default-configs/ default-configs/ +3 more | +415 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH 00/18] target-riscv: Add full-system emulation support for the RISC-V Instruction Set Architecture (RV64G, RV32G)
This patch set adds support for the RISC-V ISA [1] as a system-mode target. It has been tested booting Linux and FreeBSD, passes the RISC-V assembly test suite, and has had the riscv-torture [2] tester running on it for a while now without any issues arising. This patch set supports RV64G and RV32G.
Potentially useful references:
-RISC-V User Spec: See [3]. This spec is frozen.
-RISC-V Privileged Spec: See [4]. This spec is a draft, we implement v1.9. -Spike, the reference simulator for the ISA: See [5].
The comments from an earlier RFC were addressed:
-We use QEMU's built-in softfloat-cpu-qom.h merged into cpu.h
-remove active_tc/riscv-defs.h that were mirrored from MIPS
-Use DEF_HELPER_FLAGS_* where necessary
-DIV/REM now use movcond instead of branches
-handlers for arithmetic instructions and their "W" counterparts were merged to reduce code duplication
-Updated to use tcg_gen_qemu_ld_tl(..., MO_SB) etc.
[1] https://riscv.org
[2] https://github.com/ucb-bar/riscv-torture
[3] https://content.riscv.org/wp-content/uploads/2016/06/riscv-spec-v2.1.pdf
[4] https://content.riscv.org/wp-content/uploads/2016/07/riscv-privileged-v1.9-1.pdf
[5] https://github.com/riscv/riscv-isa-sim
Sagar Karandikar (18):
target-riscv: Add RISC-V target stubs and Maintainer
target-riscv: Add RISC-V Target stubs inside target-riscv/
target-riscv: Add initialization for translation
target-riscv: Add framework for instruction decode
target-riscv: Add Arithmetic instructions
target-riscv: Add JALR, Branch Instructions
target-riscv: Add Loads/Stores, FP Loads/Stores
target-riscv: Add Atomic Instructions
target-riscv: Add FMADD, FMSUB, FNMADD, FNMSUB Instructions,
target-riscv: Add Single Precision Floating-Point Instructions
target-riscv: Add Double Precision Floating-Point Instructions
target-riscv: Add system instructions
target-riscv: Add CSR read/write helpers
target-riscv: softmmu/address translation support
target-riscv: Interrupt Handling
target-riscv: Timer Support
target-riscv: Add support for Host-Target Interface (HTIF) Devices
target-riscv: Add generic test board, activate target
MAINTAINERS | 7 + arch_init.c | 2 + configure | 6 + cpus.c | 6 + default-configs/riscv32-softmmu.mak | 38 + default-configs/riscv64-softmmu.mak | 38 + fpu/softfloat-specialize.h | 7 +- hw/riscv/Makefile.objs | 5 + hw/riscv/cpudevs.h | 17 + hw/riscv/htif/elf_symb.c | 286 ++++++ hw/riscv/htif/elf_symb.h | 80 ++ hw/riscv/htif/htif.c | 423 +++++++++ hw/riscv/riscv_board.c | 264 ++++++ hw/riscv/riscv_int.c | 67 ++ hw/riscv/riscv_rtc.c | 230 +++++ include/elf.h | 2 + include/hw/riscv/htif/htif.h | 61 ++ include/hw/riscv/riscv_rtc.h | 25 + include/hw/riscv/riscv_rtc_internal.h | 3 + include/sysemu/arch_init.h | 1 + qapi-schema.json | 14 +- target-riscv/Makefile.objs | 1 + target-riscv/cpu.c | 154 +++ target-riscv/cpu.h | 497 ++++++++++ target-riscv/fpu_helper.c | 582 ++++++++++++ target-riscv/helper.c | 420 +++++++++ target-riscv/helper.h | 87 ++ target-riscv/instmap.h | 328 +++++++ target-riscv/op_helper.c | 577 ++++++++++++ target-riscv/translate.c | 1658 +++++++++++++++++++++++++++++++++ 30 files changed, 5882 insertions(+), 4 deletions(-) create mode 100644 default-configs/riscv32-softmmu.mak create mode 100644 default-configs/riscv64-softmmu.mak create mode 100644 hw/riscv/Makefile.objs create mode 100644 hw/riscv/cpudevs.h create mode 100644 hw/riscv/htif/elf_symb.c create mode 100644 hw/riscv/htif/elf_symb.h create mode 100644 hw/riscv/htif/htif.c create mode 100644 hw/riscv/riscv_board.c create mode 100644 hw/riscv/riscv_int.c create mode 100644 hw/riscv/riscv_rtc.c create mode 100644 include/hw/riscv/htif/htif.h create mode 100644 include/hw/riscv/riscv_rtc.h create mode 100644 include/hw/riscv/riscv_rtc_internal.h create mode 100644 target-riscv/Makefile.objs create mode 100644 target-riscv/cpu.c create mode 100644 target-riscv/cpu.h create mode 100644 target-riscv/fpu_helper.c create mode 100644 target-riscv/helper.c create mode 100644 target-riscv/helper.h create mode 100644 target-riscv/instmap.h create mode 100644 target-riscv/op_helper.c create mode 100644 target-riscv/translate.c
Signature · 1 line
2.9.3