mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 21:46:25 +00:00
ppc/pnv: fix dumpdtb option
The '-machine dumpdtb' command line option stopped working on
PowerPC/pnv systems after recent design change [1].
Fixing this by generating fdt blob in `pnv_init`.
[1] https://lore.kernel.org/qemu-devel/20250206151214.2947842-1-peter.maydell@linaro.org/
Cc: Aditya Gupta <adityag@linux.ibm.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-stable@nongnu.org
Fixes: 8fd2518ef2 ("hw: Centralize handling of -machine dumpdtb option")
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260311143549.118720-1-shivangu@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
This commit is contained in:
committed by
Harsh Prateek Bora
parent
6667668e0c
commit
a16d4c2f16
25
hw/ppc/pnv.c
25
hw/ppc/pnv.c
@@ -773,26 +773,8 @@ static void pnv_reset(MachineState *machine, ResetType type)
|
||||
}
|
||||
}
|
||||
|
||||
if (machine->fdt) {
|
||||
fdt = machine->fdt;
|
||||
} else {
|
||||
fdt = pnv_dt_create(machine);
|
||||
/* Pack resulting tree */
|
||||
_FDT((fdt_pack(fdt)));
|
||||
}
|
||||
|
||||
fdt = machine->fdt;
|
||||
cpu_physical_memory_write(PNV_FDT_ADDR, fdt, fdt_totalsize(fdt));
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
|
||||
static ISABus *pnv_chip_power8_isa_create(PnvChip *chip, Error **errp)
|
||||
@@ -1261,6 +1243,11 @@ static void pnv_init(MachineState *machine)
|
||||
if (pmc->i2c_init) {
|
||||
pmc->i2c_init(pnv);
|
||||
}
|
||||
|
||||
if (!machine->fdt) {
|
||||
machine->fdt = pnv_dt_create(machine);
|
||||
_FDT((fdt_pack(machine->fdt)));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user