Skip to contentSkip to conversation

KVM: s390: only deliver service interrupt with payload

PATCH Applied Eric Farman 2 participants 3 messages Feb 25 – Mar 17

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: s390: only deliver service interrupt with payload

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.

---
 arch/s390/kvm/interrupt.c | 3 +++
 1 file changed, 3 insertions(+)
arch/s390/kvm/interrupt.c +3 -0
index 18932a65ca68..dd0413387a9e 100644
@@ -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++;
Signature · 1 line
2.51.0
maintainer Acked-by on v1 1/1
#1 lore raw

Am 25.02.26 um 10:20 schrieb Eric Farman:

Quoted 8 lines

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.

Quoted 4 lines

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.

Quoted 18 lines
---
  arch/s390/kvm/interrupt.c | 3 +++
  1 file changed, 3 insertions(+)
arch/s390/kvm/interrupt.c +3 -0
index 18932a65ca68..dd0413387a9e 100644
@@ -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++;
maintainer Applied
#2 lore raw
In reply to Eric Farman

Am 25.02.26 um 16:20 schrieb Eric Farman:

Quoted 8 lines

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.

Quoted 4 lines

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.

applied.