[SRU][R][PATCH 1/5] KVM: s390: only deliver service interrupt with payload

Massimiliano Pellizzer massimiliano.pellizzer at canonical.com
Wed May 27 22:48:07 UTC 2026


From: Eric Farman <farman at linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/2153159

Routine __inject_service() may set both the SERVICE and SERVICE_EV
pending bits, and in the case of a pure service event the corresponding
trip through __deliver_service_ev() will clear the SERVICE_EV bit only.
This necessitates an additional trip through __deliver_service() for
the other pending interrupt bit, however it is possible that the
external interrupt parameters are zero and there is nothing to be
delivered to the guest.

To avoid sending empty data to the guest, let's only write out the SCLP
data when there is something for the guest to do, otherwise bail out.

Signed-off-by: Eric Farman <farman at linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger at linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger at linux.ibm.com>
Signed-off-by: Janosch Frank <frankja at linux.ibm.com>
(cherry picked from commit 2623c96f1172ae249b67de1dfc4eacebc8673876)
Signed-off-by: Massimiliano Pellizzer <massimiliano.pellizzer at canonical.com>
---
 arch/s390/kvm/interrupt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 7cb8ce833b62..07f59c3b9a7b 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -956,6 +956,9 @@ static int __must_check __deliver_service(struct kvm_vcpu *vcpu)
 		set_bit(IRQ_PEND_EXT_SERVICE, &fi->masked_irqs);
 	spin_unlock(&fi->lock);
 
+	if (!ext.ext_params)
+		return 0;
+
 	VCPU_EVENT(vcpu, 4, "deliver: sclp parameter 0x%x",
 		   ext.ext_params);
 	vcpu->stat.deliver_service_signal++;
-- 
2.53.0




More information about the kernel-team mailing list