@samitouri / QOSamiQemu / commits / 55db0113c3

ppc/pnv: avoid regenerating DTB if external DTB is present

Currently externally provided dtb is overwritten in `pnv_reset`. Fix this by only creating dtb if not provided from `-dtb`. Reviewed-by: Aditya Gupta <adityag@linux.ibm.com> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com> Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com> Link: https://lore.kernel.org/qemu-devel/20260630103508.254000-2-shivangu@linux.ibm.com Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>

Shivang Upadhyay committed Jun 30, 2026 at 16:05 UTC 55db0113c38997c9c969c8260adb18c6d2982929
1 file changed +7 -3
hw/ppc/pnv.c
+7 -3
@@ -803,9 +803,13 @@ static void pnv_reset(MachineState *machine, ResetType type)
803 mpipl_write_succeeded = do_mpipl_write(pnv);
804 }
805
806 - /* Regenerate device tree */
807 - fdt = pnv_dt_create(machine);
808 - _FDT((fdt_pack(fdt)));
806 + /* Only create new dt if not provided in -dtb */
807 + if (!machine->dtb) {
808 + fdt = pnv_dt_create(machine);
809 + _FDT((fdt_pack(fdt)));
810 + } else {
811 + fdt = machine->fdt;
812 + }
813
814 /*
815 * If it's a MPIPL boot, add the "mpipl-boot" property, and reset the