KVM: s390: vsie: retry SIE when unable to get vsie_page
PATCH 1/1 KVM: s390: vsie: retry SIE when unable to get vsie_page
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). There is still one scenario where those conditions are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
For this case, rewind the guest PSW as we do in the other non-error exits.
--- arch/s390/kvm/vsie.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/s390/kvm/vsie.c +4 -2
@@ -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)
Signature · 1 line
2.51.0
Janosch Frank
maintainerQuoted 10 lines · Eric Farman
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). There is still one scenario where those conditions are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
For this case, rewind the guest PSW as we do in the other non-error exits.
Fixes 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")Signed-off-by Eric Farman <[email protected]>
This is purely cosmetic to have all instances look the same, right?
Quoted 7 lines · Janosch Frank
Quoted 6 lines · Eric Farman
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). There is still one scenario where those conditions are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
Quoted 6 lines
Quoted 4 lines
For this case, rewind the guest PSW as we do in the other non-error exits.
Fixes 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")Signed-off-by Eric Farman <[email protected]>This is purely cosmetic to have all instances look the same, right?
Nope, I can take this path with particularly high I/O loads on the system, which ends up (incorrectly) sending the intercept to the guest.
Claudio Imbrenda
maintainerQuoted 5 lines · On Mon, 05 Jan 2026 10:46:53 -0500 Eric Farman <[email protected]> wrote:
Quoted 4 lines · Janosch Frank
Quoted 3 lines · Eric Farman
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). There is still one scenario where those conditions
can you add a few words to (very briefly) explain what the scenario is?
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
For this case, rewind the guest PSW as we do in the other non-error exits.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Fixes 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")Signed-off-by Eric Farman <[email protected]>This is purely cosmetic to have all instances look the same, right?
Nope, I can take this path with particularly high I/O loads on the system, which ends up (incorrectly) sending the intercept to the guest.
this is a good candidate for the explanation I mentioned above :)
(the patch itself looks fine)
Quoted 10 lines · Claudio Imbrenda
Quoted 5 lines · On Mon, 05 Jan 2026 10:46:53 -0500 Eric Farman <[email protected]> wrote:
Quoted 4 lines · Janosch Frank
Quoted 3 lines · Eric Farman
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). There is still one scenario where those conditions
can you add a few words to (very briefly) explain what the scenario is?
Maybe if this paragraph were rewritten this way, instead?
--8<--
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 an intercept that was meant to be serviced by the host. 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. -->8--
@Janosch, if that ends up being okay, can you update the patch or do you want me to send a v2?
Quoted 18 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
For this case, rewind the guest PSW as we do in the other non-error exits.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Fixes 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")Signed-off-by Eric Farman <[email protected]>This is purely cosmetic to have all instances look the same, right?
Nope, I can take this path with particularly high I/O loads on the system, which ends up (incorrectly) sending the intercept to the guest.
this is a good candidate for the explanation I mentioned above :)
(the patch itself looks fine)
Quoted 14 lines · Eric Farman
Quoted 10 lines · Claudio Imbrenda
Quoted 5 lines · On Mon, 05 Jan 2026 10:46:53 -0500 Eric Farman <[email protected]> wrote:
Quoted 4 lines · Janosch Frank
Quoted 3 lines · Eric Farman
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). There is still one scenario where those conditions
can you add a few words to (very briefly) explain what the scenario is?
Maybe if this paragraph were rewritten this way, instead?
Quoted 9 lines
--8<--
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 an intercept that was meant to be serviced by the host. 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. -->8--
Spoke to Claudio offline, and he suggested the following edit to the above:
--8<--
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.
-->8--
Quoted 21 lines
@Janosch, if that ends up being okay, can you update the patch or do you want me to send a v2?
Quoted 18 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
For this case, rewind the guest PSW as we do in the other non-error exits.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Fixes 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")Signed-off-by Eric Farman <[email protected]>This is purely cosmetic to have all instances look the same, right?
Nope, I can take this path with particularly high I/O loads on the system, which ends up (incorrectly) sending the intercept to the guest.
this is a good candidate for the explanation I mentioned above :)
(the patch itself looks fine)
Quoted 27 lines · On Fri, 16 Jan 2026 10:45:22 -0500 Eric Farman <[email protected]> wrote:
Quoted 14 lines · Eric Farman
Quoted 10 lines · Claudio Imbrenda
Quoted 5 lines · On Mon, 05 Jan 2026 10:46:53 -0500 Eric Farman <[email protected]> wrote:
Quoted 4 lines · Janosch Frank
Quoted 3 lines · Eric Farman
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). There is still one scenario where those conditions
can you add a few words to (very briefly) explain what the scenario is?
Maybe if this paragraph were rewritten this way, instead?
Quoted 9 lines
--8<--
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 an intercept that was meant to be serviced by the host. 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. -->8--Spoke to Claudio offline, and he suggested the following edit to the above:
Quoted 9 lines
--8<--
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.
-->8--
with the above text:
Quoted 22 lines
Quoted 22 lines
@Janosch, if that ends up being okay, can you update the patch or do you want me to send a v2?
Quoted 18 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
For this case, rewind the guest PSW as we do in the other non-error exits.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Fixes 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")Signed-off-by Eric Farman <[email protected]>This is purely cosmetic to have all instances look the same, right?
Nope, I can take this path with particularly high I/O loads on the system, which ends up (incorrectly) sending the intercept to the guest.
this is a good candidate for the explanation I mentioned above :)
(the patch itself looks fine)
Janosch Frank
maintainerQuoted 27 lines · Eric Farman
Quoted 14 lines · Eric Farman
Quoted 10 lines · Claudio Imbrenda
Quoted 5 lines · On Mon, 05 Jan 2026 10:46:53 -0500 Eric Farman <[email protected]> wrote:
Quoted 4 lines · Janosch Frank
Quoted 3 lines · Eric Farman
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). There is still one scenario where those conditions
can you add a few words to (very briefly) explain what the scenario is?
Maybe if this paragraph were rewritten this way, instead?
Quoted 9 lines
--8<--
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 an intercept that was meant to be serviced by the host. 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. -->8--Spoke to Claudio offline, and he suggested the following edit to the above:
Quoted 12 lines
--8<--
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.
-->8--Quoted 2 lines
@Janosch, if that ends up being okay, can you update the patch or do you want me to send a v2?
I can fix that up.
Quoted 39 lines · Janosch Frank
Quoted 38 lines · Eric Farman
Quoted 14 lines · Eric Farman
Quoted 10 lines · Claudio Imbrenda
Quoted 5 lines · On Mon, 05 Jan 2026 10:46:53 -0500 Eric Farman <[email protected]> wrote:
Quoted 4 lines · Janosch Frank
Quoted 3 lines · Eric Farman
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). There is still one scenario where those conditions
can you add a few words to (very briefly) explain what the scenario is?
Maybe if this paragraph were rewritten this way, instead?
Quoted 9 lines
--8<--
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 an intercept that was meant to be serviced by the host. 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. -->8--Spoke to Claudio offline, and he suggested the following edit to the above:
--8<--
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.
-->8--Quoted 1 line
Quoted 3 lines
Quoted 1 line
Quoted 1 line
@Janosch, if that ends up being okay, can you update the patch or do you want me to send a v2?
I can fix that up.
Great, thank you!
Quoted 10 lines · Eric Farman
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). There is still one scenario where those conditions are not present, but that the VSIE processor returns with effectively rc=0, resulting in additional (and unnecessary) guest work to be performed.
For this case, rewind the guest PSW as we do in the other non-error exits.
Fixes 33a729a1770b ("KVM: s390: vsie: retry SIE instruction on host intercepts")Signed-off-by Eric Farman <[email protected]>
LGTM