From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Joel Stanley" <joel@jms.id.au>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 2/8] hw/core/machine: Fix -machine dumpdtb=file.dtb
Date: Tue, 8 Apr 2025 20:55:32 +0200 [thread overview]
Message-ID: <20250408185538.85538-3-philmd@linaro.org> (raw)
In-Reply-To: <20250408185538.85538-1-philmd@linaro.org>
From: Joel Stanley <joel@jms.id.au>
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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250401041509.719153-1-joel@jms.id.au>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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 f52a4f2273b..63c6ef93d29 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.1
next prev parent reply other threads:[~2025-04-08 18:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 18:55 [PULL 0/8] Misc HW patches for 2025-04-08 Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 1/8] smbios: Fix buffer overrun when using path= option Philippe Mathieu-Daudé
2025-04-17 10:11 ` Daan De Meyer
2025-04-17 13:05 ` Michael Tokarev
2025-04-17 13:25 ` Daan De Meyer
2025-04-17 13:56 ` Philippe Mathieu-Daudé
2025-04-08 18:55 ` Philippe Mathieu-Daudé [this message]
2025-05-08 13:46 ` [PULL 2/8] hw/core/machine: Fix -machine dumpdtb=file.dtb Peter Maydell
2025-04-08 18:55 ` [PULL 3/8] docs/arm: Add apple HVF host for supported guest CPU type Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 4/8] hw/ufs: Fix incorrect comment for segment_size and allocation_unit_size Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 5/8] hw/arm/imx8mp-evk: Remove unimplemented cpu-idle-states properties from devicetree Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 6/8] hw/arm/imx8mp-evk: Temporarily remove unimplemented imx8mp-fspi node " Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 7/8] hw/nvme: fix attachment of private namespaces Philippe Mathieu-Daudé
2025-04-08 18:55 ` [PULL 8/8] scripts/checkpatch: Fix typo in SPDX-License-Identifier keyword Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250408185538.85538-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=joel@jms.id.au \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).