Skip to content

riscv: Add double trap testing

Clément Léger kvm kvm-riscv 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesIn review
  2. v22 patches 3 repliesSuperseded
  3. v13 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Return an error only if SSE event wasn't unregistered successfully

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2lib/riscv: export FWFT functionslib/riscv/asm/sbi.h lib/riscv/sbi.c riscv/sbi-fwft.c+39 -350 replies
2/2riscv: Add ISA double trap extension testinglib/riscv/asm/csr.h lib/riscv/asm/processor.h riscv/Makefile +2 more+226 -02 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAndrew Jones
1/2R-b
2/2

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

Read the v3 thread

Cover letter [kvm-unit-tests v3 0/2] riscv: Add double trap testing

Add a test that triggers double trap and verify that it's behavior conforms to the spec. Also use SSE to verify that an SSE event is correctly sent upon double trap.

In order to run this test, one can use the following command using an upstream version of OpenSBI:

$ QEMU=qemu-system-riscv64 \
  FIRMWARE_OVERRIDE=<opensbi>/fw_dynamic.bin \
  ./riscv-run riscv/isa-dbltrp.flat

---

v3:
- Return an error only if SSE event wasn't unregistered successfully

v2:
- Use WRITE_ONCE/READ_ONCE for shared variables
- Remove locking flag for last test
- Fix a few typos
- Skip crash test if env var DOUBLE_TRAP_TEST_CRASH isn't set
- Skip crash test if SSE event unregistering failed
- Remove SDT clearing patch
- Fix wrong check using ret.value nstead of ret.error

Clément Léger (2):
lib/riscv: export FWFT functions
riscv: Add ISA double trap extension testing

 riscv/Makefile            |   1 +
 lib/riscv/asm/csr.h       |   1 +
 lib/riscv/asm/processor.h |  10 ++
 lib/riscv/asm/sbi.h       |   5 +
 lib/riscv/sbi.c           |  20 ++++
 riscv/isa-dbltrp.c        | 210 ++++++++++++++++++++++++++++++++++++++
 riscv/sbi-fwft.c          |  49 +++------
 riscv/unittests.cfg       |   4 +
 8 files changed, 265 insertions(+), 35 deletions(-)
 create mode 100644 riscv/isa-dbltrp.c
Signature · 1 line
2.49.0