* [PATCH-for-10.0] hw/core/machine.c: Fix -machine dumpdtb=file.dtb
@ 2025-04-01 4:15 Joel Stanley
2025-04-01 6:04 ` Philippe Mathieu-Daudé
2025-04-03 23:33 ` Alistair Francis
0 siblings, 2 replies; 3+ messages in thread
From: Joel Stanley @ 2025-04-01 4:15 UTC (permalink / raw)
To: Peter Maydell; +Cc: Eduardo Habkost, Marcel Apfelbaum, qemu-devel
In commit 8fd2518ef2f8 ("hw: Centralize handling of -machine dumpdtb
option") the call to dump was moved with respect to the init of the
machine. This resulted in the device tree missing parts of the machine
description, depending on how they construct their device tree.
The arm virt machine is missing some PSCI nodes, while the riscv one
is missing most of its content.
Move the dump to after the notifiers have been run, allowing
virt_machine_done to be called and the device tree to be fully
populated.
Fixes: 8fd2518ef2f8 ("hw: Centralize handling of -machine dumpdtb option")
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
hw/core/machine.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index f52a4f2273b2..63c6ef93d296 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1731,12 +1731,6 @@ void qdev_machine_creation_done(void)
phase_advance(PHASE_MACHINE_READY);
qdev_assert_realized_properly();
- /*
- * If the user used -machine dumpdtb=file.dtb to request that we
- * dump the DTB to a file, do it now, and exit.
- */
- handle_machine_dumpdtb(current_machine);
-
/* TODO: once all bus devices are qdevified, this should be done
* when bus is created by qdev.c */
/*
@@ -1750,6 +1744,12 @@ void qdev_machine_creation_done(void)
notifier_list_notify(&machine_init_done_notifiers, NULL);
+ /*
+ * If the user used -machine dumpdtb=file.dtb to request that we
+ * dump the DTB to a file, do it now, and exit.
+ */
+ handle_machine_dumpdtb(current_machine);
+
if (rom_check_and_register_reset() != 0) {
exit(1);
}
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH-for-10.0] hw/core/machine.c: Fix -machine dumpdtb=file.dtb
2025-04-01 4:15 [PATCH-for-10.0] hw/core/machine.c: Fix -machine dumpdtb=file.dtb Joel Stanley
@ 2025-04-01 6:04 ` Philippe Mathieu-Daudé
2025-04-03 23:33 ` Alistair Francis
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-01 6:04 UTC (permalink / raw)
To: Joel Stanley, Peter Maydell; +Cc: Eduardo Habkost, Marcel Apfelbaum, qemu-devel
On 1/4/25 06:15, Joel Stanley wrote:
> In commit 8fd2518ef2f8 ("hw: Centralize handling of -machine dumpdtb
> option") the call to dump was moved with respect to the init of the
> machine. This resulted in the device tree missing parts of the machine
> description, depending on how they construct their device tree.
>
> The arm virt machine is missing some PSCI nodes, while the riscv one
> is missing most of its content.
>
> Move the dump to after the notifiers have been run, allowing
> virt_machine_done to be called and the device tree to be fully
> populated.
>
> Fixes: 8fd2518ef2f8 ("hw: Centralize handling of -machine dumpdtb option")
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> hw/core/machine.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH-for-10.0] hw/core/machine.c: Fix -machine dumpdtb=file.dtb
2025-04-01 4:15 [PATCH-for-10.0] hw/core/machine.c: Fix -machine dumpdtb=file.dtb Joel Stanley
2025-04-01 6:04 ` Philippe Mathieu-Daudé
@ 2025-04-03 23:33 ` Alistair Francis
1 sibling, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2025-04-03 23:33 UTC (permalink / raw)
To: Joel Stanley; +Cc: Peter Maydell, Eduardo Habkost, Marcel Apfelbaum, qemu-devel
On Tue, Apr 1, 2025 at 2:16 PM Joel Stanley <joel@jms.id.au> wrote:
>
> In commit 8fd2518ef2f8 ("hw: Centralize handling of -machine dumpdtb
> option") the call to dump was moved with respect to the init of the
> machine. This resulted in the device tree missing parts of the machine
> description, depending on how they construct their device tree.
>
> The arm virt machine is missing some PSCI nodes, while the riscv one
> is missing most of its content.
>
> Move the dump to after the notifiers have been run, allowing
> virt_machine_done to be called and the device tree to be fully
> populated.
>
> Fixes: 8fd2518ef2f8 ("hw: Centralize handling of -machine dumpdtb option")
> Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/core/machine.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index f52a4f2273b2..63c6ef93d296 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -1731,12 +1731,6 @@ void qdev_machine_creation_done(void)
> phase_advance(PHASE_MACHINE_READY);
> qdev_assert_realized_properly();
>
> - /*
> - * If the user used -machine dumpdtb=file.dtb to request that we
> - * dump the DTB to a file, do it now, and exit.
> - */
> - handle_machine_dumpdtb(current_machine);
> -
> /* TODO: once all bus devices are qdevified, this should be done
> * when bus is created by qdev.c */
> /*
> @@ -1750,6 +1744,12 @@ void qdev_machine_creation_done(void)
>
> notifier_list_notify(&machine_init_done_notifiers, NULL);
>
> + /*
> + * If the user used -machine dumpdtb=file.dtb to request that we
> + * dump the DTB to a file, do it now, and exit.
> + */
> + handle_machine_dumpdtb(current_machine);
> +
> if (rom_check_and_register_reset() != 0) {
> exit(1);
> }
> --
> 2.47.2
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-03 23:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 4:15 [PATCH-for-10.0] hw/core/machine.c: Fix -machine dumpdtb=file.dtb Joel Stanley
2025-04-01 6:04 ` Philippe Mathieu-Daudé
2025-04-03 23:33 ` Alistair Francis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).