From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Cédric Le Goater" <clg@kaod.org>,
"Aditya Gupta" <adityag@linux.ibm.com>,
"Mahesh J Salgaonkar" <mahesh@linux.ibm.com>,
"Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Frédéric Barrat" <fbarrat@linux.ibm.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Cc: <qemu-devel@nongnu.org>, <qemu-ppc@nongnu.org>
Subject: Re: [PATCH v3] hw/ppc: Implement -dtb support for PowerNV
Date: Fri, 16 Aug 2024 12:20:53 +1000 [thread overview]
Message-ID: <D3GZ6RL9K9OQ.1A1YQ9YSZPH3E@gmail.com> (raw)
In-Reply-To: <6c0cdf26-9795-4998-9d80-1d0095700a59@kaod.org>
On Fri Aug 16, 2024 at 3:52 AM AEST, Cédric Le Goater wrote:
> On 8/15/24 09:31, Nicholas Piggin wrote:
> > On Tue Aug 13, 2024 at 11:45 PM AEST, Aditya Gupta wrote:
> >> Currently any device tree passed with -dtb option in QEMU, was ignored
> >> by the PowerNV code.
> >>
> >> Read and pass the passed -dtb to the kernel, thus enabling easier
> >> debugging with custom DTBs.
> >>
> >> The existing behaviour when -dtb is 'not' passed, is preserved as-is.
> >>
> >> But when a '-dtb' is passed, it completely overrides any dtb nodes or
> >> changes QEMU might have done, such as '-append' arguments to the kernel
> >> (which are mentioned in /chosen/bootargs in the dtb), hence add warning
> >> when -dtb is being used
> >>
> >> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
> >
> > This looks pretty good, I'm inclined to take it as a bug fix fo this
> > release.
>
> I don't think this is a bug fix. is it ? AFAIUI, it is a debug
> feature for skiboot. It's QEMU 9.2 material.
Okay.
> > One little nit is MachineState.fdt vs PnvMachineState.fdt
> > which is now confusing. I would call the new PnvMachineState member
> > something like fdt_from_dtb, or fdt_override?
>
> I agree. this is confusing. machine->fdt could be used instead ?
Yeah that could be another option. Test pnv.dtb or add a new bool
to pnv if you need to check whether the fdt has been provided by
cmdline.
> > The other question... Some machines rebuild fdt at init, others at
> > reset time. As far as I understood, spapr has to rebuild on reset
> > because C-A-S call can update the fdt so you have to undo that on
> > reset.
>
> C-A-S is a guest OS hcall. reset is called before the guest OS
> is started.
Right, but when you reboot it needs to be reverted to initial
(pre-CAS) fdt.
> > Did powernv just copy that without really needing it, I wonder?
> > Maybe that rearranged to just do it at init time (e.g., see
> > hw/riscv/virt.c which is simpler).
>
> The machine is aware of user created devices (on the command line)
> only at reset time.
Ah, I should have followed a bit closer. riscv, arm use a
machine_done notifier for that (and x86, loongarch for ACPI / BIOS
tables). So that avoids fdt rebuild after the first reset I think.
Anyway I don't really mind then, following other archs would be okay,
but keeping similar with spapr and avoiding code change is also good.
Maybe add a small comment to we use reset rather than machine_done
notifier of other archs to be similar to spapr.
Thanks,
Nick
next prev parent reply other threads:[~2024-08-16 2:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 13:45 [PATCH v3] hw/ppc: Implement -dtb support for PowerNV Aditya Gupta
2024-08-15 7:31 ` Nicholas Piggin
2024-08-15 17:52 ` Cédric Le Goater
2024-08-16 2:20 ` Nicholas Piggin [this message]
2024-08-19 14:06 ` Aditya Gupta
2024-08-19 14:02 ` Aditya Gupta
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=D3GZ6RL9K9OQ.1A1YQ9YSZPH3E@gmail.com \
--to=npiggin@gmail.com \
--cc=adityag@linux.ibm.com \
--cc=berrange@redhat.com \
--cc=clg@kaod.org \
--cc=fbarrat@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).