public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Pali Roh??r <pali@kernel.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Alex Graf <agraf@csgraf.de>,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: Re: [PATCH 0/7] efi: Various tidy-ups and drop the default
Date: Tue, 29 Jun 2021 21:56:13 +0900	[thread overview]
Message-ID: <20210629125613.GA48515@laputa> (raw)
In-Reply-To: <CAPnjgZ0ySVLv9=rp-QWxiJkBojkvjuR5wPdZmg=twnEEpJ3nkQ@mail.gmail.com>

On Mon, Jun 28, 2021 at 12:08:27PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Mon, 28 Jun 2021 at 11:27, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Mon, Jun 28, 2021 at 10:26:35AM -0600, Simon Glass wrote:
> > > Hi Heinrich,
> > >
> > > On Mon, 28 Jun 2021 at 09:20, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> > > >
> > > > On 6/28/21 4:18 PM, Simon Glass wrote:
> > > > > Hi Tom, Mark,
> > > > >
> > > > > On Mon, 28 Jun 2021 at 07:37, Tom Rini <trini@konsulko.com> wrote:
> > > > >>
> > > > >> On Mon, Jun 28, 2021 at 10:38:50AM +0200, Mark Kettenis wrote:
> > > > >>>> From: Simon Glass <sjg@chromium.org>
> > > > >>>> Date: Sun, 27 Jun 2021 19:48:34 -0600
> > > > >>>>
> > > > >>>> It has come to light that EFI_LOADER adds an extraordinary amount of
> > > > >>>> code to U-Boot. For example, with nokia_rx51 the size delta is about
> > > > >>>> 90KB. About 170 boards explicitly disable the option, but is is clear
> > > > >>>> that many more could, thus saving image size and boot time.
> > > > >>>
> > > > >>> EFI_LOADER used to be a lot smaller.  It is great to see that over the
> > > > >>> years UEFI support has become more complete, but a lot of that new
> > > > >>> code implements features that are not at all essential for just
> > > > >>> booting an OS from storage.  If that growth leads to the suggestion to
> > > > >>> disable EFI_LOADER completely by default, we're putting the cart
> > > > >>> before the horse.
> > > > >>
> > > > >> Well, I see I forgot to prefix my patch with RFC, but I hadn't found
> > > > >> EFI_LOADER being used in the wild on armv7, but wasn't sure about the
> > > > >> BSD families.  I did see that Debian doesn't use it, and that Armbian
> > > > >> doesn't even use it on aarch64.
> > > > >>
> > > > >>>> The current situation is affecting U-Boot's image as a svelt bootloader.
> > > > >>>
> > > > >>> Really?  I know UEFI has a bad reputation in the Open Source world,
> > > > >>> and some of its Microsoft-isms are really annoying (yay UCS-2).  But
> > > > >>> it works, it provides a standardized approach across several platforms
> > > > >>> (ARMv7, AMRv8, RISC-V) and the industry seems to like it.  Personally
> > > > >>> I'd wish the industry had standardized on Open Firmware instead, but
> > > > >>> that ship sailed a long time ago...
> > > > >>>
> > > > >>> I find it hard to imagine that 90k is a serious amount of storage for
> > > > >>> something that is going to include a multi-MB Linux kernel.  This
> > > > >>> isn't code that lives in SPL or TPL where severe size restrictions
> > > > >>> apply.
> > > > >>
> > > > >> In one of those cases where I need to pop back in to the other (Nokia
> > > > >> N900 specific) thread and see if the big size reduction really was just
> > > > >> disabling EFI_LOADER, it's perhaps just one of those "fun" things about
> > > > >> Kconfig and anything other than "make oldconfig" for spotting new config
> > > > >> options that default to enabled.
> > > > >
> > > > > Yes it will be interesting to see what you find there. My results on
> > > > > nokia_rx51 were something like this:
> > > > >
> > > > > default
> > > > >         arm: (for 1/1 boards) all +129370.0 bss +1136.0 data +7399.0
> > > > > rodata +10989.0 text +109846.0
> > > > >
> > > > > without ebbr
> > > > >        arm: (for 1/1 boards) all +38460.0 bss +1040.0 data +2375.0
> > > > > rodata +5333.0 text +29712.0
> > > > >
> > > > > with various other things:
> > > > > CONFIG_OF_LIBFDT_ASSUME_MASK=7
> > > > > # CONFIG_OF_TRANSLATE is not set
> > > > > # CONFIG_SIMPLE_BUS is not set
> > > > > # CONFIG_TI_SYSC is not set
> > > > > # CONFIG_CMD_FDT is not set
> > > > >
> > > > >        arm: (for 1/1 boards) all +19170.0 bss -16.0 data +360.0 rodata
> > > > > +3274.0 text +15552.0
> > > > >
> > > > > (Mark, in the same email:)
> > > > >>> FIT simply isn't fit for purpose (pun intended).  It only really works
> > > > >>> for booting Linux, and forces people to combine u-boot, kernel,
> > > > >>> initial ramdisk and other firmware components into a single image.
> > > > >>> That is really undesirable as:
> > > > >>> - This makes it sigificantly harder to update individual components of
> > > > >>>   such an image.  Making it hard to update a kernel is obviously a
> > > > >>>   serious security risk.
> > > > >>> - This makes it impossible to build an OS install image that works om
> > > > >>>   multiple boards/SoCs.
> > > > >
> > > > >
> > > > > I would really like to understand this better. The whole thing is a
> > > > > complete mystery to me.
> > > > >
> > > > > Firstly I have sometimes fiddled with booting other OSes using FIT. It
> > > > > seemed OK. I can't see why it only works with Linux.
> > > > >
> > > > > Secondly, I don't expect that U-Boot itself would be in the FIT.
> > > > >
> > > > > Thirdly, do you really want the kernel and initrd to be separate? At
> > > > > least in the systems I have used, they are built together, even having
> > > > > the same name, e.g.:
> > > > >
> > > > > initrd.img-5.10.40-1rodete1-amd64
> > > > > System.map-5.10.40-1rodete1-amd64
> > > > > vmlinuz-5.10.28-1rodete2-amd64
> > > >
> > > > I have not hit any distro that builds FIT images. All install vmlinux
> > > > and initrd as separate files.
> > > >
> > > > Why would you want to change that?
> > >
> > > Well there is no point in having two files if one will do. Also it
> > > allows for a hash / signature check.
> >
> > The question of "how great would it be and how many problems would it
> > have solved if FIT images had become popular" is one for another time.
> > It will always have its use cases and users but never the broad adoption
> > many of us felt it should have.  Bringing it up in this context won't
> > change that.
> 
> I see Peter's reply below so will make time to dig into this and
> understand the problems with FIT better. I feel that EFI comes with
> all sorts of problems so I'm far from convinced, at this point. Sorry.

