KVM: s390: vsie: retry SIE when unable to get vsie_page
authorEric Farman <farman@linux.ibm.com>
Wed, 17 Dec 2025 03:01:07 +0000 (04:01 +0100)
committerJanosch Frank <frankja@linux.ibm.com>
Mon, 19 Jan 2026 15:12:02 +0000 (16:12 +0100)
SIE may exit because of pending host work, such as handling an interrupt,
in which case VSIE rewinds the guest PSW such that it is transparently
resumed (see Fixes tag). Unlike those other places that return rc=0, this
return leaves the guest PSW in place, requiring the guest to handle a
spurious intercept. This showed up when testing heavy I/O workloads,
when multiple vcpus attempted to dispatch the same SIE block and incurred
failures inserting them into the radix tree.

Fixes: 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
[frankja@linux.ibm.com: Replaced commit message as agreed on the list]
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
arch/s390/kvm/vsie.c

index b526621..b8064c6 100644 (file)
@@ -1498,11 +1498,13 @@ int kvm_s390_handle_vsie(struct kvm_vcpu *vcpu)
        }
 
        vsie_page = get_vsie_page(vcpu->kvm, scb_addr);
-       if (IS_ERR(vsie_page))
+       if (IS_ERR(vsie_page)) {
                return PTR_ERR(vsie_page);
-       else if (!vsie_page)
+       } else if (!vsie_page) {
                /* double use of sie control block - simply do nothing */
+               kvm_s390_rewind_psw(vcpu, 4);
                return 0;
+       }
 
        rc = pin_scb(vcpu, vsie_page, scb_addr);
        if (rc)