From: Andre Przywara <andre.przywara-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
boot-architecture-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
"xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.org"
<xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Julien Grall
<julien.grall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Ian Campbell
<Ian.Campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PROPOSAL] ARM/FDT: passing multiple binaries to a kernel
Date: Mon, 16 Sep 2013 19:01:26 +0200 [thread overview]
Message-ID: <52373966.9000504@linaro.org> (raw)
In-Reply-To: <20130915123744.48AD1C42C2D-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
On 09/15/2013 02:37 PM, Grant Likely wrote:
> On Tue, 03 Sep 2013 17:53:44 +0200, Andre Przywara <andre.przywara-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>> Hi,
>>
>> a normal Linux kernel currently supports reading the start and end
>> address of a single binary blob via the FDT's /chosen node.
>> This will be interpreted as the location of an initial RAM disk.
>>
>> The Xen hypervisor itself is a kernel, but needs up to _two_ binaries
>> for proper operation: a Dom0 Linux kernel and it's associated initrd.
>> On x86 this is solved via the multiboot protocol used by the Grub
>> bootloader, which supports to pass an arbitrary number of binary modules
>> to any kernel.
>>
>> Since in the ARM world we have the versatile device tree, we don't need
>> to implement the mulitboot protocol.
>>
>> So I'd like to propose a new binding which denotes binary modules a
>> kernel can use at it's own discretion.
>> The need is triggered by the Xen hypervisor (which already uses a very
>> similar scheme), but the approach is deliberately chosen to be as
>> generic as possible to allow future uses (like passing firmware blobs
>> for devices or the like).
>> Credits for this go to Ian Campbell, who started something very similar
>> [1] for the Xen hypervisor. The intention of this proposal is to make
>> this generic and publicly documented.
>>
>> Looking forward to any comments!
>>
>> Thanks,
>> Andre.
>>
>> [1]
>> http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/misc/arm/device-tree/booting.txt;h=94cd3f18a4e1317a35e1255bf5c6e1e091001d1a;hb=HEAD
>> ----------------------------
>> * Multiple boot modules device tree bindings
>>
>> Boot loaders wanting to pass multiple additional binaries to a kernel
>> shall add a node "module" for each binary blob under the /chosen node
>> with the following properties:
>>
>> - compatible:
>> compatible = "boot,module";
>> A bootloader may add names to more specifically describe the module,
>> e.g. Xen may use "xen,dom0-kernel" or "xen,dom0-ramdisk".
>> If possible a kernel should be able to use modules even without a
>> descriptive naming, by enumerating them in order and using hard-coded
>> meanings for each module (e.g. first is kernel, second is initrd).
>>
>> - reg: specifies the base physical address and size of a region in
>> memory where the bootloader loaded the respective binary data to.
>>
>> - bootargs:
>> An optional property describing arguments to use for this module.
>> Could be a command line or configuration data.
>>
>> Example:
>> /chosen {
>> #size-cells = <0x1>;
>> #address-cells = <0x1>;
>> module@0 {
>> compatible = "xen,linux-zimage", "xen,multiboot-module",
>> "boot,module";
>> reg = <0x80000000 0x003dcff8>;
>> bootargs = "console=hvc0 earlyprintk ro root=/dev/sda1 nosmp";
>> };
>> module@1 {
>> compatible = "xen,linux-initrd", "xen,multiboot-module",
>> "boot,module";
>> reg = <0x08000000 0x00123456>;
>> };
Grant,
thanks for looking at this. Appreciate your comments.
> The moment you pull in a 'reg' property, your required to property parse
> #size-cells and #address-cells and also 'ranges' which is missing from
> the above.
You mean that early boot code has to read #size-cells and #address-cells
and act accordingly when parsing the reg property? So just more code in
early boot? But that would easily open the door for 64bit addresses for
instance, right?
> I don't necessarily object to that, but it can be a lot to
> ask for during early boot.
I don't think Xen in particular has a lot of problems with that. The DT
implementation is quite capable (see Julien's latest updates).
> It also looks really weird in the chosen node.
TBH this initrd syntax looks a bit weird to me in general, not following
the nice and well defined DT way (no compatible, separate properties for
start and length, ...)
> For boot time artifacts like this, I'd rather see a duplication of
> the linux,initrd- pattern. Something like:
> /chosen {
> xen,linux-zimage-start = <0x80000000>;
> xen,linux-zimage-end = <0x803dcff8>;
> linux,initrd-start = <0x8000000>;
> linux,initrd-end = <0x8123456>;
> }
To me that sounds like a hack to avoid more coding work.
The problem with that is that it would introduce a Xen specific property
(actually two).
So from a user's perspective you want:
a) generic properties to support future OSes without much hassle (using
the DT's compatible semantic)
b) specifying load address and length in the normal way
c) adding command lines
d) potentially adding more arbitrary properties
e) allowing an arbitrary number of modules
To just go ahead with another hard-coded property to make life easier
for us kernel level developers doesn't sound very convincing to me.
And especially supporting multiple modules would be very hackish then.
> If have two reason for this; consistency and simplicity. Consistent
> because it matches what Linux already uses,
But this is actually not consistent with the rest of the DT
architecture. Defining an own node for that looks like a perfect match
to me in the DT world.
> and really easy to parse
> without mucking with ranges or #address/size-cells. The assumption is
> that during early boot the system is dealing with a 1:1 mapped physical
> address and there isn't any bus translations that need to be processed.
I see your point with early boot code constraints. But my idea was to
create a flexible and generic solution, so that there will be a
framework for bootloaders to specify blobs without needing updates every
time someone comes up with a need for one. On x86 there was once such a
need for microcode updates which couldn't be easily satisfied because
Linux/x86 itself does not support the multiboot protocol.
> Question: what is the need for the xen,linux-initrd node? Why can't the
> existing "linux,initrd-*" properties continue to be used?
The main driver for this was to avoid patching bootloaders just to boot
Xen specifically. Rather we want to patch bootloaders to support some
kind of "multiboot" protocol once and let Xen piggy-back on this. I
think that is somewhat driven by experiences in the x86 world, were
especially kernel people are reluctant to support something just for
Xen's need.
Regards,
Andre.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2013-09-16 17:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 15:53 [PROPOSAL] ARM/FDT: passing multiple binaries to a kernel Andre Przywara
[not found] ` <52260608.2030202-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-09-03 22:00 ` Rob Herring
[not found] ` <CAL_JsqK9PjpScRO8561PhcyKkxhuL4pgMTCh2-UG_ubybJTcCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-04 8:43 ` Andre Przywara
2013-09-04 8:55 ` Ian Campbell
[not found] ` <1378284955.17510.64.camel-ommiHX4a84BXesXXhkcM7miJhflN2719@public.gmane.org>
2013-09-04 9:14 ` Andre Przywara
[not found] ` <5226F2B3.10606-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-09-05 13:23 ` Rob Herring
[not found] ` <CAL_JsqKfcudKiTOr-MrHsq6NidG-5t5S0t08ELTSpOuc2LF4RQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-06 13:30 ` Andre Przywara
2013-09-04 8:44 ` Ian Campbell
[not found] ` <1378284256.17510.60.camel-ommiHX4a84BXesXXhkcM7miJhflN2719@public.gmane.org>
2013-09-04 16:41 ` Rob Herring
[not found] ` <CAL_Jsq+82xfNCD3LmNE6VD1mp4Vzbm-hPPaMjwg9+ab3moXP_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-13 10:13 ` Grant Likely
[not found] ` <CACxGe6sOyNNEATsnRdu9=_nPE1q6V4MDaDKvk4QvJiSgq6jXmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-13 11:22 ` Ian Campbell
[not found] ` <1379071333.19256.36.camel-ommiHX4a84BXesXXhkcM7miJhflN2719@public.gmane.org>
2013-09-15 12:17 ` Grant Likely
2013-09-14 1:40 ` Rob Herring
[not found] ` <CAL_JsqKnNHywcR21XhrjFyGs1DjZnbAFybraRKmxNmELLH-qPA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-15 12:23 ` Grant Likely
2013-09-14 4:06 ` Dennis Gilmore
2013-09-15 12:37 ` Grant Likely
[not found] ` <20130915123744.48AD1C42C2D-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-09-16 17:01 ` Andre Przywara [this message]
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=52373966.9000504@linaro.org \
--to=andre.przywara-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=Ian.Campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org \
--cc=boot-architecture-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=julien.grall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.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).