thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
Pablo Greco e6a3ae
From 9f13c7165566f442484fa6c335950465ed6a2050 Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 17 Apr 2019 13:57:38 +0100
Pablo Greco e6a3ae
Subject: [PATCH 21/24] s390x/pci: Warn when adding PCI devices without the
Pablo Greco e6a3ae
 'zpci' feature
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190417135741.25297-22-cohuck@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 85803
Pablo Greco e6a3ae
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH v2 21/24] s390x/pci: Warn when adding PCI devices without the 'zpci' feature
Pablo Greco e6a3ae
Bugzilla: 1699070
Pablo Greco e6a3ae
RH-Acked-by: David Hildenbrand <david@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: David Hildenbrand <david@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
We decided to always create the PCI host bridge, even if 'zpci' is not
Pablo Greco e6a3ae
enabled (due to migration compatibility). This however right now allows
Pablo Greco e6a3ae
to add zPCI/PCI devices to a VM although the guest will never actually see
Pablo Greco e6a3ae
them, confusing people that are using a simple CPU model that has no
Pablo Greco e6a3ae
'zpci' enabled - "Why isn't this working" (David Hildenbrand)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Let's check for 'zpci' and at least print a warning that this will not
Pablo Greco e6a3ae
work as expected. We could also bail out, however that might break
Pablo Greco e6a3ae
existing QEMU commandlines.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Reviewed-by: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: David Hildenbrand <david@redhat.com>
Pablo Greco e6a3ae
Message-Id: <20190130155733.32742-4-david@redhat.com>
Pablo Greco e6a3ae
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Pablo Greco e6a3ae
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 703fef6fcf3edcbf169c90b6196fcf88f9e9765a)
Pablo Greco e6a3ae
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 hw/s390x/s390-pci-bus.c | 6 ++++++
Pablo Greco e6a3ae
 1 file changed, 6 insertions(+)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
Pablo Greco e6a3ae
index a0f7245..1ba7873 100644
Pablo Greco e6a3ae
--- a/hw/s390x/s390-pci-bus.c
Pablo Greco e6a3ae
+++ b/hw/s390x/s390-pci-bus.c
Pablo Greco e6a3ae
@@ -864,6 +864,12 @@ static void s390_pcihost_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
Pablo Greco e6a3ae
 {
Pablo Greco e6a3ae
     S390pciState *s = S390_PCI_HOST_BRIDGE(hotplug_dev);
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
+    if (!s390_has_feat(S390_FEAT_ZPCI)) {
Pablo Greco e6a3ae
+        warn_report("Plugging a PCI/zPCI device without the 'zpci' CPU "
Pablo Greco e6a3ae
+                    "feature enabled; the guest will not be able to see/use "
Pablo Greco e6a3ae
+                    "this device");
Pablo Greco e6a3ae
+    }
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
     if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
Pablo Greco e6a3ae
         PCIDevice *pdev = PCI_DEVICE(dev);
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae