From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>, Rob Herring <robh@kernel.org>,
Peter Robinson <pbrobinson@gmail.com>,
Sughosh Ganu <sughosh.ganu@linaro.org>,
u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: Re: [RFC PATCH 0/5] Allow for removal of DT nodes and properties
Date: Tue, 12 Sep 2023 09:03:48 +0300 [thread overview]
Message-ID: <ZP//RBE8nri1bd0d@hera> (raw)
In-Reply-To: <20230911190613.GC305624@bill-the-cat>
Hi Tom,
[...]
> > > > > > > > > I don't think they should be in DT at all, they don't describe
> > > > > > > > > anything to do with hardware, or generally even the runtime of a
> > > > > > > > > device, they don't even describe the boot/runtime state of the
> > > > > > > > > firmware, they describe build time, so I don't see what that has to do
> > > > > > > > > with device tree? Can you explain that? To me those sorts of things
> > > > > > > > > should live in a build time style config file.
> > > > > > >
> > > > > > > For the record, I tend to agree.
> > > > > > >
> > > > > >
> > > > > > +1
> > > > > >
> > > > > > > > I beg to differ. Devicetree is more than just hardware and always has
> > > > > > > > been. See, for example the /chosen and /options nodes.
> > > > > > >
> > > > > > > There are exceptions...
> > > > > > >
> > > > > >
> > > > > > We've been this over and over again and frankly it gets a bit annoying.
> > > > > > It's called *DEVICE* tree for a reason. As Rob pointed out there are
> > > > > > exceptions, but those made a lot of sense. Having arbitrary internal ABI
> > > > > > stuff of various projects in the schema just defeats the definition of a
> > > > > > spec.
> > > > >
> > > > > Our efforts should not just be about internal ABI, but working to
> > > > > provide a consistent configuration system for all firmware elements.
> > > >
> > > > And that's what the firmware handoff was all about.
> > > > I get what you are trying to do here. I am just aware of any other
> > >
> > > "just not aware" did you mean?
> >
> > Yep, sorry!
> >
> > >
> > > > project apart from U-Boot which uses DT for it's own configuration.
> > > > So trying to standardize some bindings that are useful to all projects
> > > > that use DT is fine. Trying to *enforce* them to use it for config
> > > > isn't IMHO.
> > > >
> > > > >
> > > > > We cannot have it both ways, i.e. refusing to accept non-hardware
> > > > > bindings and then complaining that U-Boot does not pass schema
> > > > > validation. Devicetree should be a shared resource, not just for the
> > > > > use of Linux.
> > > >
> > > > It's not for the use of Linux, I've wasted enough time repeating that
> > > > and so has Rob. Please go back to previous emails and read the
> > > > arguments.
> > >
> > > Right, it's not just for Linux, but Linux is where most of the
> > > exceptions to the "ONLY HARDWARE" rule got in, because they also make
> > > sense.
> >
> > Exactly.
> >
> > > And the overarching point Simon keeps trying to make I believe
> > > can be boiled down to that too. There are things that one does not have
> > > a (reasonable) choice about how to do things with when interacting with
> > > the hunk of melted sand on your desk and that information needs to go
> > > somewhere.
> >
> > DT is a big hammer indeed, but that doesn't mean we always need to use
> > it. I never disagreed with adding nodes that make sense and will be
> > useful for others. For example, the internal Driver model
> > configuration options used to enable a device early etc etc are
> > probably useful to more projects. On the other hand, if U-Boot is
> > indeed the only project using DT for its internal configuration why
> > should we care?
> >
> > For example, let's imagine you build TF-A, and TF-A is configured and
> > bundled with a device tree that gets passed along to U-Boot (using
> > OF_BOARD). Why on earth should TF-A be aware of internal DM
> > implementation details and build a device tree containing
> > u-boot,dm-pre-reloc, u-boot,dm-spl, dm-tpl, and every other
> > non-upstreamed nodes we have?
>
> I don't think this is a clear example, sorry. "dm-pre-reloc" etc are
> the bootph things now that you say could be useful. So they're an
> example of how (now that things are more receptive) we need to look at
> what U-Boot has that doesn't pass validation and see "does this make
> sense, today" or not.
>
The point here is a bit different though. We need this in U-Boot *because*
we use the DT to configure things. They are useful information, but unless
another bootloader uses the same config method, U-Boot is the only consumer.
If we could split those nodes in an internal u-boot .dtsi file that would
be much much cleaner. But IIRC we'll have problems with patching DTs in
TPL/SPL with limited memory.
> I guess I'm confused as to why it's a theoretical problem for TF-A to
> pass along /binman/ but not a problem to pass along
> /soc/.../snvs/.../linux,snvs_pwrkey on i.MX8. _Sometimes_ internals
It's the same problem and I don't think it's ok for TF-A to pass those as
either.
> just need to be there. That also does not mean every single should be
> there.
>
> > Another example would be the public key that we shoehorn on the DT.
> > In commit ddf67daac39d ("efi_capsule: Move signature from DTB to
> > .rodata") I tried to get rid of that because since I was aware of the
> > dt-schema conformance and honestly having the capsule public portion
> > of the key there makes little sense. Unfortunately, that got reverted
> > in commit 47a25e81d35c8 with a bogus commit message as well. So again
> > imagine building TF-A, which is a first-stage bootloader and has no
> > understanding of UEFI whatsoever, asking the TF-A project to start
> > injecting public keys around that has no idea why or how they will be
> > used.
> >
> > Can you imagine how the device tree would look like in a couple of
> > years from now if we allow *every* project to add its own special
> > config needs in there? So perhaps we should take a step back, agree
> > that some level of config is needed, identify the common options, and
> > add that to the spec instead of dumping everything that doesn't fit
> > somewhere else in there.
>
> Part of the problem here and now with capsule update stuff seems to be
> that, well, I don't know what the heck we should do. It's a "lovely"
> specification defined feature and so I honestly don't know how much
> leeway we have for how we can and can't represent and implement the
> portions that are left up to the implementation or board specific.
Heinrich and I can help on that. In short, the capsule update chapter
doesn't define where the key should be stored. It should obviously be on a
tamper resistant medium and it has a specific format, but that's as far as
the spec would go.
> I don't see why TF-A would inject something that should have been present
> already? And/or ...
I am not following you here. The public key is unique per class of
devices. If someone builds TF-A and decides to provide a DTB though that,
you then need to, unpack the TF-A binary when you build U-Boot, amend it
and repack it via binman. On top of that, those binaries will
probably be signed, so the repacking exercise becomes pretty painful.
>
> > > > > We already have reserved-memory, flash layout and other
> > > > > things which don't relate to hardware. I would love to somehome get
> > > > > past this fundamental discussion which seems to come up every time we
> > > > > get close to making progress
> > > >
> > > > Most of the nodes we already have were used across projects and made
> > > > sense to all of them. U-Boot might need to reserve some memory and so
> > > > does linux etc etc.
> > > > Some other nodes make nosense at all to and they just serve internal
> > > > ABI implementation details. I can't possibly fathom how these would
> > > > be justifiable. On top of all that, there's a huge danger here. How
> > > > are you planning on separating arbitrary entries from various
> > > > projects?
> > >
> > > I think in some ways this is the whole point of at least what I'm asking
> > > for. It's fine to say "Here is the mechanism to remove nodes /
> > > properties from the device tree". BUT adding entries to that list MUST
> > > document where someone tried to upstream and explain that this is
> > > something that belongs in the device tree because it is useful to
> > > everyone.
We never disagreed on that. I already said that the FWU link Sughosh sent
in the cover letter should be added on a doc. But that's irrelevant to
'hard NAKing' patches [0]. It's also the complete opposite of what we are
discussing here, since AFAICT you are fine with the removal mechanism as
long as the nodes-to-be-removed are documented properly and there has been
an upstream effort of those beforehand.
> >
> > And we don't disagree on that either. That's why the link to the FWU
> > discussion was there (although it should have been in a doc and not in
> > a mail). I am not arguing against adding nodes, I am arguing that we
> > shouldn't rush them and that there's zero chance that we manage to
> > upstream everything and keep some level of sanity on the spec.
> > So, since U-Boot is currently using the DT for its own configuration
> > needs, not having the ability to provide a DT that conforms to the
> > spec and hope that we can upstream everything will just delay all of
> > SystemReady 2.0 conformance efforts (and is unrealistic IMHO).
>
> The first problem is how does the capsule update specification specify
> handling the stuff that we put in the FWU nodes that we then need to
> delete?
>
It doesn't. The A/B update support is not part of the spec. FWU and the
A/B updates are designed on top of the EFI spec to provide an easy way to
do firmware updates without bricking the board while at the same time
provide rollback protection.
> The second problem is that I don't want the discussion link to just be
> in the cover letter, I want it in the tree, in documentation and heck,
> an unused-by-the-compiler parameter in the macro that adds a node to
> delete that is the rST file that documents the "we tried, it was
> rejected, this still makes sense" or whatever is appropriate as to why
> we're deleting the node. Cheaters shall cheat here, yes, but upstream
> will have a record of trying.
Again, we never disagreed on that
[0] https://lore.kernel.org/u-boot/CAPnjgZ3AexW4vfO-A8WYGE0OD5EZnOUA7tA1QP71Bcw51QArBQ@mail.gmail.com/
Thanks
/Ilias
>
> --
> Tom
next prev parent reply other threads:[~2023-09-12 6:03 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-26 9:06 [RFC PATCH 0/5] Allow for removal of DT nodes and properties Sughosh Ganu
2023-08-26 9:06 ` [RFC PATCH 1/5] dt: Provide a way to remove non-compliant " Sughosh Ganu
2023-08-26 10:22 ` Heinrich Schuchardt
2023-08-28 8:27 ` Sughosh Ganu
2023-08-26 10:39 ` Heinrich Schuchardt
2023-08-28 8:27 ` Sughosh Ganu
2023-08-28 18:08 ` Tom Rini
2023-08-26 9:06 ` [RFC PATCH 2/5] fwu: Add the fwu-mdata node for removal from devicetree Sughosh Ganu
2023-08-26 9:06 ` [RFC PATCH 3/5] capsule: Add the capsule-key property " Sughosh Ganu
2023-08-26 9:06 ` [RFC PATCH 4/5] bootefi: Call the EVT_FT_FIXUP event handler Sughosh Ganu
2023-08-26 10:27 ` Heinrich Schuchardt
2023-08-28 9:32 ` Sughosh Ganu
2023-08-28 10:57 ` Heinrich Schuchardt
2023-08-28 17:54 ` Simon Glass
2023-08-26 9:06 ` [RFC PATCH 5/5] doc: Add a document for non-compliant DT node/property removal Sughosh Ganu
2023-08-26 10:01 ` Heinrich Schuchardt
2023-08-28 10:18 ` Sughosh Ganu
2023-08-28 17:54 ` Simon Glass
2023-08-28 18:34 ` Sughosh Ganu
2023-08-28 18:39 ` Tom Rini
2023-08-30 7:24 ` Ilias Apalodimas
2023-08-30 14:22 ` Tom Rini
2023-08-31 2:49 ` Simon Glass
2023-08-31 7:52 ` Ilias Apalodimas
2023-08-31 13:28 ` Tom Rini
2023-08-29 17:25 ` Simon Glass
2023-08-30 6:37 ` Sughosh Ganu
2023-08-26 10:07 ` [RFC PATCH 0/5] Allow for removal of DT nodes and properties Heinrich Schuchardt
2023-08-28 8:31 ` Sughosh Ganu
2023-08-28 16:19 ` Simon Glass
2023-08-28 16:37 ` Peter Robinson
2023-08-28 17:53 ` Tom Rini
2023-08-28 17:54 ` Simon Glass
2023-08-28 20:29 ` Peter Robinson
2023-08-28 22:09 ` Simon Glass
2023-08-29 10:33 ` Peter Robinson
2023-08-29 20:31 ` Simon Glass
2023-08-30 8:19 ` Peter Robinson
2023-08-31 3:38 ` Simon Glass
2023-09-06 14:21 ` Rob Herring
2023-09-06 14:59 ` Simon Glass
2023-09-06 21:58 ` Tom Rini
2023-09-06 22:04 ` Tom Rini
2023-09-06 23:30 ` Heinrich Schuchardt
2023-09-07 1:59 ` Tom Rini
2023-09-07 5:20 ` Ilias Apalodimas
2023-09-07 12:23 ` Simon Glass
2023-09-08 10:13 ` Ilias Apalodimas
2023-09-08 14:54 ` Tom Rini
2023-09-08 15:28 ` Ilias Apalodimas
2023-09-11 19:06 ` Tom Rini
2023-09-12 6:03 ` Ilias Apalodimas [this message]
2023-09-08 14:37 ` Jassi Brar
2023-09-08 14:43 ` Tom Rini
2023-09-08 18:04 ` Mark Kettenis
2023-09-13 22:39 ` Rob Herring
2023-09-14 22:41 ` Simon Glass
2023-09-14 23:38 ` Tom Rini
2023-09-15 9:49 ` Ilias Apalodimas
2023-09-18 17:00 ` Rob Herring
2023-09-19 20:25 ` Simon Glass
2023-09-19 21:38 ` Tom Rini
2023-09-21 13:58 ` Rob Herring
2023-09-21 17:43 ` Simon Glass
2023-08-28 17:54 ` Tom Rini
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=ZP//RBE8nri1bd0d@hera \
--to=ilias.apalodimas@linaro.org \
--cc=pbrobinson@gmail.com \
--cc=robh@kernel.org \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/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.