From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Farhan Ali <alifm@linux.ibm.com>,
Eric Farman <farman@linux.ibm.com>
Subject: [PULL 9/9] s390x/pci: set kvm_msi_via_irqfd_allowed
Date: Fri, 10 Oct 2025 10:21:44 +0200 [thread overview]
Message-ID: <20251010082145.576222-10-thuth@redhat.com> (raw)
In-Reply-To: <20251010082145.576222-1-thuth@redhat.com>
From: Matthew Rosato <mjrosato@linux.ibm.com>
Allow irqfd to be used for virtio-pci on s390x if the kernel supports
it. This improves s390x virtio-pci performance when using kvm
acceleration by allowing kvm to deliver interrupts instead of QEMU.
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Message-ID: <20251008203350.354121-1-mjrosato@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/hw/s390x/s390-pci-kvm.h | 7 +++++++
hw/s390x/s390-pci-bus.c | 1 +
2 files changed, 8 insertions(+)
diff --git a/include/hw/s390x/s390-pci-kvm.h b/include/hw/s390x/s390-pci-kvm.h
index 933814a4025..c33f2833a3c 100644
--- a/include/hw/s390x/s390-pci-kvm.h
+++ b/include/hw/s390x/s390-pci-kvm.h
@@ -14,12 +14,19 @@
#include "hw/s390x/s390-pci-bus.h"
#include "hw/s390x/s390-pci-inst.h"
+#include "system/kvm.h"
#ifdef CONFIG_KVM
+static inline void s390_pcihost_kvm_realize(void)
+{
+ kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled();
+}
+
bool s390_pci_kvm_interp_allowed(void);
int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist);
int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev);
#else
+static inline void s390_pcihost_kvm_realize(void) {}
static inline bool s390_pci_kvm_interp_allowed(void)
{
return false;
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index e8e41c8a9a1..52820894fa1 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -900,6 +900,7 @@ static void s390_pcihost_realize(DeviceState *dev, Error **errp)
s390_pci_init_default_group();
css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false,
S390_ADAPTER_SUPPRESSIBLE, errp);
+ s390_pcihost_kvm_realize();
}
static void s390_pcihost_unrealize(DeviceState *dev)
--
2.51.0
next prev parent reply other threads:[~2025-10-10 8:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 8:21 [PULL 0/9] s390x patches (+ 1 functional test patch) Thomas Huth
2025-10-10 8:21 ` [PULL 1/9] tests/functional: Drop the "Attempting to cache ..." log text Thomas Huth
2025-10-10 8:21 ` [PULL 2/9] s390x/pci: fix interrupt blocking by returning only the device's summary bit Thomas Huth
2025-10-10 8:21 ` [PULL 3/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (1/3) Thomas Huth
2025-10-10 8:21 ` [PULL 4/9] target/s390x: Propagate CPUS390XState to cpu_unmap_lowcore() Thomas Huth
2025-10-10 8:21 ` [PULL 5/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3) Thomas Huth
2025-10-10 8:21 ` [PULL 6/9] target/s390x: Reduce s390_store_adtl_status() scope Thomas Huth
2025-10-10 8:21 ` [PULL 7/9] target/s390x: Reduce s390_store_status() scope Thomas Huth
2025-10-10 8:21 ` [PULL 8/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (3/3) Thomas Huth
2025-10-10 8:21 ` Thomas Huth [this message]
2025-10-10 19:03 ` [PULL 0/9] s390x patches (+ 1 functional test patch) Richard Henderson
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=20251010082145.576222-10-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=alifm@linux.ibm.com \
--cc=farman@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).