public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: s390: only deliver service interrupt with payload
@ 2026-02-25 15:20 Eric Farman
  2026-02-25 16:27 ` Christian Borntraeger
  2026-03-17  8:29 ` Christian Borntraeger
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Farman @ 2026-02-25 15:20 UTC (permalink / raw)
  To: Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
	David Hildenbrand
  Cc: kvm, linux-s390, Eric Farman

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@linux.ibm.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 18932a65ca68..dd0413387a9e 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.51.0


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

* Re: [PATCH] KVM: s390: only deliver service interrupt with payload
  2026-02-25 15:20 [PATCH] KVM: s390: only deliver service interrupt with payload Eric Farman
@ 2026-02-25 16:27 ` Christian Borntraeger
  2026-03-17  8:29 ` Christian Borntraeger
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Borntraeger @ 2026-02-25 16:27 UTC (permalink / raw)
  To: Eric Farman, Janosch Frank, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

Am 25.02.26 um 10:20 schrieb Eric Farman:
> 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@linux.ibm.com>

Acked-by: Christian Borntraeger <borntraeger@linux.ibm.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 18932a65ca68..dd0413387a9e 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++;


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

* Re: [PATCH] KVM: s390: only deliver service interrupt with payload
  2026-02-25 15:20 [PATCH] KVM: s390: only deliver service interrupt with payload Eric Farman
  2026-02-25 16:27 ` Christian Borntraeger
@ 2026-03-17  8:29 ` Christian Borntraeger
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Borntraeger @ 2026-03-17  8:29 UTC (permalink / raw)
  To: Eric Farman, Janosch Frank, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

Am 25.02.26 um 16:20 schrieb Eric Farman:
> 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@linux.ibm.com>

applied.


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

end of thread, other threads:[~2026-03-17  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 15:20 [PATCH] KVM: s390: only deliver service interrupt with payload Eric Farman
2026-02-25 16:27 ` Christian Borntraeger
2026-03-17  8:29 ` Christian Borntraeger

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