ppc/pnv: use PHB4 obj in pnv_pec_stk_pci_xscom_ops
commit5d4ec103410f18490b5d61703af9c586bfca8b6c
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Tue, 18 Jan 2022 11:56:30 +0000 (18 12:56 +0100)
committerCédric Le Goater <clg@kaod.org>
Tue, 18 Jan 2022 11:56:30 +0000 (18 12:56 +0100)
treee8f9e33b7123d9590ffb798dd8cadd9960782a53
parent390a1299973a2f124fccd91c9110f094f1bee29d
ppc/pnv: use PHB4 obj in pnv_pec_stk_pci_xscom_ops

The current relationship between PnvPhb4PecStack and PnvPHB4 objects is
overly complex. Recent work done in pnv_phb4.c and pnv_phb4_pec.c shows
that the stack obj role in the overall design is more of a placeholder for
its 'phb' object, having no atributes that stand on its own. This became
clearer after pnv-phb4 user creatable devices were implemented.

What remains now are a lot of stack->phb and phb->stack pointers
throughout .read and .write callbacks of MemoryRegionOps that are being
initialized in phb4_realize() time. stk_realize() is a no-op if the
machine is being run with -nodefaults.

The first step of trying to decouple the stack and phb relationship is
to move the MemoryRegionOps that belongs to PnvPhb4PecStack to PhbPHB4.
Unfortunately this can't be done  without some preliminary steps to
change the usage of 'stack' and replace it with 'phb' in these
read/write callbacks.

This patch starts this process by using a PnvPHB4 opaque in
pnv_pec_stk_pci_xscom_ops instead of PnvPhb4PecStack.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220113192952.911188-2-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/pci-host/pnv_phb4.c