[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 10/12] pnv/xive: Deduce the PnvXive pointer from XiveTCTX:
From: |
David Gibson |
Subject: |
Re: [PATCH v3 10/12] pnv/xive: Deduce the PnvXive pointer from XiveTCTX::xptr |
Date: |
Tue, 7 Jan 2020 11:16:31 +1100 |
On Mon, Jan 06, 2020 at 03:56:43PM +0100, Cédric Le Goater wrote:
> From: Greg Kurz <address@hidden>
>
> And use it instead of reaching out to the machine. This allows to get
> rid of pnv_get_chip().
>
> Signed-off-by: Greg Kurz <address@hidden>
> Signed-off-by: Cédric Le Goater <address@hidden>
6..10 applied to ppc-for-5.0.
> ---
> include/hw/ppc/pnv.h | 2 --
> hw/intc/pnv_xive.c | 8 ++------
> hw/ppc/pnv.c | 14 --------------
> 3 files changed, 2 insertions(+), 22 deletions(-)
>
> diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
> index 2504d8cd4f6b..d65dd32036c8 100644
> --- a/include/hw/ppc/pnv.h
> +++ b/include/hw/ppc/pnv.h
> @@ -219,8 +219,6 @@ struct PnvMachineState {
> PnvPnor *pnor;
> };
>
> -PnvChip *pnv_get_chip(uint32_t chip_id);
> -
> #define PNV_FDT_ADDR 0x01000000
> #define PNV_TIMEBASE_FREQ 512000000ULL
>
> diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
> index 6412cf222eae..715fca61ae22 100644
> --- a/hw/intc/pnv_xive.c
> +++ b/hw/intc/pnv_xive.c
> @@ -472,12 +472,8 @@ static uint8_t pnv_xive_get_block_id(XiveRouter *xrtr)
> static PnvXive *pnv_xive_tm_get_xive(PowerPCCPU *cpu)
> {
> int pir = ppc_cpu_pir(cpu);
> - PnvChip *chip;
> - PnvXive *xive;
> -
> - chip = pnv_get_chip(PNV9_PIR2CHIP(pir));
> - assert(chip);
> - xive = &PNV9_CHIP(chip)->xive;
> + XivePresenter *xptr = XIVE_TCTX(pnv_cpu_state(cpu)->intc)->xptr;
> + PnvXive *xive = PNV_XIVE(xptr);
>
> if (!pnv_xive_is_cpu_enabled(xive, cpu)) {
> xive_error(xive, "IC: CPU %x is not enabled", pir);
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index de44c7ddb304..924b8dc592fe 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -1705,20 +1705,6 @@ static int pnv_match_nvt(XiveFabric *xfb, uint8_t
> format,
> return total_count;
> }
>
> -PnvChip *pnv_get_chip(uint32_t chip_id)
> -{
> - PnvMachineState *pnv = PNV_MACHINE(qdev_get_machine());
> - int i;
> -
> - for (i = 0; i < pnv->num_chips; i++) {
> - PnvChip *chip = pnv->chips[i];
> - if (chip->chip_id == chip_id) {
> - return chip;
> - }
> - }
> - return NULL;
> -}
> -
> static void pnv_get_num_chips(Object *obj, Visitor *v, const char *name,
> void *opaque, Error **errp)
> {
--
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
- [PATCH v3 02/12] ppc/pnv: Introduce a "xics" property under the POWER8 chip, (continued)
- [PATCH v3 02/12] ppc/pnv: Introduce a "xics" property under the POWER8 chip, Cédric Le Goater, 2020/01/06
- [PATCH v3 03/12] pnv/xive: Use device_class_set_parent_realize(), Cédric Le Goater, 2020/01/06
- [PATCH v3 04/12] spapr, pnv, xive: Add a "xive-fabric" link to the XIVE router, Cédric Le Goater, 2020/01/06
- [PATCH v3 05/12] xive: Use the XIVE fabric link under the XIVE router, Cédric Le Goater, 2020/01/06
- [PATCH v3 06/12] ppc/pnv: Add an "nr-threads" property to the base chip class, Cédric Le Goater, 2020/01/06
- [PATCH v3 07/12] ppc/pnv: Add a "pnor" const link property to the BMC internal simulator, Cédric Le Goater, 2020/01/06
- [PATCH v3 08/12] xive: Add a "presenter" link property to the TCTX object, Cédric Le Goater, 2020/01/06
- [PATCH v3 09/12] spapr/xive: Deduce the SpaprXive pointer from XiveTCTX::xptr, Cédric Le Goater, 2020/01/06
- [PATCH v3 10/12] pnv/xive: Deduce the PnvXive pointer from XiveTCTX::xptr, Cédric Le Goater, 2020/01/06
- Re: [PATCH v3 10/12] pnv/xive: Deduce the PnvXive pointer from XiveTCTX::xptr,
David Gibson <=
- [PATCH v3 11/12] pnv/psi: Add device reset hook, Cédric Le Goater, 2020/01/06
- [PATCH v3 12/12] pnv/psi: Consolidate some duplicated code in pnv_psi_realize(), Cédric Le Goater, 2020/01/06