[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 12/15] spapr_pci: provide node start offset via spapr_
From: |
Greg Kurz |
Subject: |
[Qemu-ppc] [PATCH 12/15] spapr_pci: provide node start offset via spapr_populate_pci_dt() |
Date: |
Fri, 21 Dec 2018 01:38:38 +0100 |
User-agent: |
StGit/unknown-version |
From: Michael Roth <address@hidden>
PHB hotplug re-uses PHB device tree generation code and passes
it to a guest via RTAS. Doing this requires knowledge of where
exactly in the device tree the node describing the PHB begins.
Provide this via a new optional pointer that can be used to
store the PHB node's start offset.
Signed-off-by: Michael Roth <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
---
hw/ppc/spapr.c | 2 +-
hw/ppc/spapr_pci.c | 5 ++++-
include/hw/pci-host/spapr.h | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 4f9d11b14666..5c405a5fafca 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1297,7 +1297,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr,
QLIST_FOREACH(phb, &spapr->phbs, list) {
ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt,
- spapr->irq->nr_msis);
+ spapr->irq->nr_msis, NULL);
if (ret < 0) {
error_report("couldn't setup PCI devices in fdt");
exit(1);
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 292dd95cbef9..5e7b40a8c910 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -2140,7 +2140,7 @@ static void spapr_phb_pci_enumerate(sPAPRPHBState *phb)
}
int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt,
- uint32_t nr_msis)
+ uint32_t nr_msis, int *node_offset)
{
int bus_off, i, j, ret;
gchar *nodename;
@@ -2195,6 +2195,9 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t
xics_phandle, void *fdt,
nodename = g_strdup_printf("address@hidden" PRIx64, phb->buid);
_FDT(bus_off = fdt_add_subnode(fdt, 0, nodename));
g_free(nodename);
+ if (node_offset) {
+ *node_offset = bus_off;
+ }
/* Write PHB properties */
_FDT(fdt_setprop_string(fdt, bus_off, "device_type", "pci"));
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 83d5075a6ef3..6ef8f141ea92 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -114,7 +114,7 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct
sPAPRPHBState *phb, int pin)
}
int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt,
- uint32_t nr_msis);
+ uint32_t nr_msis, int *node_offset);
void spapr_pci_rtas_init(void);
- [Qemu-ppc] [PATCH 04/15] spapr_pci: add proper rollback on PHB realize error path, (continued)
- [Qemu-ppc] [PATCH 04/15] spapr_pci: add proper rollback on PHB realize error path, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 05/15] spapr_pci: add PHB unrealize, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 06/15] spapr: enable PHB hotplug for default pseries machine type, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 07/15] spapr_pci: Define SPAPR_MAX_PHBS in hw/pci-host/spapr.h, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 08/15] spapr: create DR connectors for PHBs, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 09/15] spapr: populate PHB DRC entries for root DT node, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 10/15] spapr_events: add support for phb hotplug events, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 11/15] qdev: pass an Object * to qbus_set_hotplug_handler(), Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 12/15] spapr_pci: provide node start offset via spapr_populate_pci_dt(),
Greg Kurz <=
- [Qemu-ppc] [PATCH 13/15] spapr_pci: add ibm, my-drc-index property for PHB hotplug, Greg Kurz, 2018/12/20
- [Qemu-ppc] [PATCH 14/15] spapr: Expose the name of the interrupt controller node, Greg Kurz, 2018/12/21
- [Qemu-ppc] [PATCH 15/15] spapr: add hotplug hooks for PHB hotplug, Greg Kurz, 2018/12/21