It seems to me that we are discussing three different things:
- the code size increase by enabling UEFI interfaces
- how the UEFI interface be implemented on U-Boot
- The primary (or default/standard) boot mechanism in the future

I don't think they are totally independent, but we'd better
distinguish them some how in the following discussions.

> >
> > I'm saying this because I think there are some important technical
> > questions within U-Boot to resolve because the EFI loader part of U-Boot
> > is critical to our long term future.  And DM is an important part of our
> > internal design and we're (probably later than I should have) pulling
> > out the parts that haven't been updated so that we can deliver on some
> > of the overall promise of DM better, too.
> 
> Yes, migration has certainly been slow. As you know I mostly stopped
> pushing it a few years back when I saw all the reluctance. I'm very
> pleased you are taking that on and I think it will help a lot.

I posted this patch[1] two years ago and I thought that we had had
some sort of consensus that UEFI interfaces be integrated more elegantly
with DM in the future.

So I was a bit surprised with Heinrich's recent patch.

In [1], I was trying to define all the UEFI handles, including some
protocols?, as DM objects.
I thought that it was the best way for unifying the two worlds even if
there are no corresponding *notions* in the existing DM objects.

[1] https://lists.denx.de/pipermail/u-boot/2019-February/357923.html

-Takahiro Akashi


> If what you say comes to pass, it is even more important that EFI is
> more integrated, rather than being a bolt on. Thanks largely to
> Heinrich, the tests are in quite good shape, so refactoring should be
> feasible.
> 
> Regards,
> Simon

  reply	other threads:[~2021-06-29 12:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  1:48 [PATCH 0/7] efi: Various tidy-ups and drop the default Simon Glass
2021-06-28  1:48 ` [PATCH 1/7] configs: Resync with savedefconfig Simon Glass
2021-06-28  1:48 ` [PATCH 2/7] Makefile: Drop include/asm directory as well as symlink Simon Glass
2021-06-28  1:48 ` [PATCH 3/7] disk: Tidy up #ifdefs in part_efi Simon Glass
2021-06-28 11:20   ` Heinrich Schuchardt
2021-06-28 13:50     ` Tom Rini
2021-06-28 16:18       ` Heinrich Schuchardt
2021-06-28  1:48 ` [PATCH 4/7] Use LIB_UUID with ACPIGEN and FS_BTRFS Simon Glass
2021-06-28  1:48 ` [PATCH 5/7] Allow efi_loader header to be included always Simon Glass
2021-06-28 11:02   ` Heinrich Schuchardt
2021-06-28  1:48 ` [PATCH 6/7] lib: Create a new Kconfig option for charset conversion Simon Glass
2021-06-28 10:37   ` Heinrich Schuchardt
2021-06-28  1:48 ` [PATCH 7/7] efi: Make EBBR optional Simon Glass
2021-06-28  9:48   ` Heinrich Schuchardt
2021-06-28 13:48     ` Tom Rini
2021-06-28  8:38 ` [PATCH 0/7] efi: Various tidy-ups and drop the default Mark Kettenis
2021-06-28  8:59   ` Ilias Apalodimas
2021-06-28 13:37   ` Tom Rini
2021-06-28 14:18     ` Simon Glass
2021-06-28 15:20       ` Heinrich Schuchardt
2021-06-28 16:26         ` Simon Glass
2021-06-28 17:09           ` Heinrich Schuchardt
2021-06-28 18:02             ` Simon Glass
2021-06-28 17:27           ` Tom Rini
2021-06-28 18:08             ` Simon Glass
2021-06-29 12:56               ` AKASHI Takahiro [this message]
2021-06-29 14:01                 ` Heinrich Schuchardt
2021-06-29 14:14                   ` AKASHI Takahiro
2021-06-28 17:49       ` Mark Kettenis
2021-07-02 19:05         ` Simon Glass
2021-07-02 19:48           ` Mark Kettenis
2021-07-02 20:09             ` Tom Rini
2021-07-02 20:47             ` Simon Glass
2021-06-28 14:25     ` Heinrich Schuchardt

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=20210629125613.GA48515@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=pali@kernel.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=yamada.masahiro@socionext.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