[PATCH v1 0/2] KVM: s390: vsie: Do not overwrite guest 3 state on early validity icpt

From: Gautam Gala

Date: Thu Nov 19 2026 - 07:50:09 EST


If prepare_cpuflags() rejects the SCB provided by guest 2 with a
validity interception, shadow_scb() still calls unshadow_scb(). That
copies the guest state from the shadow SCB back into the guest 2 SCB,
although the shadow SCB does not hold guest 3 state at that point. Guest
2 then sees its guest 3 state overwritten with zeroes (new or recycled
vsie page) or with the state of the previous run (cached vsie page),
without guest 3 having run.

Patch 1 copies back only the interception data in this case and clears
the stale interception data (icptstatus, ipa, ipb) when a shadow SCB is
reused.

Patch 2 adds a selftest for early and late validity interceptions.

Gautam Gala (2):
KVM: s390: vsie: Do not overwrite guest 3 state on early validity icpt
KVM: s390: selftests: Add vsie validity interception tests

arch/s390/kvm/s390/vsie.c | 24 +-
tools/testing/selftests/kvm/Makefile.kvm | 1 +
.../selftests/kvm/s390/vsie_validity_test.c | 435 ++++++++++++++++++
3 files changed, 453 insertions(+), 7 deletions(-)
create mode 100644 tools/testing/selftests/kvm/s390/vsie_validity_test.c

--
2.56.0