[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [for-2.11 PATCH 01/26] spapr: move spapr_cre
From: |
Alexey Kardashevskiy |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [for-2.11 PATCH 01/26] spapr: move spapr_create_phb() to core machine code |
Date: |
Wed, 26 Jul 2017 13:32:41 +1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 26/07/17 03:58, Greg Kurz wrote:
> This function is only used when creating the default PHB. Let's rename
> it and move it to the core machine code for clarity.
>
> Signed-off-by: Greg Kurz <address@hidden>
> ---
> hw/ppc/spapr.c | 13 ++++++++++++-
> hw/ppc/spapr_pci.c | 11 -----------
> include/hw/pci-host/spapr.h | 2 --
> 3 files changed, 12 insertions(+), 14 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 2a3e53d5d58c..53969315ac24 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2142,6 +2142,17 @@ static void spapr_init_cpus(sPAPRMachineState *spapr)
> g_free(type);
> }
>
> +static PCIHostState *spapr_create_default_phb(sPAPRMachineState *spapr)
Nit: you could get rid of the *spapr here.
Anyway,
Reviewed-by: Alexey Kardashevskiy <address@hidden>
> +{
> + DeviceState *dev;
> +
> + dev = qdev_create(NULL, TYPE_SPAPR_PCI_HOST_BRIDGE);
> + qdev_prop_set_uint32(dev, "index", 0);
> + qdev_init_nofail(dev);
> +
> + return PCI_HOST_BRIDGE(dev);
> +}
> +
> /* pSeries LPAR / sPAPR hardware init */
> static void ppc_spapr_init(MachineState *machine)
> {
> @@ -2374,7 +2385,7 @@ static void ppc_spapr_init(MachineState *machine)
> /* Set up PCI */
> spapr_pci_rtas_init();
>
> - phb = spapr_create_phb(spapr, 0);
> + phb = spapr_create_default_phb(spapr);
>
> for (i = 0; i < nb_nics; i++) {
> NICInfo *nd = &nd_table[i];
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index d84abf1070a0..70a99a032267 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -1982,17 +1982,6 @@ static const TypeInfo spapr_phb_info = {
> }
> };
>
> -PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index)
> -{
> - DeviceState *dev;
> -
> - dev = qdev_create(NULL, TYPE_SPAPR_PCI_HOST_BRIDGE);
> - qdev_prop_set_uint32(dev, "index", index);
> - qdev_init_nofail(dev);
> -
> - return PCI_HOST_BRIDGE(dev);
> -}
> -
> typedef struct sPAPRFDT {
> void *fdt;
> int node_off;
> diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
> index 38470b2f0e5c..5a4e9686d562 100644
> --- a/include/hw/pci-host/spapr.h
> +++ b/include/hw/pci-host/spapr.h
> @@ -111,8 +111,6 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct
> sPAPRPHBState *phb, int pin)
> return xics_get_qirq(XICS_FABRIC(spapr), phb->lsi_table[pin].irq);
> }
>
> -PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index);
> -
> int spapr_populate_pci_dt(sPAPRPHBState *phb,
> uint32_t xics_phandle,
> void *fdt);
>
>
--
Alexey