All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aaron M. Brown" <aaronmbr@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Nitya Khamar <nkhamar@linux.ibm.com>
Subject: [PATCH 0/6] KVM: s390: selftests: Add selftests for KVM exits on s390x
Date: Tue, 10 Nov 2026 06:16:13 -0500	[thread overview]
Message-ID: <20261110111619.61760-1-aaronmbr@linux.ibm.com> (raw)

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)

             reply	other threads:[~2026-11-10 11:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 11:16 Aaron M. Brown [this message]
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-12 13:45   ` Janosch Frank
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261110111619.61760-1-aaronmbr@linux.ibm.com \
    --to=aaronmbr@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nkhamar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.