qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: Re: [PATCH 5/6] hw: Centralize handling of -machine dumpdtb option
Date: Thu, 6 Feb 2025 12:51:01 -0800	[thread overview]
Message-ID: <6d279ec9-4be7-4e97-851a-52e31b0a3d15@linaro.org> (raw)
In-Reply-To: <20250206151214.2947842-6-peter.maydell@linaro.org>

On 2/6/25 07:12, Peter Maydell wrote:
> Currently we handle the 'dumpdtb' machine sub-option ad-hoc in every
> board model that has an FDT.  It's up to the board code to make sure
> it calls qemu_fdt_dumpdtb() in the right place.
> 
> This means we're inconsistent and often just ignore the user's
> command line argument:
>   * if the board doesn't have an FDT at all
>   * if the board supports FDT, but there happens not to be one
>     present (usually because of a missing -fdt option)
> 
> This isn't very helpful because it gives the user no clue why their
> option was ignored.
> 
> However, in order to support the QMP/HMP dumpdtb commands we require
> now that every FDT machine stores a pointer to the FDT in
> MachineState::fdt.  This means we can handle -machine dumpdtb
> centrally by calling the qmp_dumpdtb() function, unifying its
> handling with the QMP/HMP commands.  All the board code calls to
> qemu_fdt_dumpdtb() can then be removed.
> 
> For this commit we retain the existing behaviour that if there
> is no FDT we silently ignore the -machine dumpdtb option.
> ---
>   include/system/device_tree.h |  2 --
>   hw/arm/boot.c                |  2 --
>   hw/core/machine.c            | 25 +++++++++++++++++++++++++
>   hw/loongarch/virt.c          |  1 -
>   hw/mips/boston.c             |  1 -
>   hw/openrisc/boot.c           |  1 -
>   hw/ppc/e500.c                |  1 -
>   hw/ppc/pegasos2.c            |  1 -
>   hw/ppc/pnv.c                 |  1 -
>   hw/ppc/spapr.c               |  1 -
>   hw/riscv/boot.c              |  2 --
>   system/device_tree.c         | 15 ---------------
>   12 files changed, 25 insertions(+), 28 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


  reply	other threads:[~2025-02-06 20:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 15:12 [PATCH 0/6] hw: Centralize handling, improve error messages for -machine dumpdtb Peter Maydell
2025-02-06 15:12 ` [PATCH 1/6] monitor/hmp-cmds.c: Clean up hmp_dumpdtb printf Peter Maydell
2025-02-06 20:46   ` Richard Henderson
2025-02-10 10:57   ` Philippe Mathieu-Daudé
2025-02-06 15:12 ` [PATCH 2/6] hw/openrisc: Support monitor dumpdtb command Peter Maydell
2025-02-06 20:48   ` Richard Henderson
2025-02-10 10:57   ` Philippe Mathieu-Daudé
2025-02-06 15:12 ` [PATCH 3/6] hw/mips/boston: Check for error return from boston_fdt_filter() Peter Maydell
2025-02-10 10:48   ` Philippe Mathieu-Daudé
2025-02-06 15:12 ` [PATCH 4/6] hw/mips/boston: Support dumpdtb monitor commands Peter Maydell
2025-02-10 10:56   ` Philippe Mathieu-Daudé
2025-02-10 11:09     ` Peter Maydell
2025-02-10 11:37       ` Philippe Mathieu-Daudé
2025-02-06 15:12 ` [PATCH 5/6] hw: Centralize handling of -machine dumpdtb option Peter Maydell
2025-02-06 20:51   ` Richard Henderson [this message]
2025-02-06 15:12 ` [PATCH 6/6] hw/core/machine.c: Make -machine dumpdtb=file.dtb with no DTB an error Peter Maydell
2025-02-06 20:52   ` Richard Henderson
2025-02-24 14:50 ` [PATCH 0/6] hw: Centralize handling, improve error messages for -machine dumpdtb Peter Maydell

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=6d279ec9-4be7-4e97-851a-52e31b0a3d15@linaro.org \
    --to=richard.henderson@linaro.org \
    --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).