Skip to content

RISC-V Smstateen support

Mayuresh Chitale qemu-devel qemu-riscv 21 versions – Applied

Status from this message: Applied to riscv-to-apply.next

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 posting 2/21 patch 7 repliesIn review
  2. v7 posting 2/21 patch 1 replySuperseded
  3. v6 posting 2/21 patch 2 repliesSuperseded
Earlier versions · 18
VersionPostedPatchesRepliesStatus
v5 posting 2/21 patch2 repliesSuperseded
v4 posting 2/21 patch4 repliesSuperseded
v11 Latest5 patches8 repliesApplied
v105 patches6 repliesSuperseded
v94 patches6 repliesSuperseded
v3 RFC posting 3/32 patches0 repliesSuperseded
v8 posting 1/24 patches0 repliesSuperseded
v7 posting 1/24 patches6 repliesSuperseded
v6 posting 1/25 patches16 repliesSuperseded
v5 RFC posting 1/24 patches17 repliesSuperseded
v4 RFC posting 1/24 patches1 replySuperseded
v2 RFC posting 4/42 patches5 repliesSuperseded
v3 posting 2/33 patches0 repliesSuperseded
v2 posting 3/40 of 3 patches0 repliesSuperseded
v2 posting 2/43 patches0 repliesSuperseded
v3 RFC posting 1/34 patches1 replySuperseded
v2 RFC posting 1/44 patches6 repliesSuperseded
v1 RFC4 patches0 repliesSuperseded

Changes in v11 from the cover letter

- Rebase to latest riscv-to-apply.next
- set virt_inst_excp at the begining of decode_opc
- Add reviewed by in patch 4

Patches in v11 Applied

#Subject and filesSizeRepliesApplied
1/5target/riscv: Add smstateen supporttarget/riscv/cpu.h target/riscv/cpu_bits.h target/riscv/csr.c +1 more+378 -01 reply
2/5target/riscv: smstateen check for h/s/envcfgtarget/riscv/csr.c+80 -70 replies
3/5target/riscv: generate virtual instruction exceptiontarget/riscv/translate.c+7 -12 replies
4/5target/riscv: smstateen check for fcsrtarget/riscv/csr.c target/riscv/insn_trans/trans_rvf.c.inc target/riscv/insn_trans/trans_rvzfh.c.inc+75 -34 replies
5/5target/riscv: smstateen knobstarget/riscv/cpu.c+2 -00 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchWeiwei LiAlistair Francis
1/5R-b R-b
2/5R-b R-b
3/5R-b R-b
4/5R-b R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v11 thread

Cover letter [PATCH v11 0/5] RISC-V Smstateen support

This series adds support for the Smstateen specification which provides a mechanism to plug the potential covert channels which are opened by extensions that add to processor state that may not get context-switched. Currently access to *envcfg registers and floating point(fcsr) is controlled via smstateen.

These patches can also be found on riscv_smstateen_v11 branch at:
https://github.com/mdchitale/qemu.git

Changes in v11:
- Rebase to latest riscv-to-apply.next
- set virt_inst_excp at the begining of decode_opc
- Add reviewed by in patch 4

Changes in v10:
- Add support to generate virt instruction exception after decode failure. Use this change for smstateen fcsr failure when virt is enabled.
- Implement single write function for *smstateen1 to *smstateen3 registers.

Changes in v9:
- Rebase to latest riscv-to-apply.next
- Add reviewed by in patches 2 and 4

Changes in v8:
- Rebase to latest riscv-to-apply.next
- Fix m-mode check for hstateen
- Fix return exception type for VU mode
- Improve commit description for patch3

Changes in v7:
- Update smstateen check as per discussion on the following issue:
https://github.com/riscv/riscv-state-enable/issues/9
- Drop the smstateen AIA patch for now.
- Indentation and other fixes

Changes in v6:
- Sync with latest riscv-to-apply.next
- Make separate read/write ops for m/h/s/stateen1/2/3 regs
- Add check for mstateen.staten when reading or using h/s/stateen regs
- Add smstateen fcsr check for all floating point operations
- Move knobs to enable smstateen in a separate patch.

Changes in v5:
- Fix the order in which smstateen extension is added to the isa_edata_arr as
described in rule #3 the comment.

Changes in v4:
- Fix build issue with riscv32/riscv64-linux-user targets

Changes in v3:
- Fix coding style issues
- Fix *stateen0h index calculation

Changes in v2:
- Make h/s/envcfg bits in m/h/stateen registers as writeable by default.

Mayuresh Chitale (5):
target/riscv: Add smstateen support target/riscv: smstateen check for h/s/envcfg target/riscv: generate virtual instruction exception target/riscv: smstateen check for fcsr target/riscv: smstateen knobs

 target/riscv/cpu.c                        |   2 +
 target/riscv/cpu.h                        |   4 +
 target/riscv/cpu_bits.h                   |  37 ++
 target/riscv/csr.c                        | 414 +++++++++++++++++++++-
 target/riscv/insn_trans/trans_rvf.c.inc   |  43 ++-
 target/riscv/insn_trans/trans_rvzfh.c.inc |  12 +
 target/riscv/machine.c                    |  21 ++
 target/riscv/translate.c                  |   8 +-
 8 files changed, 536 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1