public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] KVM: s390: Introducing kvm_arch_set_irq_inatomic Fast Inject
@ 2026-03-08  3:04 Douglas Freimuth
  2026-03-08  3:04 ` [PATCH v1 1/3] Add map/unmap ioctl and clean mappings post-guest Douglas Freimuth
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Douglas Freimuth @ 2026-03-08  3:04 UTC (permalink / raw)
  To: borntraeger, imbrenda, frankja, david, hca, gor, agordeev, svens,
	kvm, linux-s390, linux-kernel
  Cc: mjrosato, freimuth

This series of three patches enables a non-blocking path for irqfd injection on s390
via kvm_arch_set_irq_inatomic(). Before these changes, kvm_arch_set_irq_inatomic()
would just return -EWOULDBLOCK and place all interrupts on the global
work queue, which must subsequently be processed by a different
thread. This series of patches implements an s390 version of inatomic
and is relevant to virtio-blk and virtio-net and was tested against
virtio-pci and virtio-ccw. To properly test this kernel series with virtio-pci,
a QEMU that includes the 's390x/pci: set kvm_msi_via_irqfd_allowed' fix is needed.
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. And
counters have been added to analyze map/unmap of the adapter_indicator
pages in non-Secure Execution environments and to track fencing of Fast
Inject in Secure Execution environments.

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 a spin_lock. 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.

Patch 1 enables fencing of Fast Injection in Secure Execution
environments by not mapping adapter indicator pages and relying on the
path of execution available prior to this patch.


Douglas Freimuth (3):
  Add map/unmap ioctl and clean mappings post-guest
  Enable adapter_indicators_set to use mapped pages
  Introducing kvm_arch_set_irq_inatomic fast inject

 arch/s390/include/asm/kvm_host.h |  11 +-
 arch/s390/kvm/interrupt.c        | 365 +++++++++++++++++++++++++------
 arch/s390/kvm/kvm-s390.c         |  26 ++-
 arch/s390/kvm/kvm-s390.h         |   3 +-
 4 files changed, 337 insertions(+), 68 deletions(-)

-- 
2.52.0


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

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

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-08  3:04 [PATCH v1 0/3] KVM: s390: Introducing kvm_arch_set_irq_inatomic Fast Inject Douglas Freimuth
2026-03-08  3:04 ` [PATCH v1 1/3] Add map/unmap ioctl and clean mappings post-guest Douglas Freimuth
2026-03-08 13:15   ` kernel test robot
2026-03-09  9:27   ` Christian Borntraeger
2026-03-09 17:12     ` Douglas Freimuth
2026-03-09 18:15       ` Christian Borntraeger
2026-03-09 14:41   ` Sean Christopherson
2026-03-11 20:24   ` Matthew Rosato
2026-03-08  3:04 ` [PATCH v1 2/3] Enable adapter_indicators_set to use mapped pages Douglas Freimuth
2026-03-11 20:24   ` Matthew Rosato
2026-03-08  3:04 ` [PATCH v1 3/3] Introducing kvm_arch_set_irq_inatomic fast inject Douglas Freimuth
2026-03-11 20:24   ` Matthew Rosato
2026-03-13 14:01     ` Douglas Freimuth
2026-03-16 15:41       ` Matthew Rosato
2026-03-17 13:06         ` Douglas Freimuth

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