public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: s390: vsie: retry SIE when unable to get vsie_page
@ 2025-12-17  3:01 Eric Farman
  2026-01-05 12:41 ` Janosch Frank
  2026-01-14  9:39 ` Christoph Schlameuss
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Farman @ 2025-12-17  3:01 UTC (permalink / raw)
  To: Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
	David Hildenbrand, Christoph Schlameuss
  Cc: kvm, linux-s390, 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 <farman@linux.ibm.com>
---
 arch/s390/kvm/vsie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index b526621d2a1b..b8064c6a4b57 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -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)
-- 
2.51.0


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

end of thread, other threads:[~2026-01-20 15:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17  3:01 [PATCH] KVM: s390: vsie: retry SIE when unable to get vsie_page Eric Farman
2026-01-05 12:41 ` Janosch Frank
2026-01-05 15:46   ` Eric Farman
2026-01-14  9:50     ` Claudio Imbrenda
2026-01-15 21:17       ` Eric Farman
2026-01-16 15:45         ` Eric Farman
2026-01-16 17:01           ` Claudio Imbrenda
2026-01-19 14:49           ` Janosch Frank
2026-01-20 15:23             ` Eric Farman
2026-01-14  9:39 ` Christoph Schlameuss

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