qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: Bernhard Beschow <shentey@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, qemu-ppc@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH 1/4] hw/ppc: Set machine->fdt in e500 machines
Date: Thu, 26 Jan 2023 12:58:18 -0300	[thread overview]
Message-ID: <4c36b71c-15c4-1a84-a14d-c675bb7bd313@gmail.com> (raw)
In-Reply-To: <20230125130024.158721-2-shentey@gmail.com>



On 1/25/23 10:00, Bernhard Beschow wrote:
> This enables support for the 'dumpdtb' QMP/HMP command for all
> e500 machines.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/ppc/e500.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index 9fa1f8e6cf..7239993acc 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -659,9 +659,14 @@ done:
>       if (!dry_run) {
>           qemu_fdt_dumpdtb(fdt, fdt_size);
>           cpu_physical_memory_write(addr, fdt, fdt_size);
> +
> +        /* Set machine->fdt for 'dumpdtb' QMP/HMP command */
> +        g_free(machine->fdt);
> +        machine->fdt = fdt;
> +    } else {
> +        g_free(fdt);
>       }
>       ret = fdt_size;
> -    g_free(fdt);
>   

I tried to do this change last year when introducing 'dumpdtb' and Phil had some
comments in how the FDT was being handled by the e500 board:

https://lists.gnu.org/archive/html/qemu-devel/2022-09/msg03256.html


================

+
+    /*
+     * Update the machine->fdt pointer to enable support for the
+     * 'dumpdtb' QMP/HMP command.
+     *
+     * The FDT is re-created during reset,

Why are we doing that? Is it really necessary? This seems to be only required at cold power-on.

+ so free machine->fdt
+     * to avoid leaking the old FDT.
+     */
+    g_free(machine->fdt);
+    machine->fdt = fdt;
================

I ended up not going after Phil's concern. I don't think it's required to accept
this change, but it would simplify it a bit if the FDT isn't required to be
re-generated on boot.


I'm CCing Phil in case he wants to comment on it as well.




Daniel


>   out:
>       g_free(pci_map);


  reply	other threads:[~2023-01-26 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 13:00 [PATCH 0/4] E500 cleanups and enhancements Bernhard Beschow
2023-01-25 13:00 ` [PATCH 1/4] hw/ppc: Set machine->fdt in e500 machines Bernhard Beschow
2023-01-26 15:58   ` Daniel Henrique Barboza [this message]
2023-01-26 16:38     ` Bernhard Beschow
2023-01-25 13:00 ` [PATCH 2/4] hw/ppc/e500{, plat}: Drop redundant checks for presence of platform bus Bernhard Beschow
2023-01-25 13:00 ` [PATCH 3/4] hw/ppc/e500.c: Avoid hardcoding parent device in create_devtree_etsec() Bernhard Beschow
2023-01-25 13:00 ` [PATCH 4/4] hw/ppc/e500.c: Attach eSDHC unimplemented region to ccsr_addr_space Bernhard Beschow
2023-01-25 23:17   ` Philippe Mathieu-Daudé
2023-01-28 23:33 ` [PATCH 0/4] E500 cleanups and enhancements Daniel Henrique Barboza

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=4c36b71c-15c4-1a84-a14d-c675bb7bd313@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=shentey@gmail.com \
    /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).