s390x/pci: set kvm_msi_via_irqfd_allowed
PATCH 1/1 s390x/pci: set kvm_msi_via_irqfd_allowed
Allow irqfd to be used for virtio-pci on s390x if the kernel supports it.
--- hw/s390x/s390-pci-bus.c | 1 + 1 file changed, 1 insertion(+)
hw/s390x/s390-pci-bus.c +1 -0
@@ -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); + kvm_msi_via_irqfd_allowed =kvm_irqfds_enabled (); }static void s390_pcihost_unrealize (DeviceState *dev)
Signature · 1 line
2.51.0
Quoted 5 lines · Matthew Rosato
Allow irqfd to be used for virtio-pci on s390x if the kernel supports it.
Signed-off-by Matthew Rosato <[email protected]>---
FWIW we've been using this change in-house for a while now under test different scenarios - AFAICT failure to set this was just a past oversight since virtio-pci is not the default/recommendation for s390x.
Quoted 15 lines
hw/s390x/s390-pci-bus.c | 1 + 1 file changed, 1 insertion(+)hw/s390x/s390-pci-bus.c +1
-0@@ -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); + kvm_msi_via_irqfd_allowed =kvm_irqfds_enabled (); }static void s390_pcihost_unrealize (DeviceState *dev)
Quoted 13 lines · Matthew Rosato
Allow irqfd to be used for virtio-pci on s390x if the kernel supports it.
Signed-off-by Matthew Rosato <[email protected]>--- hw/s390x/s390-pci-bus.c | 1 + 1 file changed, 1 insertion(+)hw/s390x/s390-pci-bus.c +0
-0
hw/s390x/s390-pci-bus.c static void s390_pcihost_realize(DeviceState *dev, Error **errp) · line 903
Quoted 4 lines
hw/s390x/s390-pci-bus.c +1
-0@@ -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); + kvm_msi_via_irqfd_allowed =kvm_irqfds_enabled ();
Just wondering, what's the net result of this patch?
I assume better performance. Might be worth adding that "why" to the patch description.
Signature · 3 lines
Cheers David / dhildenb
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Matthew Rosato
Allow irqfd to be used for virtio-pci on s390x if the kernel supports it.
Signed-off-by Matthew Rosato <[email protected]>---
hw/s390x/s390-pci-bus.c| 1 +1 file changed, 1 insertion(+)
Quoted 12 lines
hw/s390x/s390-pci-bus.c static void s390_pcihost_realize(DeviceState *dev, Error **errp) · line 903
Quoted 9 lines
hw/s390x/s390-pci-bus.c +1
-0@@ -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); + kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled();Just wondering, what's the net result of this patch?
It allows the virtio-pci core code on s390x to ever decide using irqfd is OK (e.g. without this change we would always reach virtio_queue_set_guest_notifier_fd_handler(..., with_irqfd=false) because kvm_msi_via_irqfd_enabled() was guaranteed to be false.
Quoted 2 lines
I assume better performance. Might be worth adding that "why" to the patch description.
And yes, in a nutshell it means better performance.
How about something like...
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.
Quoted 7 lines · Matthew Rosato
Allow irqfd to be used for virtio-pci on s390x if the kernel supports it.
Signed-off-by Matthew Rosato <[email protected]>--- hw/s390x/s390-pci-bus.c | 1 + 1 file changed, 1 insertion(+)
As Matt alluded to in another reply, this is probably just historical oversight.
Quoted 13 lines
hw/s390x/s390-pci-bus.c +1
-0@@ -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); + kvm_msi_via_irqfd_allowed =kvm_irqfds_enabled (); }static void s390_pcihost_unrealize (DeviceState *dev)