qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, nfont@linux.vnet.ibm.com,
	bharata@linux.vnet.ibm.com, qemu-ppc@nongnu.org,
	david@gibson.dropbear.id.au
Subject: [Qemu-devel] [RFC PATCH 06/15] spapr_pci: also use 'index' property as DRC index for PHBs
Date: Wed, 29 Apr 2015 14:20:15 -0500	[thread overview]
Message-ID: <1430335224-6716-7-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1430335224-6716-1-git-send-email-mdroth@linux.vnet.ibm.com>

Prior to this patch 'index' is purely a shorthand for specifying
MMIO windows, BUIDs, and other configuration values for a PHB.

With the addition of PHB hotplug, we have a static number of DRCs
that can be used to handle hotplug/unplug operations on our PHBs,
and need a consistent way to map PHBs to these connectors, and
assign a unique identifiers for the connectors.

BUIDs would be a good choice, however, those are 64-bit values,
whereas DRC indexes are 32-bit.

'index' serves this purpose nicely, and also allows us to align
the maximum number PHBs that can be plugged with the maximum
'index' value we allow (255).

This means that when PHB hotplug is enabled (2.4+), 'index' is
now always a required value, regardless of whether or not other
configuration properties are specified explicitly. We could
potentially arrange for 'index'-less PHBs to be added in an
'unpluggable' fashion via command-line, and have checks to
generate an error when hotplugged via device_add, but the simpler
path seems to be to just make it required now.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/ppc/spapr_pci.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 25a738c..e37de28 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1156,8 +1156,14 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
         if ((sphb->buid != (uint64_t)-1) || (sphb->dma_liobn != (uint32_t)-1)
             || (sphb->mem_win_addr != (hwaddr)-1)
             || (sphb->io_win_addr != (hwaddr)-1)) {
-            error_setg(errp, "Either \"index\" or other parameters must"
-                       " be specified for PAPR PHB, not both");
+            if (!spapr->dr_phb_enabled) {
+                /* if they aren't potentially using index as an identifier for
+                 * the PHB's DR connector, enforce the old semantics of index
+                 * being purely a shorthand for PHB configuration options.
+                 */
+                error_setg(errp, "Either \"index\" or other parameters must"
+                           " be specified for PAPR PHB, not both");
+            }
             return;
         }
 
@@ -1174,6 +1180,14 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
             + sphb->index * SPAPR_PCI_WINDOW_SPACING;
         sphb->mem_win_addr = windows_base + SPAPR_PCI_MMIO_WIN_OFF;
         sphb->io_win_addr = windows_base + SPAPR_PCI_IO_WIN_OFF;
+    } else {
+        if (spapr->dr_phb_enabled) {
+            error_setg(errp, "The \"index\" property is required for machine"
+                       " types that support PHB hotplug (and in such cases"
+                       " can be used alongside \"buid\" and other"
+                       " configuration properties)");
+            return;
+        }
     }
 
     if (sphb->buid == (uint64_t)-1) {
-- 
1.9.1

  parent reply	other threads:[~2015-04-29 19:21 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 19:20 [Qemu-devel] [RFC PATCH 00/15] spapr: add support for PHB hotplug Michael Roth
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 01/15] pci: allow cleanup/unregistration of PCI buses Michael Roth
2015-05-05  7:56   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 02/15] qdev: store DeviceState's canonical path to use when unparenting Michael Roth
2015-04-30 13:35   ` Paolo Bonzini
2015-04-30 23:03     ` Michael Roth
2015-05-01 20:43       ` Paolo Bonzini
2015-05-01 22:54         ` Michael Roth
2015-05-04  9:35           ` Paolo Bonzini
2015-05-05 15:48             ` Michael Roth
2015-05-19  9:41               ` Paolo Bonzini
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 03/15] spapr_drc: pass object ownership to parent/owner Michael Roth
2015-04-30 14:00   ` Paolo Bonzini
2015-05-05  9:57   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 04/15] spapr_iommu: " Michael Roth
2015-04-30 14:00   ` Paolo Bonzini
2015-05-05  9:58   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 05/15] spapr_pci: add PHB unrealize Michael Roth
2015-04-30 14:05   ` Paolo Bonzini
2015-05-01  1:18     ` Michael Roth
2015-05-04  9:29       ` Paolo Bonzini
2015-04-29 19:20 ` Michael Roth [this message]
2015-05-05 11:34   ` [Qemu-devel] [RFC PATCH 06/15] spapr_pci: also use 'index' property as DRC index for PHBs David Gibson
2015-05-05 15:54     ` Michael Roth
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 07/15] spapr: enable PHB hotplug for pseries-2.4 Michael Roth
2015-05-05 11:35   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 08/15] spapr: create DR connectors for PHBs and register reset hooks Michael Roth
2015-04-30 14:08   ` Paolo Bonzini
2015-05-01  1:25     ` Michael Roth
2015-05-05 11:37   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 09/15] spapr: populate PHB DRC entries for root DT node Michael Roth
2015-05-05 11:39   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 10/15] spapr_events: add support for phb hotplug events Michael Roth
2015-05-05 11:39   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 11/15] qdev: add qbus_set_hotplug_handler_generic() Michael Roth
2015-04-30 14:09   ` Paolo Bonzini
2015-05-05 11:42   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 12/15] spapr: stub implementation of machine-level HotplugHandler interface Michael Roth
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 13/15] spapr_pci: provide node start offset via spapr_populate_pci_dt() Michael Roth
2015-05-05 11:44   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 14/15] spapr_pci: add ibm, my-drc-index property for PHB hotplug Michael Roth
2015-05-05 11:44   ` David Gibson
2015-04-29 19:20 ` [Qemu-devel] [RFC PATCH 15/15] spapr: add hotplug hooks " Michael Roth
2015-05-05 11:46   ` David Gibson
2015-04-30 14:10 ` [Qemu-devel] [RFC PATCH 00/15] spapr: add support " Paolo Bonzini
2015-05-01  1:27   ` Michael Roth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430335224-6716-7-git-send-email-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).