|
|
6ae9ed |
From 093fe7d6bde7f224200e7f2877949f3196002bd7 Mon Sep 17 00:00:00 2001
|
|
|
6ae9ed |
Message-Id: <093fe7d6bde7f224200e7f2877949f3196002bd7@dist-git>
|
|
|
6ae9ed |
From: Laine Stump <laine@laine.org>
|
|
|
6ae9ed |
Date: Wed, 10 Aug 2016 11:00:12 -0400
|
|
|
6ae9ed |
Subject: [PATCH] conf: don't allow connecting upstream-port directly to
|
|
|
6ae9ed |
pce-expander-bus
|
|
|
6ae9ed |
|
|
|
6ae9ed |
I apparently misunderstood Marcel's description of what could and
|
|
|
6ae9ed |
couldn't be plugged into qemu's pxb-pcie controller (known as
|
|
|
6ae9ed |
pcie-expander-bus in libvirt) - I specifically allowed directly
|
|
|
6ae9ed |
connecting a pcie-switch-upstream-port, and it turns out that causes
|
|
|
6ae9ed |
the guest kernel to crash.
|
|
|
6ae9ed |
|
|
|
6ae9ed |
This patch forbids such a connection, and updates the xml docs
|
|
|
6ae9ed |
appropriately.
|
|
|
6ae9ed |
|
|
|
6ae9ed |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1361172
|
|
|
6ae9ed |
(cherry picked from commit b70e54342bbd1756234e07ed6b22bdd3cd12b689)
|
|
|
6ae9ed |
---
|
|
|
6ae9ed |
docs/formatdomain.html.in | 20 +++++++++++---------
|
|
|
6ae9ed |
src/conf/domain_addr.c | 7 ++-----
|
|
|
6ae9ed |
2 files changed, 13 insertions(+), 14 deletions(-)
|
|
|
6ae9ed |
|
|
|
6ae9ed |
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
|
|
|
6ae9ed |
index c2e261d..b74057f 100644
|
|
|
6ae9ed |
--- a/docs/formatdomain.html.in
|
|
|
6ae9ed |
+++ b/docs/formatdomain.html.in
|
|
|
6ae9ed |
@@ -3333,15 +3333,17 @@
|
|
|
6ae9ed |
2nd bus-number is just being reserved for the pcie-root-port
|
|
|
6ae9ed |
that must necessarily be connected to the bus in order to
|
|
|
6ae9ed |
actually plug in an endpoint device. If you intend to plug
|
|
|
6ae9ed |
- multiple devices into a pcie-expander-bus, you must instead
|
|
|
6ae9ed |
- connect a pcie-switch-upstream-port to the
|
|
|
6ae9ed |
- pcie-expander-bus, and multiple pcie-switch-downstream-ports
|
|
|
6ae9ed |
- to the pcie-switch-downstream-port, and of course for this
|
|
|
6ae9ed |
- to work properly, you will need to decrease the
|
|
|
6ae9ed |
- pcie-expander-bus' busNr accordingly so that there are
|
|
|
6ae9ed |
- enough unused bus numbers above it to accomodate giving out
|
|
|
6ae9ed |
- one bus number for the upstream-port and one for each
|
|
|
6ae9ed |
- downstream-port).
|
|
|
6ae9ed |
+ multiple devices into a pcie-expander-bus, you must connect
|
|
|
6ae9ed |
+ a pcie-switch-upstream-port to the pcie-root-port that is
|
|
|
6ae9ed |
+ plugged into the pcie-expander-bus, and multiple
|
|
|
6ae9ed |
+ pcie-switch-downstream-ports to the
|
|
|
6ae9ed |
+ pcie-switch-upstream-port, and of course for this to work
|
|
|
6ae9ed |
+ properly, you will need to decrease the pcie-expander-bus'
|
|
|
6ae9ed |
+ busNr accordingly so that there are enough unused bus
|
|
|
6ae9ed |
+ numbers above it to accomodate giving out one bus number for
|
|
|
6ae9ed |
+ the upstream-port and one for each downstream-port (in
|
|
|
6ae9ed |
+ addition to the pcie-root-port and the pcie-expander-bus
|
|
|
6ae9ed |
+ itself).
|
|
|
6ae9ed |
|
|
|
6ae9ed |
|
|
|
6ae9ed |
node
|
|
|
6ae9ed |
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
|
|
|
6ae9ed |
index 61c4074..c22329d 100644
|
|
|
6ae9ed |
--- a/src/conf/domain_addr.c
|
|
|
6ae9ed |
+++ b/src/conf/domain_addr.c
|
|
|
6ae9ed |
@@ -291,11 +291,8 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
|
|
|
6ae9ed |
bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST;
|
|
|
6ae9ed |
break;
|
|
|
6ae9ed |
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
|
|
|
6ae9ed |
- /* single slot, no hotplug, only accepts pcie-root-port or
|
|
|
6ae9ed |
- * pcie-switch-upstream-port.
|
|
|
6ae9ed |
- */
|
|
|
6ae9ed |
- bus->flags = (VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT
|
|
|
6ae9ed |
- | VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT);
|
|
|
6ae9ed |
+ /* single slot, no hotplug, only accepts pcie-root-port */
|
|
|
6ae9ed |
+ bus->flags = VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT;
|
|
|
6ae9ed |
bus->minSlot = 0;
|
|
|
6ae9ed |
bus->maxSlot = 0;
|
|
|
6ae9ed |
break;
|
|
|
6ae9ed |
--
|
|
|
6ae9ed |
2.9.2
|
|
|
6ae9ed |
|