All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] KVM: s390: vsie: Avoid injecting machine check on signal
@ 2026-03-16 10:39 Christian Borntraeger
  2026-03-16 11:56 ` Heiko Carstens
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Borntraeger @ 2026-03-16 10:39 UTC (permalink / raw)
  To: KVM
  Cc: Christian Borntraeger, Janosch Frank, David Hildenbrand,
	linux-s390, Thomas Huth, Claudio Imbrenda, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev

The recent XFER_TO_GUEST_WORK change resulted in a situation, where the
vsie code would interpret a signal during work as a machine check during
SIE as both use the EINTR return code.

Fixes: 2bd1337a1295e ("KVM: s390: Use generic VIRT_XFER_TO_GUEST_WORK functions")
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
 arch/s390/kvm/vsie.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index c0d36afd4023..8e71393bb3d2 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -1121,10 +1121,11 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page, struc
 	__acquires(vcpu->kvm->srcu)
 {
 	struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
 	struct kvm_s390_sie_block *scb_o = vsie_page->scb_o;
 	int guest_bp_isolation;
+	int skipped = 1;
 	int rc = 0;
 
 	handle_last_fault(vcpu, vsie_page, sg);
 
 	kvm_vcpu_srcu_read_unlock(vcpu);
@@ -1162,10 +1163,11 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page, struc
 				goto skip_sie;
 			goto xfer_to_guest_mode_check;
 		}
 		guest_timing_enter_irqoff();
 		rc = kvm_s390_enter_exit_sie(scb_s, vcpu->run->s.regs.gprs, sg->asce.val);
+		skipped = 0;
 		guest_timing_exit_irqoff();
 		local_irq_enable();
 	}
 
 skip_sie:
@@ -1176,11 +1178,11 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page, struc
 	if (!guest_bp_isolation)
 		clear_thread_flag(TIF_ISOLATE_BP_GUEST);
 
 	kvm_vcpu_srcu_read_lock(vcpu);
 
-	if (rc == -EINTR) {
+	if (!skipped && rc == -EINTR) {
 		kvm_s390_reinject_machine_check(vcpu, &vsie_page->mcck_info);
 		return 0;
 	}
 
 	if (rc > 0)
-- 
2.53.0


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

end of thread, other threads:[~2026-03-16 12:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 10:39 [PATCH/RFC] KVM: s390: vsie: Avoid injecting machine check on signal Christian Borntraeger
2026-03-16 11:56 ` Heiko Carstens
2026-03-16 12:00   ` Christian Borntraeger
2026-03-16 12:31   ` Christian Borntraeger

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.