From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: julien@xen.org, masami.hiramatsu@linaro.org,
andre.przywara@arm.com, stefano.stabellini@linaro.org,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
takahiro.akashi@linaro.org,
Alistair Francis <alistair23@gmail.com>,
stefano.stabellini@xilinx.com, stratos-dev@op-lists.linaro.org
Subject: Re: [RFC PATCH 0/4] generic loader FDT support (for direct Xen boot)
Date: Tue, 13 Oct 2020 11:11:05 +0100 [thread overview]
Message-ID: <87a6wqzb9i.fsf@linaro.org> (raw)
In-Reply-To: <20201012172556.GF2954729@toto>
Edgar E. Iglesias <edgar.iglesias@gmail.com> writes:
> On Mon, Oct 12, 2020 at 05:02:57PM +0100, Alex Bennée wrote:
>>
>> Alistair Francis <alistair23@gmail.com> writes:
>>
>> > On Fri, Oct 9, 2020 at 10:07 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>> >>
>> >> Hi,
>> >>
>> >> This series adds the ability to append FDT data for blobs loaded by
>> >> the generic loader. My principle use-case was to be able to directly
>> >> boot Xen with a kernel image which avoided having to:
>> >>
>> >> - get the kernel image into my system image
>> >> - deal with bugs in FDT munging by -bios firmware and/or grub
<snip>
>> >> "Polluting" the generic loader arguments
>> >>
>> >> This was mainly out of convenience as the loader already knows the
>> >> size of the blob being loaded. However you could certainly argue it
>> >> makes sense to have a more generic "FDT expander" virtual device that
>> >> could for example query the QOM model somehow to find the details it
>> >> needs.
>> >
>> > That seems like a better option. Why not have a generic way to modify
>> > the device tree with a specific argument? It could either be -device
>> > loader,file=fdt,... or -fdt ...
>>
>> Well it comes down to how much of a special case this is? Pretty much
>> all FDT (and ACPI for the matter) is basically down to the board level
>> models - and not all of them just the funky configurable ones. For other
>> board models we just expect the user to pass the FDT they got with their
>> kernel blob.
>>
>> For modern VirtIO systems the only thing you really need to expose is
>> the root PCI bus because the rest of the devices are discover-able
>> there.
>>
>> So the real question is are there any other -devices that we want to be
>> able to graft FDT entries on or is the generic loader enough of a
>> special case that we keep all the logic in there?
>>
>
> Hi,
>
> Another option is to allow the user to pass along a DTB overlay with the
> generic loader option (or with a separate option as Alistair suggested).
> With overlways we wouldn't need all the command-line options to enable
> construction of dtb fragments, it would be more or less transparent to
> QEMU. There may be limitations with the overlay flows that I'm not aware
> of though...
So the problem of adding DTB overlays is it's not that much easier than
the current options of using -machine dumpdtb and then hand hacking the
magic values and rebuilding, for example:
https://medium.com/@denisobrezkov/xen-on-arm-and-qemu-1654f24dea75
Unless we come up with some sort of template support that allows QEMU to
insert numbers like address and size while processing the template. But
that seems a little too over engineered and likely introduces complexity
into the system.
Given the generic-loader is so simple I'm leaning towards another
approach of just c&p'ing generic-loader into a new "magic" device (maybe
guest-loader) and stripping out the bits we don't need (data, data-len,
be etc) and making the options more tuned what we are trying to achieve.
For example:
-device guest-loader,kernel=path/to/Image,args="command line",addr=0x47000000,hyp=xen
-device guest-loader,initrd=path/to/initrd,addr=0x42000000,hyp=xen
And then we can embed the smarts in the loader to set either DTB or ACPI
entries as required and if we need additional magic to support different
hypervisors (which hopefully you don't but...) you can modulate the
hyp=FOO variable.
There may be an argument for having a -hypervisor as a sugar alias for
-kernel (which maps to machine.kernel) but currently I see no practical
differences you need to launch it except maybe forcing the
virtualisation property to true if it exists - but that seems a little
ARM focused.
--
Alex Bennée
next prev parent reply other threads:[~2020-10-13 10:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 17:07 [RFC PATCH 0/4] generic loader FDT support (for direct Xen boot) Alex Bennée
2020-10-09 17:07 ` [RFC PATCH 1/4] hw/board: promote fdt from ARM VirtMachineState to MachineState Alex Bennée
2020-10-09 17:07 ` Alex Bennée
2020-10-09 17:07 ` [RFC PATCH 2/4] hw/riscv: migrate fdt field to generic MachineState Alex Bennée
2020-10-09 17:07 ` Alex Bennée
2020-10-09 17:07 ` [RFC PATCH 3/4] device_tree: add qemu_fdt_setprop_string_array helper Alex Bennée
2020-10-09 17:07 ` [RFC PATCH 4/4] generic_loader: allow the insertion of /chosen/module stanzas Alex Bennée
2020-10-09 17:24 ` [RFC PATCH 0/4] generic loader FDT support (for direct Xen boot) no-reply
2020-10-09 23:27 ` Alistair Francis
2020-10-12 16:02 ` Alex Bennée
2020-10-12 16:40 ` Peter Maydell
2020-10-12 17:11 ` Alex Bennée
2020-10-12 17:25 ` Edgar E. Iglesias
2020-10-13 10:11 ` Alex Bennée [this message]
2020-10-14 19:51 ` Alistair Francis
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=87a6wqzb9i.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=alistair23@gmail.com \
--cc=andre.przywara@arm.com \
--cc=edgar.iglesias@gmail.com \
--cc=julien@xen.org \
--cc=masami.hiramatsu@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@linaro.org \
--cc=stefano.stabellini@xilinx.com \
--cc=stratos-dev@op-lists.linaro.org \
--cc=takahiro.akashi@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.