[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/31] ppc/pnv: remove stack pointer from PnvPHB4
From: |
Cédric Le Goater |
Subject: |
[PULL 23/31] ppc/pnv: remove stack pointer from PnvPHB4 |
Date: |
Tue, 18 Jan 2022 14:07:22 +0100 |
From: Daniel Henrique Barboza <danielhb413@gmail.com>
This pointer was being used for two reasons: pnv_phb4_update_regions()
was using it to access the PHB and phb4_realize() was using it as a way
to determine if the PHB was user created.
We can determine if the PHB is user created via phb->pec, introduced in
the previous patch, and pnv_phb4_update_regions() is no longer using
stack->phb.
Remove the pointer from the PnvPHB4 device.
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220114180719.52117-4-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/pci-host/pnv_phb4.h | 2 --
hw/pci-host/pnv_phb4.c | 15 ++++-----------
hw/pci-host/pnv_phb4_pec.c | 2 --
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
index 1d27e4c0cb74..a9059b72793d 100644
--- a/include/hw/pci-host/pnv_phb4.h
+++ b/include/hw/pci-host/pnv_phb4.h
@@ -151,8 +151,6 @@ struct PnvPHB4 {
XiveSource xsrc;
qemu_irq *qirqs;
- PnvPhb4PecStack *stack;
-
QLIST_HEAD(, PnvPhb4DMASpace) dma_spaces;
};
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index 4933fe57fe48..2efd34518e7f 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -1573,9 +1573,10 @@ static void pnv_phb4_realize(DeviceState *dev, Error
**errp)
char name[32];
/* User created PHB */
- if (!phb->stack) {
+ if (!phb->pec) {
PnvMachineState *pnv = PNV_MACHINE(qdev_get_machine());
PnvChip *chip = pnv_get_chip(pnv, phb->chip_id);
+ PnvPhb4PecStack *stack;
PnvPhb4PecClass *pecc;
BusState *s;
@@ -1584,7 +1585,7 @@ static void pnv_phb4_realize(DeviceState *dev, Error
**errp)
return;
}
- phb->stack = pnv_phb4_get_stack(chip, phb, &local_err);
+ stack = pnv_phb4_get_stack(chip, phb, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1594,18 +1595,12 @@ static void pnv_phb4_realize(DeviceState *dev, Error
**errp)
* All other phb properties but 'pec' ad 'version' are
* already set.
*/
- object_property_set_link(OBJECT(phb), "pec", OBJECT(phb->stack->pec),
+ object_property_set_link(OBJECT(phb), "pec", OBJECT(stack->pec),
&error_abort);
pecc = PNV_PHB4_PEC_GET_CLASS(phb->pec);
object_property_set_int(OBJECT(phb), "version", pecc->version,
&error_fatal);
- /*
- * Assign stack->phb since pnv_phb4_update_regions() uses it
- * to access the phb.
- */
- phb->stack->phb = phb;
-
/*
* Reparent user created devices to the chip to build
* correctly the device tree.
@@ -1707,8 +1702,6 @@ static Property pnv_phb4_properties[] = {
DEFINE_PROP_UINT32("index", PnvPHB4, phb_id, 0),
DEFINE_PROP_UINT32("chip-id", PnvPHB4, chip_id, 0),
DEFINE_PROP_UINT64("version", PnvPHB4, version, 0),
- DEFINE_PROP_LINK("stack", PnvPHB4, stack, TYPE_PNV_PHB4_PEC_STACK,
- PnvPhb4PecStack *),
DEFINE_PROP_LINK("pec", PnvPHB4, pec, TYPE_PNV_PHB4_PEC,
PnvPhb4PecState *),
DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index 22194b8de2ff..ed1d6441821a 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -293,8 +293,6 @@ static void pnv_pec_stk_default_phb_realize(PnvPhb4PecStack
*stack,
&error_fatal);
object_property_set_int(OBJECT(stack->phb), "version", pecc->version,
&error_fatal);
- object_property_set_link(OBJECT(stack->phb), "stack", OBJECT(stack),
- &error_abort);
if (!sysbus_realize(SYS_BUS_DEVICE(stack->phb), errp)) {
return;
--
2.31.1
- [PULL 06/31] Link new ppc-spapr-uv-hcalls.rst to pseries.rst., (continued)
- [PULL 06/31] Link new ppc-spapr-uv-hcalls.rst to pseries.rst., Cédric Le Goater, 2022/01/18
- [PULL 19/31] ppc/pnv: move nest_regs_mr to PnvPHB4, Cédric Le Goater, 2022/01/18
- [PULL 28/31] ppc/pnv: rename pnv_pec_stk_update_map(), Cédric Le Goater, 2022/01/18
- [PULL 30/31] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC, Cédric Le Goater, 2022/01/18
- [PULL 26/31] ppc/pnv: make PECs create and realize PHB4s, Cédric Le Goater, 2022/01/18
- [PULL 29/31] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize(), Cédric Le Goater, 2022/01/18
- [PULL 18/31] ppc/pnv: change pnv_pec_stk_update_map() to use PnvPHB4, Cédric Le Goater, 2022/01/18
- [PULL 20/31] ppc/pnv: move phb_regs_mr to PnvPHB4, Cédric Le Goater, 2022/01/18
- [PULL 27/31] ppc/pnv: remove PnvPhb4PecStack object, Cédric Le Goater, 2022/01/18
- [PULL 17/31] ppc/pnv: move nest_regs[] to PnvPHB4, Cédric Le Goater, 2022/01/18
- [PULL 23/31] ppc/pnv: remove stack pointer from PnvPHB4,
Cédric Le Goater <=
- [PULL 24/31] ppc/pnv: move default_phb_realize() to pec_realize(), Cédric Le Goater, 2022/01/18
- [PULL 31/31] ppc/pnv: Remove PHB4 version property, Cédric Le Goater, 2022/01/18
- Re: [PULL 00/31] ppc queue, Peter Maydell, 2022/01/18