mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Douglas Freimuth <freimuth@linux.ibm.com>,
	borntraeger@linux.ibm.com, imbrenda@linux.ibm.com,
	frankja@linux.ibm.com, david@kernel.org, hca@linux.ibm.com,
	gor@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 3/3] KVM: s390: Introducing kvm_arch_set_irq_inatomic fast inject
Date: Thu, 28 May 2026 12:06:44 -0400	[thread overview]
Message-ID: <47d4ec9f-ed26-4055-a78c-62be53d33d23@linux.ibm.com> (raw)
In-Reply-To: <20260526015323.207343-4-freimuth@linux.ibm.com>

On 5/25/26 9:53 PM, Douglas Freimuth wrote:
> s390 needs a fast path for irq injection, and along those lines we
> introduce kvm_arch_set_irq_inatomic. Instead of placing all interrupts on
> the global work queue as it does today, this patch provides a fast path for
> irq injection.
> 
> The inatomic fast path cannot lose control since it is running with
> interrupts disabled. This meant making the following changes that exist on
> the slow path today. First, the adapter_indicators page needs to be mapped
> since it is accessed with interrupts disabled, so we added map/unmap
> functions. Second, access to shared resources between the fast and slow
> paths needed to be changed from mutex and semaphores to spin_lock's.
> Finally, the memory allocation on the slow path utilizes GFP_KERNEL_ACCOUNT
> but we had to implement the fast path with GFP_ATOMIC allocation. Each of
> these enhancements were required to prevent blocking on the fast inject
> path.
> 
> Fencing of Fast Inject in Secure Execution environments is enabled in the
> patch series by not mapping adapter indicator pages. In Secure Execution
> environments the path of execution available before this patch is followed.
> 
> Statistical counters have been added to enable analysis of irq injection on
> the fast path and slow path including io_390_inatomic, io_flic_inject_airq,
> io_set_adapter_int and io_390_inatomic_adapter_masked_or_coalesced.

That's a mouthful.  And it also doesn't include suppressed interrupts.

How about something like _no_inject to imply that interrupt was
delivered via the adapter interrupt bits without needing to inject the
irq.

[...]

> @@ -2719,25 +2728,41 @@ static int kvm_s390_inject_airq(struct kvm *kvm,
>  		.parm = 0,
>  		.parm64 = isc_to_int_word(adapter->isc),
>  	};
> +	struct kvm_s390_interrupt_info *inti;
> +	unsigned long flags;
> +
>  	int ret = 0;
>  
> -	if (!test_kvm_facility(kvm, 72) || !adapter->suppressible)
> -		return kvm_s390_inject_vm(kvm, &s390int);
> +	inti = kzalloc_obj(*inti, GFP_KERNEL_ACCOUNT);
> +	if (!inti)
> +		return -ENOMEM;
>  
> -	mutex_lock(&fi->ais_lock);
> +	if (!test_kvm_facility(kvm, 72) || !adapter->suppressible) {
> +		ret = kvm_s390_inject_vm(kvm, &s390int, inti);
> +		if (ret)
> +			kfree(inti);
> +		return ret;
> +	}
> +
> +	spin_lock_irqsave(&fi->ais_lock, flags);
>  	if (fi->nimm & AIS_MODE_MASK(adapter->isc)) {
>  		trace_kvm_s390_airq_suppressed(adapter->id, adapter->isc);
> -		goto out;
> +		spin_unlock_irqrestore(&fi->ais_lock, flags);
> +		kfree(inti);

I suggested adding this to the same counter as masked and coalesced, and
I still think you should:  so add a _no_inject++ here

Otherwise, LGTM -- please send a v9 with this and the other small things
I mentioned on the other 2 patches.

      reply	other threads:[~2026-05-28 16:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  1:53 [PATCH v8 0/3] KVM: s390: Introducing kvm_arch_set_irq_inatomic Fast Inject Douglas Freimuth
2026-05-26  1:53 ` [PATCH v8 1/3] KVM: s390: Add map/unmap ioctl and clean mappings post-guest Douglas Freimuth
2026-05-28 13:52   ` Matthew Rosato
2026-05-26  1:53 ` [PATCH v8 2/3] KVM: s390: Enable adapter_indicators_set to use mapped pages Douglas Freimuth
2026-05-28 13:57   ` Matthew Rosato
2026-05-26  1:53 ` [PATCH v8 3/3] KVM: s390: Introducing kvm_arch_set_irq_inatomic fast inject Douglas Freimuth
2026-05-28 16:06   ` Matthew Rosato [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47d4ec9f-ed26-4055-a78c-62be53d33d23@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=freimuth@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome