From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3Oca-0002QE-U6 for qemu-devel@nongnu.org; Tue, 23 Dec 2014 07:31:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3OcO-00055S-Lb for qemu-devel@nongnu.org; Tue, 23 Dec 2014 07:31:28 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:45882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3OcO-00055H-FG for qemu-devel@nongnu.org; Tue, 23 Dec 2014 07:31:16 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Dec 2014 07:31:15 -0500 From: Michael Roth Date: Tue, 23 Dec 2014 06:30:28 -0600 Message-Id: <1419337831-16552-15-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1419337831-16552-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1419337831-16552-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v4 14/17] spapr_pci: populate DRC dt entries for PHBs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, agraf@suse.de, ncmike@ncultra.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, bharata.rao@gmail.com, nfont@linux.vnet.ibm.com Reserve 32 entries of type PCI in each PHB's initial FDT. This advertises to guests that each PHB is DR-capable device with physical hotpluggable slots. This is necessary for allowing hotplugging of devices to it later via bus rescan or guest rpaphp hotplug module. Signed-off-by: Michael Roth --- hw/ppc/spapr_pci.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 73e86a4..a5d7791 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -47,6 +47,8 @@ #define RTAS_TYPE_MSI 1 #define RTAS_TYPE_MSIX 2 +#define FDT_MAX_SIZE 0x10000 + #include "hw/ppc/spapr_drc.h" static sPAPRPHBState *find_phb(sPAPREnvironment *spapr, uint64_t buid) @@ -872,7 +874,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt) { - int bus_off, i, j; + int bus_off, i, j, ret; char nodename[256]; uint32_t bus_range[] = { cpu_to_be32(0), cpu_to_be32(0xff) }; struct { @@ -951,6 +953,11 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, object_child_foreach(OBJECT(phb), spapr_phb_children_dt, &((sPAPRTCEDT){ .fdt = fdt, .node_off = bus_off })); + ret = spapr_drc_populate_dt(fdt, bus_off, SPAPR_DR_CONNECTOR_TYPE_PCI); + if (ret) { + return ret; + } + return 0; } -- 1.9.1