Skip to content

RISCV: Add kvm Sstc timer selftests

Haibo Xu kvm kvm-riscv kvmarm linux-arm-kernel linux-kselftest linux-riscv lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest12 patches 14 repliesIn review
  2. v411 patches 16 repliesSuperseded
  3. v39 patches 21 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v28 patches31 repliesSuperseded
v14 patches20 repliesSuperseded

Changes in v5 from the cover letter

* Rebased to Linux 6.7-rc8
* Added new patch(2/12) to clean up the data type in struct test_args
* Re-ordered patch(11/11) in v4 to patch(3/12)
* Changed the timer_err_margin_us type from int to uint32_t

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12selftests/kvm: Fix issues with $(SPLIT_TESTS)tools/testing/selftests/kvm/Makefile+12 -80 replies
2/12KVM: arm64: selftests: Data type cleanup for arch_timer testtools/testing/selftests/kvm/aarch64/arch_timer.c+6 -62 replies
3/12KVM: arm64: selftests: Enable tuning of error margin in arch_timer testtools/testing/selftests/kvm/aarch64/arch_timer.c+23 -90 replies
4/12KVM: arm64: selftests: Split arch_timer test codetools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/aarch64/arch_timer.c tools/testing/selftests/kvm/arch_timer.c +2 more+311 -2800 replies
5/12KVM: selftests: Add CONFIG_64BIT definition for the buildtools/testing/selftests/kvm/Makefile+1 -10 replies
6/12tools: riscv: Add header file csr.htools/arch/riscv/include/asm/csr.h+541 -00 replies
7/12tools: riscv: Add header file vdso/processor.htools/arch/riscv/include/asm/vdso/processor.h+32 -00 replies
8/12KVM: riscv: selftests: Switch to use macro from csr.htools/testing/selftests/kvm/include/riscv/processor.h+2 -80 replies
9/12KVM: riscv: selftests: Add exception handling supporttools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/include/riscv/processor.h +2 more+221 -00 replies
10/12KVM: riscv: selftests: Add guest helper to get vcpu idtools/testing/selftests/kvm/include/aarch64/processor.h tools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/lib/riscv/processor.c+10 -40 replies
11/12KVM: riscv: selftests: Change vcpu_has_ext to a common functiontools/testing/selftests/kvm/include/riscv/processor.h tools/testing/selftests/kvm/lib/riscv/processor.c tools/testing/selftests/kvm/riscv/get-reg-list.c+13 -107 replies
12/12KVM: riscv: selftests: Add sstc timer testtools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/aarch64/arch_timer.c tools/testing/selftests/kvm/arch_timer.c +4 more+210 -100 replies

Reviews trailers per patch

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

PatchAndrew JonesMarc Zyngier
SeriesR-b
1/12T-b
2/12R-b
3/12R-b
4/12R-b
5/12R-b
6/12R-b
7/12R-b
8/12R-b
9/12R-b
10/12R-b
11/12R-b
12/12R-b

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

Read the v5 thread

Cover letter [PATCH v5 00/12] RISCV: Add kvm Sstc timer selftests

The RISC-V arch_timer selftests is used to validate Sstc timer functionality in a guest, which sets up periodic timer interrupts and check the basic interrupt status upon its receipt.

This KVM selftests was ported from aarch64 arch_timer and tested with Linux v6.7-rc8 on a Qemu riscv64 virt machine.

---
Changed since v4:
* Rebased to Linux 6.7-rc8
* Added new patch(2/12) to clean up the data type in struct test_args
* Re-ordered patch(11/11) in v4 to patch(3/12)
* Changed the timer_err_margin_us type from int to uint32_t

Haibo Xu (11):
KVM: arm64: selftests: Data type cleanup for arch_timer test
KVM: arm64: selftests: Enable tuning of error margin in arch_timer
test
KVM: arm64: selftests: Split arch_timer test code
KVM: selftests: Add CONFIG_64BIT definition for the build
tools: riscv: Add header file csr.h
tools: riscv: Add header file vdso/processor.h
KVM: riscv: selftests: Switch to use macro from csr.h
KVM: riscv: selftests: Add exception handling support
KVM: riscv: selftests: Add guest helper to get vcpu id
KVM: riscv: selftests: Change vcpu_has_ext to a common function
KVM: riscv: selftests: Add sstc timer test

Paolo Bonzini (1):
selftests/kvm: Fix issues with $(SPLIT_TESTS)

 tools/arch/riscv/include/asm/csr.h            | 541 ++++++++++++++++++
 tools/arch/riscv/include/asm/vdso/processor.h |  32 ++
 tools/testing/selftests/kvm/Makefile          |  27 +-
 .../selftests/kvm/aarch64/arch_timer.c        | 295 +---------
 tools/testing/selftests/kvm/arch_timer.c      | 259 +++++++++
 .../selftests/kvm/include/aarch64/processor.h |   4 -
 .../selftests/kvm/include/kvm_util_base.h     |   9 +
 .../selftests/kvm/include/riscv/arch_timer.h  |  71 +++
 .../selftests/kvm/include/riscv/processor.h   |  65 ++-
 .../testing/selftests/kvm/include/test_util.h |   2 +
 .../selftests/kvm/include/timer_test.h        |  45 ++
 .../selftests/kvm/lib/riscv/handlers.S        | 101 ++++
 .../selftests/kvm/lib/riscv/processor.c       |  87 +++
 .../testing/selftests/kvm/riscv/arch_timer.c  | 111 ++++
 .../selftests/kvm/riscv/get-reg-list.c        |  11 +-
 15 files changed, 1353 insertions(+), 307 deletions(-)
 create mode 100644 tools/arch/riscv/include/asm/csr.h
 create mode 100644 tools/arch/riscv/include/asm/vdso/processor.h
 create mode 100644 tools/testing/selftests/kvm/arch_timer.c
 create mode 100644 tools/testing/selftests/kvm/include/riscv/arch_timer.h
 create mode 100644 tools/testing/selftests/kvm/include/timer_test.h
 create mode 100644 tools/testing/selftests/kvm/lib/riscv/handlers.S
 create mode 100644 tools/testing/selftests/kvm/riscv/arch_timer.c
Signature · 1 line
2.34.1