]> Git Repo - qemu.git/commitdiff
pseries: Don't expose PCIe extended config space on older machine types
authorDavid Gibson <[email protected]>
Tue, 14 Mar 2017 00:54:17 +0000 (11:54 +1100)
committerDavid Gibson <[email protected]>
Tue, 14 Mar 2017 00:54:17 +0000 (11:54 +1100)
bb9986452 "spapr_pci: Advertise access to PCIe extended config space"
allowed guests to access the extended config space of PCI Express devices
via the PAPR interfaces, even though the paravirtualized bus mostly acts
like plain PCI.

However, that patch enabled access unconditionally, including for existing
machine types, which is an unwise change in behaviour.  This patch limits
the change to pseries-2.9 (and later) machine types.

Suggested-by: Andrea Bolognani <[email protected]>
Signed-off-by: David Gibson <[email protected]>
hw/ppc/spapr.c
hw/ppc/spapr_pci.c
include/hw/pci-host/spapr.h

index c3bb991605455df097c0148acff9d7d83287180a..6ee566d658f8eac4733c2336918894f1ed3c2230 100644 (file)
@@ -3163,8 +3163,13 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", true);
 /*
  * pseries-2.8
  */
-#define SPAPR_COMPAT_2_8                            \
-    HW_COMPAT_2_8
+#define SPAPR_COMPAT_2_8                                        \
+    HW_COMPAT_2_8                                               \
+    {                                                           \
+        .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,                 \
+        .property = "pcie-extended-configuration-space",        \
+        .value    = "off",                                      \
+    },
 
 static void spapr_machine_2_8_instance_options(MachineState *machine)
 {
index 919d3c2c5904c572b6a97b630d70363cef5756c3..98c52e411f17cf011e2be31fa2f30ac0463a7013 100644 (file)
@@ -1321,7 +1321,7 @@ static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,
     _FDT(fdt_setprop(fdt, offset, "assigned-addresses",
                      (uint8_t *)rp.assigned, rp.assigned_len));
 
-    if (pci_is_express(dev)) {
+    if (sphb->pcie_ecs && pci_is_express(dev)) {
         _FDT(fdt_setprop_cell(fdt, offset, "ibm,pci-config-space-type", 0x1));
     }
 
@@ -1858,6 +1858,8 @@ static Property spapr_phb_properties[] = {
     DEFINE_PROP_UINT32("numa_node", sPAPRPHBState, numa_node, -1),
     DEFINE_PROP_BOOL("pre-2.8-migration", sPAPRPHBState,
                      pre_2_8_migration, false),
+    DEFINE_PROP_BOOL("pcie-extended-configuration-space", sPAPRPHBState,
+                     pcie_ecs, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
index dfa76143f3054c03441da2e4e3b76866b0dbceb6..1c2e970da2d17a0c234dfbd5070ce92fd4be5c49 100644 (file)
@@ -80,6 +80,8 @@ struct sPAPRPHBState {
 
     uint32_t numa_node;
 
+    bool pcie_ecs; /* Allow access to PCIe extended config space? */
+
     /* Fields for migration compatibility hacks */
     bool pre_2_8_migration;
     uint32_t mig_liobn;
This page took 0.036586 seconds and 4 git commands to generate.