]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
s390x/pci: set kvm_msi_via_irqfd_allowed
authorMatthew Rosato <mjrosato@linux.ibm.com>
Wed, 8 Oct 2025 20:33:50 +0000 (16:33 -0400)
committerThomas Huth <thuth@redhat.com>
Fri, 10 Oct 2025 08:02:51 +0000 (10:02 +0200)
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>
hw/s390x/s390-pci-bus.c
include/hw/s390x/s390-pci-kvm.h

index e8e41c8a9a10aeb7808dafead431fe917a65a763..52820894fa1680ff8ce1e2a93903366a25090f68 100644 (file)
@@ -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)
index 933814a4025bb050af9d5a675d4f8a52f8eced33..c33f2833a3cc36690f11d5fb00f50054fa48ac49 100644 (file)
 
 #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;