Skip to content

target/riscv: Various fixes to gdbstub and CSR access

Bin Meng qemu-devel qemu-riscv 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 of 18 patches 10 repliesIn review
  2. v117 of 18 patches 32 repliesSuperseded

Changes in v2 from the cover letter

- keep the original priority policy, instead add some comments for clarification
- new patch: Use assert() for the predicate() NULL check
- keep the 'RV128 restriction check' todo comment
- move smstateen_acc_ok() to near {read,write}_xenvcfg()
- drop patch "target/riscv: Move configuration check to envcfg CSRs predicate()"

11 of 18 patches are in this archive. The cover letter announces 18.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18target/riscv: gdbstub: Check priv spec version before reporting CSRtarget/riscv/gdbstub.c+3 -00 replies
2/18target/riscv: Add some comments to clarify the priority policy of riscv_csrrw_check()target/riscv/csr.c+10 -12 replies
3/18target/riscv: Use g_assert() for the predicate() NULL checktarget/riscv/csr.c+1 -52 replies
4/18target/riscv: gdbstub: Minor change for better readabilitytarget/riscv/gdbstub.c+2 -20 replies
5/18target/riscv: gdbstub: Do not generate CSR XML if Zicsr is disabledtarget/riscv/gdbstub.c+6 -36 replies
6/18target/riscv: Coding style fixes in csr.ctarget/riscv/csr.c+32 -300 replies
7/18target/riscv: Use 'bool' type for read_onlytarget/riscv/csr.c+1 -10 replies
8/18target/riscv: Simplify {read, write}_pmpcfg() a little bittarget/riscv/csr.c+2 -20 replies
9/18target/riscv: Simplify getting RISCVCPU pointer from envtarget/riscv/csr.c+12 -240 replies
10/18target/riscv: Avoid reporting odd-numbered pmpcfgX in the CSR XML for RV64target/riscv/csr.c+9 -150 replies
11/18target/riscv: gdbstub: Turn on debugger mode before calling CSR predicate()target/riscv/gdbstub.c+9 -00 replies

Reviews trailers per patch

All 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchWeiwei LiLIU Zhiwei
SeriesR-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b
1/18R-b R-b
2/18R-b R-b
3/18R-b R-b
4/18R-b R-b
5/18R-b R-b
6/18R-b R-b
7/18R-b R-b
8/18R-b R-b
9/18R-b R-b
10/18R-b R-b
11/18R-b R-b

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

Read the v2 thread

Cover letter [PATCH v2 00/18] target/riscv: Various fixes to gdbstub and CSR access

At present gdbstub reports an incorrect / incomplete CSR list in the target description XML, for example:

- menvcfg is reported in 'sifive_u' machine
- fcsr is missing in a F/D enabled processor

The issue is caused by:
- priv spec version check is missing when reporting CSRs
- CSR predicate() routine is called without turning on the debugger flag

This series aims to generate a correct and complete CSR list for gdbstub.

This series is rebased against Daniel's FEATURE_* clean-up series v7.
Based-on: [email protected]

Changes in v2:
- keep the original priority policy, instead add some comments for clarification
- new patch: Use assert() for the predicate() NULL check
- keep the 'RV128 restriction check' todo comment
- move smstateen_acc_ok() to near {read,write}_xenvcfg()
- drop patch "target/riscv: Move configuration check to envcfg CSRs predicate()"

Bin Meng (18):
target/riscv: gdbstub: Check priv spec version before reporting CSR target/riscv: Add some comments to clarify the priority policy of
riscv_csrrw_check()
target/riscv: Use g_assert() for the predicate() NULL check target/riscv: gdbstub: Minor change for better readability target/riscv: gdbstub: Do not generate CSR XML if Zicsr is disabled target/riscv: Coding style fixes in csr.c
target/riscv: Use 'bool' type for read_only
target/riscv: Simplify {read,write}_pmpcfg() a little bit target/riscv: Simplify getting RISCVCPU pointer from env target/riscv: Avoid reporting odd-numbered pmpcfgX in the CSR XML for

    RV64

target/riscv: gdbstub: Turn on debugger mode before calling CSR
predicate()
target/riscv: gdbstub: Drop the vector CSRs in riscv-vector.xml target/riscv: Allow debugger to access user timer and counter CSRs target/riscv: Allow debugger to access seed CSR target/riscv: Allow debugger to access {h,s}stateen CSRs target/riscv: Allow debugger to access sstc CSRs target/riscv: Drop priv level check in mseccfg predicate() target/riscv: Group all predicate() routines together

 target/riscv/csr.c     | 341 ++++++++++++++++++++++-------------------
 target/riscv/gdbstub.c | 100 +++---------
 2 files changed, 201 insertions(+), 240 deletions(-)
Signature · 1 line
2.25.1