[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [for-2.11 PATCH 22/26] spapr_pci: provide node start offs
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [for-2.11 PATCH 22/26] spapr_pci: provide node start offset via spapr_populate_pci_dt() |
Date: |
Fri, 28 Jul 2017 13:52:42 +1000 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Tue, Jul 25, 2017 at 08:02:41PM +0200, Greg Kurz wrote:
> 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>
Blech. The patch is correct and you can't do much better at the
moment. I really hope in the next cycle I get a chance to do a bunch
of the DT construction cleanups which should avoid this messy passing
of dt offsets around.
> ---
> Changes since RFC:
> - rebased against ppc-for-2.10
> ---
> hw/ppc/spapr.c | 2 +-
> hw/ppc/spapr_pci.c | 6 +++++-
> include/hw/pci-host/spapr.h | 3 ++-
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 632040f35ecc..1a6cd4efeb97 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1098,7 +1098,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr,
> }
>
> QLIST_FOREACH(phb, &spapr->phbs, list) {
> - ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt);
> + ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt, 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 b73e099e0285..79f10ff453d0 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -2109,7 +2109,8 @@ static void spapr_phb_pci_enumerate(sPAPRPHBState *phb)
>
> int spapr_populate_pci_dt(sPAPRPHBState *phb,
> uint32_t xics_phandle,
> - void *fdt)
> + void *fdt,
> + int *node_offset)
> {
> int bus_off, i, j, ret;
> char nodename[FDT_NAME_MAX];
> @@ -2166,6 +2167,9 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
> if (bus_off < 0) {
> return bus_off;
> }
> + 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 31bae68167f2..7837fb0b1110 100644
> --- a/include/hw/pci-host/spapr.h
> +++ b/include/hw/pci-host/spapr.h
> @@ -115,7 +115,8 @@ 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);
> + void *fdt,
> + int *node_offset);
>
> void spapr_pci_rtas_init(void);
>
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [Qemu-ppc] [for-2.11 PATCH 18/26] spapr: create DR connectors for PHBs, (continued)
- [Qemu-ppc] [for-2.11 PATCH 19/26] spapr: populate PHB DRC entries for root DT node, Greg Kurz, 2017/07/25
- [Qemu-ppc] [for-2.11 PATCH 20/26] spapr_events: add support for phb hotplug events, Greg Kurz, 2017/07/25
- [Qemu-ppc] [for-2.11 PATCH 21/26] qdev: pass an Object * to qbus_set_hotplug_handler(), Greg Kurz, 2017/07/25
- [Qemu-ppc] [for-2.11 PATCH 22/26] spapr_pci: provide node start offset via spapr_populate_pci_dt(), Greg Kurz, 2017/07/25
- Re: [Qemu-ppc] [for-2.11 PATCH 22/26] spapr_pci: provide node start offset via spapr_populate_pci_dt(),
David Gibson <=
- [Qemu-ppc] [for-2.11 PATCH 23/26] spapr_pci: add ibm, my-drc-index property for PHB hotplug, Greg Kurz, 2017/07/25
- [Qemu-ppc] [for-2.11 PATCH 24/26] spapr: allow guest to update the XICS phandle, Greg Kurz, 2017/07/25
[Qemu-ppc] [for-2.11 PATCH 25/26] spapr_pci: drop abusive sanity check when migrating the LSI table, Greg Kurz, 2017/07/25
Re: [Qemu-ppc] [Qemu-devel] [for-2.11 PATCH 00/26] spapr: add support for PHB hotplug, Alexey Kardashevskiy, 2017/07/25