On 26/02/27 02:05PM, BALATON Zoltan wrote:
> On Fri, 27 Feb 2026, Aditya Gupta wrote:
> > On 26/02/27 03:43PM, shivang upadhyay wrote:
> > > > <...snip...>
> > > >
> > > > Q: can the generated DBT genuinely be different on a
> > > > subsequent reset than it was when QEMU first starts?
> > > > The comments in the pnv_reset() code seem to suggest it,
> > > > but on the other hand the code as written will only
> > > > call pnv_dt_create() and update machine->fdt once on first
> > > > reset, not on later resets. So perhaps the comment is
> > > > just confusingly worded ?
> > >
> > > Yes, I am not much familiar with the design here. But, as per
> > >
> > > my current understanding of this code, DTB content should not
> > >
> > > not be changed.
> >
> > To add to this, yes, normally reset path doesn't change the device tree,
> > since all reboots are the same as the first boot.
> >
> > As of upstream this is true, I don't see dtb changing between resets.
>
> Isn't VOF allowing clients to do setprop that would be changing the device
> tree? Some settings are stored there so maybe it can be changed by the guest
> that should be preserved between reboots?
By VOF did you mean the pseries f/w ?
i don't see anything changing the dt in powernv as of now, but
for some edge case, where that is possible (will be possible atleast
after mpipl support is merged), we can always update the fdt in below 2
if cases in pnv_reset:
> if (machine->fdt) {
> fdt = machine->fdt;
> } else {
> fdt = pnv_dt_create(machine);
> /* Pack resulting tree */
> _FDT((fdt_pack(fdt)));
> }
machine->fdt will never be NULL since it's being set in pnv_init
should we just do pnv_dt_create on every pnv_reset ?
> /* Update machine->fdt with latest fdt */
> if (machine->fdt != fdt) {
> /*
> * Set machine->fdt for 'dumpdtb' QMP/HMP command. Free
> * the existing machine->fdt to avoid leaking it during
> * a reset.
> */
> g_free(machine->fdt);
> machine->fdt = fdt;
> }
we can unconditionally always update the fdt on a pnv reset. should be
harmless, for the default case it will generate the same dt.
this should handle any edge case where in future if dt should change
between pnv_init/pnv_reset
What do you all say ?
Thanks,
- Aditya G
>
> Regards,
> BALATON Zoltan
>
> > One case where reset path does change the device tree compared to
> > pnv_init part is Memory-Preserving IPL (MPIPL), which is a
> > dump-collection feature in powernv for collecting dumps after kernel
> > crashes.
> > This is not merged yet in upstream, and is currently in discussion [1].
> >
> > I am okay with the dead if condition in pnv_reset to be removed for now,
> > we can add it later for mpipl purpose if needed.
> >
> > [1]:
> > https://lore.kernel.org/qemu-devel/[email protected]/
> >
> > Thanks,
> > - Aditya G
> >
> >
> >