[libvirt] [PATCH 06/11] qemu: Implement pcie-to-pci-bridge controller

Andrea Bolognani posted 11 patches 7 years, 1 month ago
[libvirt] [PATCH 06/11] qemu: Implement pcie-to-pci-bridge controller
Posted by Andrea Bolognani 7 years, 1 month ago
The new controller will not yet be used automatically by
libvirt, but at this point it's already possible to configure
a guest to use it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 docs/formatdomain.html.in      |  3 ++-
 docs/schemas/domaincommon.rng  |  3 +++
 src/conf/domain_addr.c         | 25 ++++++++++++++++++++-----
 src/conf/domain_addr.h         |  4 +++-
 src/conf/domain_conf.c         |  3 +++
 src/conf/domain_conf.h         |  2 ++
 src/qemu/qemu_command.c        |  1 +
 src/qemu/qemu_domain.c         | 17 +++++++++++++++++
 src/qemu/qemu_domain_address.c |  4 ++++
 9 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 299d7b9d42..fa5a0fff8a 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3942,7 +3942,8 @@
       <code>pcie-root-port</code>, <code>pcie-switch-upstream-port</code> and
       <code>pcie-switch-downstream-port</code> (<span class="since">since
       1.2.19</span>), <code>pci-expander-bus</code> and
-      <code>pcie-expander-bus</code> (<span class="since">since 1.3.4</span>).
+      <code>pcie-expander-bus</code> (<span class="since">since 1.3.4</span>),
+      <code>pcie-to-pci-bridge</code> (<span class="since">since 4.3.0</span>).
       The root controllers (<code>pci-root</code>
       and <code>pcie-root</code>) have an
       optional <code>pcihole64</code> element specifying how big (in
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 8165e699d6..85ba95d5f6 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2102,6 +2102,8 @@
                     <value>pci-bridge</value>
                     <!-- implementations of 'dmi-to-pci-bridge' -->
                     <value>i82801b11-bridge</value>
+                    <!-- implementations of 'pcie-to-pci-bridge' -->
+                    <value>pcie-pci-bridge</value>
                     <!-- implementations of 'pcie-root-port' -->
                     <value>ioh3420</value>
                     <value>pcie-root-port</value>
@@ -2172,6 +2174,7 @@
                   <choice>
                     <value>pci-bridge</value>
                     <value>dmi-to-pci-bridge</value>
+                    <value>pcie-to-pci-bridge</value>
                     <value>pcie-root-port</value>
                     <value>pcie-switch-upstream-port</value>
                     <value>pcie-switch-downstream-port</value>
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index e02d7ac614..b0709f8295 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -62,6 +62,9 @@ virDomainPCIControllerModelToConnectType(virDomainControllerModelPCI model)
     case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE:
         return VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE;
 
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
+        return VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE;
+
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
         return VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT | VIR_PCI_CONNECT_AGGREGATE_SLOT;
 
@@ -160,6 +163,8 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
             connectStr = "pci-switch-downstream-port";
         } else if (devFlags & VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE) {
             connectStr = "dmi-to-pci-bridge";
+        } else if (devFlags & VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE) {
+            connectStr = "pcie-to-pci-bridge";
         } else if (devFlags & VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS) {
             connectStr = "pci-expander-bus";
         } else if (devFlags & VIR_PCI_CONNECT_TYPE_PCIE_EXPANDER_BUS) {
@@ -316,14 +321,24 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
         bus->minSlot = 0;
         bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
         break;
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
+        /* Same as pci-bridge: 32 hotpluggable traditional PCI slots (0-31),
+         * the first of which is not usable because of the SHPC */
+        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+                      VIR_PCI_CONNECT_TYPE_PCI_DEVICE |
+                      VIR_PCI_CONNECT_TYPE_PCI_BRIDGE);
+        bus->minSlot = 1;
+        bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
+        break;
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
         /* provides one slot which is pcie, can be used by endpoint
-         * devices and pcie-switch-upstream-ports, and is hotpluggable
-         */
-        bus->flags = VIR_PCI_CONNECT_TYPE_PCIE_DEVICE
-           | VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT
-           | VIR_PCI_CONNECT_HOTPLUGGABLE;
+         * devices, pcie-switch-upstream-ports or pcie-to-pci-bridges,
+         * and is hotpluggable */
+        bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE |
+                      VIR_PCI_CONNECT_TYPE_PCIE_DEVICE |
+                      VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT |
+                      VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE);
         bus->minSlot = 0;
         bus->maxSlot = 0;
         break;
diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h
index 87986c2bb7..87248a4fb8 100644
--- a/src/conf/domain_addr.h
+++ b/src/conf/domain_addr.h
@@ -49,6 +49,7 @@ typedef enum {
    VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS = 1 << 8,
    VIR_PCI_CONNECT_TYPE_PCIE_EXPANDER_BUS = 1 << 9,
    VIR_PCI_CONNECT_TYPE_PCI_BRIDGE = 1 << 10,
+   VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE = 1 << 11,
 } virDomainPCIConnectFlags;
 
 /* a combination of all bits that describe the type of connections
@@ -62,7 +63,8 @@ typedef enum {
     VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE | \
     VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS | \
     VIR_PCI_CONNECT_TYPE_PCIE_EXPANDER_BUS | \
-    VIR_PCI_CONNECT_TYPE_PCI_BRIDGE)
+    VIR_PCI_CONNECT_TYPE_PCI_BRIDGE | \
+    VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE)
 
 /* combination of all bits that could be used to connect a normal
  * endpoint device (i.e. excluding the connection possible between an
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ae7c0d9b71..5a55d16d59 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -335,6 +335,7 @@ VIR_ENUM_IMPL(virDomainControllerModelPCI, VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST,
               "pcie-root",
               "pci-bridge",
               "dmi-to-pci-bridge",
+              "pcie-to-pci-bridge",
               "pcie-root-port",
               "pcie-switch-upstream-port",
               "pcie-switch-downstream-port",
@@ -353,6 +354,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName,
               "pxb-pcie",
               "pcie-root-port",
               "spapr-pci-host-bridge",
+              "pcie-pci-bridge",
 );
 
 VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST,
@@ -10188,6 +10190,7 @@ virDomainControllerDefParseXML(virDomainXMLOptionPtr xmlopt,
         }
         case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE:
         case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE:
+        case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT:
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 61379e50fe..b2d2641b05 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -690,6 +690,7 @@ typedef enum {
     VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT,
     VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE,
     VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE,
+    VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE,
     VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT,
     VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT,
     VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT,
@@ -710,6 +711,7 @@ typedef enum {
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE,
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT,
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE,
+    VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE,
 
     VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST
 } virDomainControllerPCIModelName;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 89fd08b642..f1cf1cba5c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2800,6 +2800,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
             break;
         case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE:
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT:
+        case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
             virBufferAsprintf(&buf, "%s,id=%s", modelName, def->info.alias);
             break;
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 580e0f830d..d96475b5c9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4355,6 +4355,8 @@ virDomainControllerPCIModelNameToQEMUCaps(int modelName)
         return QEMU_CAPS_DEVICE_PCIE_ROOT_PORT;
     case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE:
         return QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE;
+    case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE:
+        return QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE;
     case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE:
         return 0;
     case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST:
@@ -4412,6 +4414,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         /* modelName should have been set automatically */
         if (pciopts->modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) {
             virReportControllerMissingOption(cont, model, modelName, "modelName");
@@ -4516,6 +4519,13 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
         }
         break;
 
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
+        if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE) {
+            virReportControllerInvalidValue(cont, model, modelName, "modelName");
+            return -1;
+        }
+        break;
+
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST:
     default:
