Message ID | 20220113192952.911188-9-danielhb413@gmail.com |
---|---|
State | Accepted, archived |
Headers | show |
Series | remove PnvPhb4PecStack from Powernv9 | expand |
On 1/13/22 20:29, Daniel Henrique Barboza wrote: > stack->nest_regs_mr wasn't migrated to PnvPHB4 together with phb->nest_regs[] in > the previous patch. We were unable to cleanly convert its write MemoryRegionOps, > pnv_pec_stk_nest_xscom_write(), to use PnvPHB4 instead of PnvPhb4PecStack due to > pnv_pec_stk_update_map() using a stack. Thing is, we're now able to convert > pnv_pec_stk_update_map() because of what the did in previous patch. > > The need for this intermediate step is a good example of the interconnected > relationship between stack and phb that we aim to cleanup. > > Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Thanks, C. > --- > hw/pci-host/pnv_phb4.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c > index 916a7a3cf0..0f4464ec67 100644 > --- a/hw/pci-host/pnv_phb4.c > +++ b/hw/pci-host/pnv_phb4.c > @@ -893,10 +893,10 @@ static void pnv_phb4_update_regions(PnvPHB4 *phb) > pnv_phb4_check_all_mbt(phb); > } > > -static void pnv_pec_stk_update_map(PnvPhb4PecStack *stack) > +static void pnv_pec_stk_update_map(PnvPHB4 *phb) > { > + PnvPhb4PecStack *stack = phb->stack; > PnvPhb4PecState *pec = stack->pec; > - PnvPHB4 *phb = stack->phb; > MemoryRegion *sysmem = get_system_memory(); > uint64_t bar_en = phb->nest_regs[PEC_NEST_STK_BAR_EN]; > uint64_t bar, mask, size; > @@ -1046,7 +1046,7 @@ static void pnv_pec_stk_nest_xscom_write(void *opaque, hwaddr addr, > break; > case PEC_NEST_STK_BAR_EN: > phb->nest_regs[reg] = val & 0xf000000000000000ull; > - pnv_pec_stk_update_map(stack); > + pnv_pec_stk_update_map(phb); > break; > case PEC_NEST_STK_DATA_FRZ_TYPE: > case PEC_NEST_STK_PBCQ_TUN_BAR: >
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 916a7a3cf0..0f4464ec67 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -893,10 +893,10 @@ static void pnv_phb4_update_regions(PnvPHB4 *phb) pnv_phb4_check_all_mbt(phb); } -static void pnv_pec_stk_update_map(PnvPhb4PecStack *stack) +static void pnv_pec_stk_update_map(PnvPHB4 *phb) { + PnvPhb4PecStack *stack = phb->stack; PnvPhb4PecState *pec = stack->pec; - PnvPHB4 *phb = stack->phb; MemoryRegion *sysmem = get_system_memory(); uint64_t bar_en = phb->nest_regs[PEC_NEST_STK_BAR_EN]; uint64_t bar, mask, size; @@ -1046,7 +1046,7 @@ static void pnv_pec_stk_nest_xscom_write(void *opaque, hwaddr addr, break; case PEC_NEST_STK_BAR_EN: phb->nest_regs[reg] = val & 0xf000000000000000ull; - pnv_pec_stk_update_map(stack); + pnv_pec_stk_update_map(phb); break; case PEC_NEST_STK_DATA_FRZ_TYPE: case PEC_NEST_STK_PBCQ_TUN_BAR:
stack->nest_regs_mr wasn't migrated to PnvPHB4 together with phb->nest_regs[] in the previous patch. We were unable to cleanly convert its write MemoryRegionOps, pnv_pec_stk_nest_xscom_write(), to use PnvPHB4 instead of PnvPhb4PecStack due to pnv_pec_stk_update_map() using a stack. Thing is, we're now able to convert pnv_pec_stk_update_map() because of what the did in previous patch. The need for this intermediate step is a good example of the interconnected relationship between stack and phb that we aim to cleanup. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- hw/pci-host/pnv_phb4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)