Skip to content

KVM: s390: selftests: Add selftests for KVM exits on s390x

Aaron M. Brown kvm linux-kselftest linux-s390 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6KVM: s390: selftests: Add kvm_exit test for instruction interceptstools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/include/s390/kvm_lifecycle.h tools/testing/selftests/kvm/s390/kvm_exit.c+248 -02 replies
2/6KVM: s390: selftests: Add SIGP and program exception teststools/testing/selftests/kvm/s390/kvm_exit.c+146 -01 reply
3/6KVM: s390: selftests: Add wait state and VM lifecycle teststools/testing/selftests/kvm/s390/kvm_exit.c+78 -01 reply
4/6KVM: s390: selftests: Add ucontrol helpers and instruction teststools/testing/selftests/kvm/include/s390/kvm_lifecycle.h tools/testing/selftests/kvm/s390/kvm_exit.c+227 -11 reply
5/6KVM: s390: selftests: Add ucontrol storage key and immediate exit teststools/testing/selftests/kvm/s390/kvm_exit.c+107 -00 replies
6/6KVM: s390: selftests: Add clock comparator interrupt testtools/testing/selftests/kvm/s390/kvm_exit.c+74 -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/6] KVM: s390: selftests: Add selftests for KVM exits on s390x

This series adds a selftest for the exits that KVM reports to userspace on s390x, mainly KVM_EXIT_S390_SIEIC. The existing s390 selftests do not check what userspace sees when a guest causes an intercept, for example a DIAG, a SIGP order, a program exception or a wait state.

The tests checks the intercept code, the instruction and program data, and the register state reported in struct kvm_run.

The series is split so that every patch adds tests on top of the previous one:

1: test harness and instruction intercepts (DIAG 0x500 and 0x501) 2: SIGP stop and program exceptions (addressing, segment translation) 3: wait state and VM create/destroy
4: ucontrol helpers, STSI, TSCH and STSCH intercepts
5: ucontrol storage key (KSS) and immediate_exit
6: clock comparator interrupt on a ucontrol VM

The ucontrol tests require KVM_CAP_S390_UCONTROL and CAP_SYS_ADMIN, and the storage key test also requires CPUSTAT_KSS. When one of these is missing, only the affected tests are skipped, with a reason, and the others still run.

These tests were co-developed with Nitya Khamar <[email protected]>

Testing: built with "make -C tools/testing/selftests/kvm ARCH=s390" and ran on a s390x z15 lpar with CONFIG_KVM_S390_UCONTROL=y

as root: pass:13 fail:0 skip:0
as unprivileged: pass:8 fail:0 skip:5 (the five ucontrol tests)

Aaron M. Brown (6):
KVM: s390: selftests: Add kvm_exit test for instruction intercepts
KVM: s390: selftests: Add SIGP and program exception tests
KVM: s390: selftests: Add wait state and VM lifecycle tests
KVM: s390: selftests: Add ucontrol helpers and instruction tests
KVM: s390: selftests: Add ucontrol storage key and immediate exit
tests
KVM: s390: selftests: Add clock comparator interrupt test

 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../kvm/include/s390/kvm_lifecycle.h          |  43 +
 tools/testing/selftests/kvm/s390/kvm_exit.c   | 835 ++++++++++++++++++
 3 files changed, 879 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/include/s390/kvm_lifecycle.h
 create mode 100644 tools/testing/selftests/kvm/s390/kvm_exit.c

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 --
2.50.1 (Apple Git-155)