Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH 0/6] KVM: s390: selftests: Add selftests for KVM exits on s390x
@ 2026-11-10 11:16 Aaron M. Brown
  2026-11-10 11:16 ` [PATCH 1/6] KVM: s390: selftests: Add kvm_exit test for instruction intercepts Aaron M. Brown
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Aaron M. Brown @ 2026-11-10 11:16 UTC (permalink / raw)
  To: kvm
  Cc: Janosch Frank, Claudio Imbrenda, Christian Borntraeger,
	linux-s390, linux-kselftest, Nitya Khamar

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 <nkhamar@linux.ibm.com>

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)

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

end of thread, other threads:[~2026-11-10 11:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10 11:16 [PATCH 0/6] KVM: s390: selftests: Add selftests for KVM exits on s390x Aaron M. Brown
2026-11-10 11:16 ` [PATCH 1/6] KVM: s390: selftests: Add kvm_exit test for instruction intercepts Aaron M. Brown
2026-11-10 11:30   ` sashiko-bot
2026-11-10 11:16 ` [PATCH 2/6] KVM: s390: selftests: Add SIGP and program exception tests Aaron M. Brown
2026-11-10 11:24   ` sashiko-bot
2026-11-10 11:16 ` [PATCH 3/6] KVM: s390: selftests: Add wait state and VM lifecycle tests Aaron M. Brown
2026-11-10 11:21   ` sashiko-bot
2026-11-10 11:16 ` [PATCH 4/6] KVM: s390: selftests: Add ucontrol helpers and instruction tests Aaron M. Brown
2026-11-10 11:24   ` sashiko-bot
2026-11-10 11:16 ` [PATCH 5/6] KVM: s390: selftests: Add ucontrol storage key and immediate exit tests Aaron M. Brown
2026-11-10 11:25   ` sashiko-bot
2026-11-10 11:16 ` [PATCH 6/6] KVM: s390: selftests: Add clock comparator interrupt test Aaron M. Brown
2026-11-10 11:23   ` sashiko-bot

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