[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-7.2 v2 09/20] hw/ppc: set machine->fdt in pnv_reset()
From: |
David Gibson |
Subject: |
Re: [PATCH for-7.2 v2 09/20] hw/ppc: set machine->fdt in pnv_reset() |
Date: |
Mon, 8 Aug 2022 13:25:35 +1000 |
On Fri, Aug 05, 2022 at 09:31:11AM -0300, Daniel Henrique Barboza wrote:
>
>
> On 8/5/22 08:03, Frederic Barrat wrote:
> >
> >
> > On 05/08/2022 11:39, Daniel Henrique Barboza wrote:
> > > This will enable support for 'dumpdtb' and 'info fdt' HMP commands for
> > > all powernv machines.
> > >
> > > Cc: Cédric Le Goater <clg@kaod.org>
> > > Cc: Frederic Barrat <fbarrat@linux.ibm.com>
> > > Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> > > ---
> > > hw/ppc/pnv.c | 6 +++++-
> > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> > > index d3f77c8367..f5162f8b7b 100644
> > > --- a/hw/ppc/pnv.c
> > > +++ b/hw/ppc/pnv.c
> > > @@ -608,7 +608,11 @@ static void pnv_reset(MachineState *machine)
> > > qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt));
> > > cpu_physical_memory_write(PNV_FDT_ADDR, fdt, fdt_totalsize(fdt));
> > > - g_free(fdt);
> > > + /*
> > > + * Update the machine->fdt pointer to enable support for
> > > + * 'dumpdtb' and 'info fdt' commands.
> > > + */
> > > + machine->fdt = fdt;
> >
> >
> > Can pnv_reset() be called several times in the same instance of the qemu
> > process, in which case we leak memory?
>
> hmmm I think it's possible if we issue a 'system_reset' via the
> monitor.
Right. I'm not certain about pnv, but on most platforms there's a way
to trigger system_reset from the guest side as well.
> I'll put a g_free(machine->fdt) before the assignment.
>
>
> Daniel
>
>
> >
> > Fred
> >
> >
> > > }
> > > static ISABus *pnv_chip_power8_isa_create(PnvChip *chip, 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
- Re: [PATCH for-7.2 v2 01/20] hw/arm: do not free machine->fdt in arm_load_dtb(), (continued)
[PATCH for-7.2 v2 02/20] hw/microblaze: set machine->fdt in microblaze_load_dtb(), Daniel Henrique Barboza, 2022/08/05
[PATCH for-7.2 v2 03/20] hw/nios2: set machine->fdt in nios2_load_dtb(), Daniel Henrique Barboza, 2022/08/05
[PATCH for-7.2 v2 04/20] hw/ppc: set machine->fdt in ppce500_load_device_tree(), Daniel Henrique Barboza, 2022/08/05
[PATCH for-7.2 v2 06/20] hw/ppc: set machine->fdt in sam460ex_load_device_tree(), Daniel Henrique Barboza, 2022/08/05
[PATCH for-7.2 v2 08/20] hw/ppc: set machine->fdt in pegasos2_machine_reset(), Daniel Henrique Barboza, 2022/08/05
[PATCH for-7.2 v2 09/20] hw/ppc: set machine->fdt in pnv_reset(), Daniel Henrique Barboza, 2022/08/05
Re: [PATCH for-7.2 v2 09/20] hw/ppc: set machine->fdt in pnv_reset(), Cédric Le Goater, 2022/08/08
[PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine, Daniel Henrique Barboza, 2022/08/05
Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine, Alexey Kardashevskiy, 2022/08/18