thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
bf143f
From 5bd57d8ac3a4e75337eae81a3623b4dc2b417e2f Mon Sep 17 00:00:00 2001
bf143f
From: Matthew Rosato <mjrosato@linux.ibm.com>
bf143f
Date: Fri, 2 Sep 2022 13:27:33 -0400
bf143f
Subject: [PATCH 08/42] s390x/pci: don't fence interpreted devices without
bf143f
 MSI-X
bf143f
MIME-Version: 1.0
bf143f
Content-Type: text/plain; charset=UTF-8
bf143f
Content-Transfer-Encoding: 8bit
bf143f
bf143f
RH-Author: Cédric Le Goater <clg@redhat.com>
bf143f
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
bf143f
RH-Bugzilla: 1664378 2043909
bf143f
RH-Acked-by: Thomas Huth <thuth@redhat.com>
bf143f
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
bf143f
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
bf143f
RH-Commit: [8/41] 52bad4368e9494c43133338b386dc0cc159aeedc
bf143f
bf143f
Lack of MSI-X support is not an issue for interpreted passthrough
bf143f
devices, so let's let these in.  This will allow, for example, ISM
bf143f
devices to be passed through -- but only when interpretation is
bf143f
available and being used.
bf143f
bf143f
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
bf143f
Reviewed-by: Thomas Huth <thuth@redhat.com>
bf143f
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
bf143f
Message-Id: <20220902172737.170349-5-mjrosato@linux.ibm.com>
bf143f
Signed-off-by: Thomas Huth <thuth@redhat.com>
bf143f
(cherry picked from commit 15d0e7942d3b31ff71d8e0e8cec3a8203214f19b)
bf143f
Signed-off-by: Cédric Le Goater <clg@redhat.com>
bf143f
---
bf143f
 hw/s390x/s390-pci-bus.c | 6 +++++-
bf143f
 1 file changed, 5 insertions(+), 1 deletion(-)
bf143f
bf143f
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
bf143f
index 18bfae0465..07c7c155e3 100644
bf143f
--- a/hw/s390x/s390-pci-bus.c
bf143f
+++ b/hw/s390x/s390-pci-bus.c
bf143f
@@ -881,6 +881,10 @@ static int s390_pci_msix_init(S390PCIBusDevice *pbdev)
bf143f
 
bf143f
 static void s390_pci_msix_free(S390PCIBusDevice *pbdev)
bf143f
 {
bf143f
+    if (pbdev->msix.entries == 0) {
bf143f
+        return;
bf143f
+    }
bf143f
+
bf143f
     memory_region_del_subregion(&pbdev->iommu->mr, &pbdev->msix_notify_mr);
bf143f
     object_unparent(OBJECT(&pbdev->msix_notify_mr));
bf143f
 }
bf143f
@@ -1093,7 +1097,7 @@ static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
bf143f
             pbdev->interp = false;
bf143f
         }
bf143f
 
bf143f
-        if (s390_pci_msix_init(pbdev)) {
bf143f
+        if (s390_pci_msix_init(pbdev) && !pbdev->interp) {
bf143f
             error_setg(errp, "MSI-X support is mandatory "
bf143f
                        "in the S390 architecture");
bf143f
             return;
bf143f
-- 
bf143f
2.37.3
bf143f