Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [kvm-unit-tests v2 0/2] riscv: Add double trap testing
@ 2025-06-03 15:46 Clément Léger
  2025-06-03 15:46 ` [kvm-unit-tests v2 1/2] lib/riscv: export FWFT functions Clément Léger
  2025-06-03 15:46 ` [kvm-unit-tests v2 2/2] riscv: Add ISA double trap extension testing Clément Léger
  0 siblings, 2 replies; 6+ messages in thread
From: Clément Léger @ 2025-06-03 15:46 UTC (permalink / raw)
  To: kvm, kvm-riscv; +Cc: Clément Léger, Andrew Jones, Ved Shanbhogue

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

---

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        | 211 ++++++++++++++++++++++++++++++++++++++
 riscv/sbi-fwft.c          |  49 +++------
 riscv/unittests.cfg       |   4 +
 8 files changed, 266 insertions(+), 35 deletions(-)
 create mode 100644 riscv/isa-dbltrp.c

-- 
2.49.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-05 10:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03 15:46 [kvm-unit-tests v2 0/2] riscv: Add double trap testing Clément Léger
2025-06-03 15:46 ` [kvm-unit-tests v2 1/2] lib/riscv: export FWFT functions Clément Léger
2025-06-03 15:46 ` [kvm-unit-tests v2 2/2] riscv: Add ISA double trap extension testing Clément Léger
2025-06-03 16:25   ` Andrew Jones
2025-06-05  9:52     ` Clément Léger
2025-06-05 10:34       ` Andrew Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox