Skip to content

riscv: riscv,isa fixes + check script

Daniel Henrique Barboza qemu-devel qemu-riscv 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2target/riscv/cpu.c: isa_edata_arr[] ordering fixestarget/riscv/cpu.c+7 -70 replies
2/2scripts: RISC-V python script to check isa_edata_arr[]scripts/riscv-isaedata-check.py target/riscv/cpu.c+167 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] riscv: riscv,isa fixes + check script

Hi,

We have an array called isa_edata_arr[] in target/riscv/cpu.c which needs to be always kept in the RISC-V specification riscv,isa order. Easier said that done: as more and more extensions are added we're failing to keep up with the array ordering in the review process.

I have considered changing how we're retrieving riscv,isa to not rely on the array ordering (in fact I have code that does that). We would sort the enabled extensions using riscv,is ordering during init time, before writing it in the DT, ignoring the current isa_edata_arr ordering. When all was said and done that sounded a bit extreme and I think there's other stuff we can try first.

Patch 2 in this series is a python script I put together to, hopefully help us identify if we're messing up the isa_edata_arr ordering and fix it before pushing changes upstream. I used it to validate the changes I did in patch 1 (the usual 'fix isa_edata_arr ordering' patch) and I can tell that the script picked up *way* more ordering errors that I was able to identify on my own.

I didn't made any CI related changes w.r.t this new script but it is something to consider - if changes in target/riscv/cpu.c are made, run this script to validate the array again.

Patches based on alistair/riscv-to-apply.next.

Daniel Henrique Barboza (2):
target/riscv/cpu.c: isa_edata_arr[] ordering fixes
scripts: RISC-V python script to check isa_edata_arr[]

 scripts/riscv-isaedata-check.py | 164 ++++++++++++++++++++++++++++++++
 target/riscv/cpu.c              |  17 ++--
 2 files changed, 174 insertions(+), 7 deletions(-)
 create mode 100755 scripts/riscv-isaedata-check.py
Signature · 1 line
2.51.1