@@ -4532,6 +4542,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         if (cont->idx == 0) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("Index for '%s' controllers must be > 0"),
@@ -4593,6 +4604,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         if (pciopts->targetIndex != -1) {
             virReportControllerInvalidOption(cont, model, modelName, "targetIndex");
             return -1;
@@ -4626,6 +4638,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         if (pciopts->pcihole64 ||
             pciopts->pcihole64size != 0) {
             virReportControllerInvalidOption(cont, model, modelName, "pcihole64");
@@ -4657,6 +4670,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         if (pciopts->busNr != -1) {
             virReportControllerInvalidOption(cont, model, modelName, "busNr");
             return -1;
@@ -4701,6 +4715,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         if (pciopts->numaNode != -1) {
             virReportControllerInvalidOption(cont, model, modelName, "numaNode");
             return -1;
@@ -4731,6 +4746,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         if (pciopts->chassisNr != -1) {
             virReportControllerInvalidOption(cont, model, modelName, "chassisNr");
             return -1;
@@ -4765,6 +4781,7 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
         if (pciopts->chassis != -1) {
             virReportControllerInvalidOption(cont, model, modelName, "chassis");
             return -1;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 40fb540adc..86d9807908 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2171,6 +2171,9 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont,
     case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE:
         *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I82801B11_BRIDGE;
         break;
+    case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
+        *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE;
+        break;
     case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
         /* Use generic PCIe Root Ports if available, falling back to
          * ioh3420 otherwise */
@@ -2582,6 +2585,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
                 }
                 break;
             case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE:
+            case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE:
             case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT:
             case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
             case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT:
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 06/11] qemu: Implement pcie-to-pci-bridge controller
Posted by John Ferlan 7 years, 1 month ago

On 03/28/2018 10:06 AM, Andrea Bolognani wrote:
> The new controller will not yet be used automatically by
> libvirt, but at this point it's already possible to configure
> a guest to use it.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  docs/formatdomain.html.in      |  3 ++-
>  docs/schemas/domaincommon.rng  |  3 +++
>  src/conf/domain_addr.c         | 25 ++++++++++++++++++++-----
>  src/conf/domain_addr.h         |  4 +++-
>  src/conf/domain_conf.c         |  3 +++
>  src/conf/domain_conf.h         |  2 ++
>  src/qemu/qemu_command.c        |  1 +
>  src/qemu/qemu_domain.c         | 17 +++++++++++++++++
>  src/qemu/qemu_domain_address.c |  4 ++++
>  9 files changed, 55 insertions(+), 7 deletions(-)
> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 299d7b9d42..fa5a0fff8a 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -3942,7 +3942,8 @@
>        <code>pcie-root-port</code>, <code>pcie-switch-upstream-port</code> and
>        <code>pcie-switch-downstream-port</code> (<span class="since">since
>        1.2.19</span>), <code>pci-expander-bus</code> and
> -      <code>pcie-expander-bus</code> (<span class="since">since 1.3.4</span>).
> +      <code>pcie-expander-bus</code> (<span class="since">since 1.3.4</span>),
> +      <code>pcie-to-pci-bridge</code> (<span class="since">since 4.3.0</span>).
>        The root controllers (<code>pci-root</code>
>        and <code>pcie-root</code>) have an
>        optional <code>pcihole64</code> element specifying how big (in

Considering my patch 1 comments, there will be obvious adjustments here.

Is there something else perhaps a few paragraphs later that could be
added to say what this is and how/when/why someone should want to use
it? Including the restriction about slot=0 (whatever the FLA SHPC is)...
Similar to dmi-to-pci-bridge... Perhaps something that would already be
there considering my patch 1 comment for a description field or some
sort of relationship matrix...

With a few more words...

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 06/11] qemu: Implement pcie-to-pci-bridge controller
Posted by Andrea Bolognani 7 years, 1 month ago
On Tue, 2018-04-03 at 19:13 -0400, John Ferlan wrote:
> Is there something else perhaps a few paragraphs later that could be
> added to say what this is and how/when/why someone should want to use
> it? Including the restriction about slot=0 (whatever the FLA SHPC is)...
> Similar to dmi-to-pci-bridge... Perhaps something that would already be
> there considering my patch 1 comment for a description field or some
> sort of relationship matrix...

Yeah, I realized today that there's some documentation for the
existing behavior of adding a dmi-to-pci-bridge that will need to
tweaked in this patch to address the changes... Once that's been
taken care of, I don't think there will be much to add, though.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 06/11] qemu: Implement pcie-to-pci-bridge controller
Posted by Andrea Bolognani 7 years, 1 month ago
On Wed, 2018-04-04 at 10:58 +0200, Andrea Bolognani wrote:
> On Tue, 2018-04-03 at 19:13 -0400, John Ferlan wrote:
> > Is there something else perhaps a few paragraphs later that could be
> > added to say what this is and how/when/why someone should want to use
> > it? Including the restriction about slot=0 (whatever the FLA SHPC is)...
> > Similar to dmi-to-pci-bridge... Perhaps something that would already be
> > there considering my patch 1 comment for a description field or some
> > sort of relationship matrix...
> 
> Yeah, I realized today that there's some documentation for the
> existing behavior of adding a dmi-to-pci-bridge that will need to
> tweaked in this patch to address the changes... Once that's been
> taken care of, I don't think there will be much to add, though.

I've come up with the diff below, which I plan to squash in patch
8/11, when the change in behavior it documents is implemented. I
have also converted the list of models to a <ul>, as agreed upon in
the review for patch 1/11.

Since patch 3/11 is really just an independent cleanup which doesn't
need to hold up the new feature, I plan to go ahead and push the
rest of the series (with the changes described above) later today.
Is that okay with you, or would you rather see a full v2 posted on
the list?


diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 84059737d5..a5a83f56c3 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4114,10 +4114,14 @@
       devices (although libvirt will never auto-assign a PCI device to
       a PCIe slot, it will allow manual specification of such an
       assignment). Devices connected to pcie-root cannot be
-      hotplugged. In order to make standard PCI slots available on a
-      system which has a pcie-root controller, a pci controller
-      with <code>model='dmi-to-pci-bridge'</code> is automatically
-      added, usually at the defacto standard location of slot=0x1e. A
+      hotplugged. If traditional PCI devices are present in the guest
+      configuration, a <code>pcie-to-pci-bridge</code> controller will
+      automatically be added: this controller, which plugs into a
+      <code>pcie-root-port</code>, provides 31 usable PCI slots (1-31) with
+      hotplug support (<span class="since">since 4.3.0</span>). If the QEMU
+      binary doesn't support the corresponding device, then a
+      <code>dmi-to-pci-bridge</code> controller will be added instead,
+      usually at the defacto standard location of slot=0x1e. A
       dmi-to-pci-bridge controller plugs into a PCIe slot (as provided
       by pcie-root), and itself provides 31 standard PCI slots (which
       also do not support device hotplug). In order to have
-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 06/11] qemu: Implement pcie-to-pci-bridge controller
Posted by John Ferlan 7 years, 1 month ago

On 04/06/2018 04:15 AM, Andrea Bolognani wrote:
> On Wed, 2018-04-04 at 10:58 +0200, Andrea Bolognani wrote:
>> On Tue, 2018-04-03 at 19:13 -0400, John Ferlan wrote:
>>> Is there something else perhaps a few paragraphs later that could be
>>> added to say what this is and how/when/why someone should want to use
>>> it? Including the restriction about slot=0 (whatever the FLA SHPC is)...
>>> Similar to dmi-to-pci-bridge... Perhaps something that would already be
>>> there considering my patch 1 comment for a description field or some
>>> sort of relationship matrix...
>>
>> Yeah, I realized today that there's some documentation for the
>> existing behavior of adding a dmi-to-pci-bridge that will need to
>> tweaked in this patch to address the changes... Once that's been
>> taken care of, I don't think there will be much to add, though.
> 
> I've come up with the diff below, which I plan to squash in patch
> 8/11, when the change in behavior it documents is implemented. I
> have also converted the list of models to a <ul>, as agreed upon in
> the review for patch 1/11.
> 
> Since patch 3/11 is really just an independent cleanup which doesn't
> need to hold up the new feature, I plan to go ahead and push the
> rest of the series (with the changes described above) later today.
> Is that okay with you, or would you rather see a full v2 posted on
> the list?
> 

Your plan is fine by me.

John

> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 84059737d5..a5a83f56c3 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -4114,10 +4114,14 @@
>        devices (although libvirt will never auto-assign a PCI device to
>        a PCIe slot, it will allow manual specification of such an
>        assignment). Devices connected to pcie-root cannot be
> -      hotplugged. In order to make standard PCI slots available on a
> -      system which has a pcie-root controller, a pci controller
> -      with <code>model='dmi-to-pci-bridge'</code> is automatically
> -      added, usually at the defacto standard location of slot=0x1e. A
> +      hotplugged. If traditional PCI devices are present in the guest
> +      configuration, a <code>pcie-to-pci-bridge</code> controller will
> +      automatically be added: this controller, which plugs into a
> +      <code>pcie-root-port</code>, provides 31 usable PCI slots (1-31) with
> +      hotplug support (<span class="since">since 4.3.0</span>). If the QEMU
> +      binary doesn't support the corresponding device, then a
> +      <code>dmi-to-pci-bridge</code> controller will be added instead,
> +      usually at the defacto standard location of slot=0x1e. A
>        dmi-to-pci-bridge controller plugs into a PCIe slot (as provided
>        by pcie-root), and itself provides 31 standard PCI slots (which
>        also do not support device hotplug). In order to have
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list