From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
Alexander Dahl <ada@thorsis.com>,
Alexander Kochetkov <al.kochet@gmail.com>,
Alexander Sverdlin <alexander.sverdlin@siemens.com>,
Bin Meng <bmeng.cn@gmail.com>,
Caleb Connolly <caleb.connolly@linaro.org>,
Devarsh Thakkar <devarsht@ti.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Hugo Cornelis <hugo.cornelis@essensium.com>,
Igor Opaniuk <igor.opaniuk@gmail.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Janne Grunau <j@jannau.net>, Julien Masson <jmasson@baylibre.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Leo Yu-Chi Liang <ycliang@andestech.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Matthew Garrett <mgarrett@aurora.tech>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Maxim Moskalets <maximmosk4@gmail.com>,
Nikhil M Jain <n-jain1@ti.com>,
Paul-Erwan Rio <paulerwan.rio@gmail.com>,
Raymond Mao <raymond.mao@linaro.org>,
Roman Stratiienko <r.stratiienko@gmail.com>,
Sughosh Ganu <sughosh.ganu@linaro.org>
Subject: Re: [PATCH v2 17/33] boot: Update fit_image_get_emb_data to use abuf
Date: Fri, 10 Jan 2025 10:17:32 -0600 [thread overview]
Message-ID: <20250110161732.GI3476@bill-the-cat> (raw)
In-Reply-To: <CAFLszThn-XcHruFe60TH8FnsKsH08NFEco2zt+9JBHkneQgo0Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 7536 bytes --]
On Fri, Jan 10, 2025 at 06:39:11AM -0700, Simon Glass wrote:
> Hi Tom,
>
> On Thu, 9 Jan 2025 at 11:08, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Thu, Jan 09, 2025 at 08:14:53AM -0700, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Thu, 9 Jan 2025 at 08:10, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Thu, Jan 09, 2025 at 05:36:03AM -0700, Simon Glass wrote:
> > > > > Hi Tom,
> > > > >
> > > > > On Wed, 8 Jan 2025 at 11:25, Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Mon, Jan 06, 2025 at 07:32:13AM -0700, Simon Glass wrote:
> > > > > >
> > > > > > > This function uses separate arguments for data and size. Use the new
> > > > > > > abuf instead, so that they are paired and in one place. In some cases it
> > > > > > > also saves an argument, thus potentially reducing code size.
> > > > > >
> > > > > > This is one of the commits that globally increases size in both full
> > > > > > U-Boot and SPL/etc.
> > > > > >
> > > > > > Is all of the "abuf" changes just a "tidy up" that increases the code a
> > > > > > bit?
> > > > >
> > > > > Yes, a tidy-up which I hope will help overall. I have been thinking
> > > > > for a while of how to avoid having addr/size and ptr/size passed
> > > > > everywhere. For now abuf seems to provide some sort of solution.
> > > > >
> > > > > I see this:
> > > > >
> > > > > 18: boot: Update fit_image_get_emb_data to use abuf
> > > > > aarch64: (for 1/1 boards) all +4.0 bss -24.0 spl/u-boot-spl:all
> > > > > +16.0 spl/u-boot-spl:text +16.0 text +28.0
> > > > >
> > > > > so growth on firefly-rk3399 but not with rk3288. I am not sure if the
> > > > > growth will tail off as there are more users, though. We might even be
> > > > > able to be more clever with static inlines.
> > > >
> > > > Yeah, lets not do this now then and worry about some "clean up" later
> > > > when we can show that it does, or does not, improve size.
> > >
> > > Oh.
> > >
> > > > And there's
> > > > something wrong with your numbers:
> > > > 01: Fix neighbor discovery ethernet address saving
> > > > aarch64: w+ firefly-rk3399
> > > > +(firefly-rk3399) Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31
> > > > +(firefly-rk3399)
> > > > +(firefly-rk3399) /binman/simple-bin/fit/images/@atf-SEQ/atf-bl31 (atf-bl31):
> > > > +(firefly-rk3399) See the documentation for your board. You may need to build ARM Trusted
> > > > +(firefly-rk3399) Firmware and build with BL31=/path/to/bl31.bin
> > > > +(firefly-rk3399) Image 'simple-bin' is missing optional external blobs but is still functional: tee-os
> > > > +(firefly-rk3399) /binman/simple-bin/fit/images/@tee-SEQ/tee-os (tee-os):
> > > > +(firefly-rk3399) See the documentation for your board. You may need to build Open Portable
> > > > +(firefly-rk3399) Trusted Execution Environment (OP-TEE) and build with TEE=/path/to/tee.bin
> > > > +(firefly-rk3399) Some images are invalid
> > > > 37: dm: core: Provide ofnode_find_subnode_unit()
> > > > aarch64: (for 1/1 boards) all +324.0 bss +32.0 spl/u-boot-spl:all +16.0 spl/u-boot-spl:text +16.0 text +292.0
> > > > firefly-rk3399 : all +324 bss +32 spl/u-boot-spl:all +16 spl/u-boot-spl:text +16 text +292
> > > > u-boot: add: 6/-1, grow: 4/-4 bytes: 516/-224 (292)
> > > > function old new delta
> > > > ofnode_name_eq_unit - 160 +160
> > > > ofnode_find_subnode_unit - 116 +116
> > > > fit_image_get_data 80 176 +96
> > > > fit_image_get_emb_data - 84 +84
> > > > ofnode_write_prop 224 236 +12
> > > > ofnode_add_subnode 232 244 +12
> > > > abuf_init_const - 12 +12
> > > > abuf_init - 12 +12
> > > > abuf_addr - 8 +8
> > > > fit_image_print 780 784 +4
> > > > image_locate_script 696 692 -4
> > > > fit_image_load 1584 1580 -4
> > > > fit_image_verify 176 164 -12
> > > > ofnode_find_subnode 140 116 -24
> > > > fit_image_get_data_and_size 180 - -180
> > > > spl-u-boot-spl: add: 3/-1, grow: 0/-1 bytes: 108/-92 (16)
> > > > function old new delta
> > > > fit_image_get_emb_data - 84 +84
> > > > abuf_init_const - 12 +12
> > > > abuf_init - 12 +12
> > > > load_simple_fit 580 568 -12
> > > > fit_image_get_data 80 - -80
> > >
> > > Yes, that's the whole series, so not related to this change.
> >
> > Yes, that's the whole series including this change, so it's related to
> > this change.
>
> Right, but it is due to ofnode_find_subnode(), etc.
>
> >
> > > I elected to have two versions of ofnode_find_subnode() to avoid the
> > > size growth in the previous version. But the cost is larger size
> > > growth when OF_LIVE is used.
> > >
> > > Without OF_LIVE, the size growth is tiny.
> >
> > And even worse in SPL, somehow. But you want more OF_LIVE users, not
> > less, yes?
>
> Well, OF_LIVE is always quite a bit larger, at least at the moment. It
> has both Linux's of_access stuff and libfdt. It's not OF_LIVE I am
> bothered about, but I do want people using ofnode. Unfortunately
> people still send patches which use libfdt directly.
>
> >
> > > So...what to do?
> >
> > Well, if you drop the abuf changes for now, SPL won't change at all for
> > most platforms and that'll be an improvement.
>
> Yes, I'll look at that. This is one of many examples where I have a
> problem and realise that we need a nicer way of dealing with it, then
> implement it in the series, but then the series loses focus. So then I
> take it out again, then forget about it until next time, but I never
> actually make the change.
I hate to start to derail this, but refactor for "nicer code" is very
much subjective. Especially when it also grows the code (and it's not
clear that wider usage would result in shrinkage). So yes, this really
needs to be put aside and also part of why I keep asking for one thing
at a time.
> > And I'm going to keep complaining about size growth here because a
> > non-trivial subset of users just wants things to boot quickly and be
> > small.
>
> Yes, you won't get any complaints from me on that. I did propose some
> automated checking a few years back, but it never went anywhere.
It be great if buildman size comparison had some way to csv the output.
That's what's missing imo from being able to have some automation or
even just nicer tooling.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2025-01-10 16:17 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-06 14:31 [PATCH v2 00/33] upl: Prerequite patches for updated spec Simon Glass
2025-01-06 14:31 ` [PATCH v2 01/33] bloblist: add api to get blob with size Simon Glass
2025-01-06 14:31 ` [PATCH v2 02/33] bloblist: Drop BSD license Simon Glass
2025-01-07 10:36 ` Ilias Apalodimas
2025-01-07 12:04 ` Simon Glass
2025-01-06 14:31 ` [PATCH v2 03/33] bloblist: Make BLOBLIST_ALLOC the default Simon Glass
2025-01-06 21:41 ` Tom Rini
2025-01-09 15:01 ` Simon Glass
2025-01-09 16:42 ` Tom Rini
2025-01-10 13:38 ` Simon Glass
2025-01-06 14:32 ` [PATCH v2 04/33] abuf: Provide a way to get the buffer address Simon Glass
2025-01-06 14:32 ` [PATCH v2 05/33] abuf: Allow use in host tools Simon Glass
2025-01-06 14:32 ` [PATCH v2 06/33] abuf: Provide a constant buffer Simon Glass
2025-01-06 14:32 ` [PATCH v2 07/33] cpu: Provide a way to get the physical-address size Simon Glass
2025-01-06 14:32 ` [PATCH v2 08/33] serial: Support info() method in ns16550 xPL with UPL Simon Glass
2025-01-06 14:32 ` [PATCH v2 09/33] mkimage: Update map_to_sysmem() to match its prototype Simon Glass
2025-01-06 14:32 ` [PATCH v2 10/33] x86: Enable meminfo command Simon Glass
2025-01-06 14:32 ` [PATCH v2 11/33] x86: Show the timestamp counter with bdinfo Simon Glass
2025-01-06 14:32 ` [PATCH v2 12/33] ofnode: Use 4K for a default tree-size Simon Glass
2025-01-08 18:33 ` Tom Rini
2025-01-09 12:37 ` Simon Glass
2025-01-06 14:32 ` [PATCH v2 13/33] ofnode: Indicate when out of space in a few places Simon Glass
2025-01-08 18:25 ` Tom Rini
2025-01-06 14:32 ` [PATCH v2 14/33] ofnode: Update of_add_subnode() to indicate name is alloced Simon Glass
2025-01-06 14:32 ` [PATCH v2 15/33] boot: Rename fit_image_get_data() Simon Glass
2025-01-06 14:32 ` [PATCH v2 16/33] boot: Rename fit_image_get_data_and_size() Simon Glass
2025-01-06 14:32 ` [PATCH v2 17/33] boot: Update fit_image_get_emb_data to use abuf Simon Glass
2025-01-08 18:25 ` Tom Rini
2025-01-09 12:36 ` Simon Glass
2025-01-09 15:09 ` Tom Rini
2025-01-09 15:14 ` Simon Glass
2025-01-09 18:08 ` Tom Rini
2025-01-10 13:39 ` Simon Glass
2025-01-10 16:17 ` Tom Rini [this message]
2025-01-10 19:23 ` Simon Glass
2025-01-10 21:15 ` Tom Rini
2025-01-06 14:32 ` [PATCH v2 18/33] boot: Use fit_image_get_data() to get data Simon Glass
2025-01-06 14:32 ` [PATCH v2 19/33] boot: Update fit_image_get_data() to use abuf Simon Glass
2025-01-06 14:32 ` [PATCH v2 20/33] test: Fix inpected typo in upl test Simon Glass
2025-01-06 14:32 ` [PATCH v2 21/33] emulation: fdt: Relax condition for OF_HAS_PRIOR_STAGE Simon Glass
2025-01-06 21:40 ` Tom Rini
2025-01-09 15:01 ` Simon Glass
2025-01-09 15:14 ` Tom Rini
2025-01-10 13:38 ` Simon Glass
2025-01-06 14:32 ` [PATCH v2 22/33] emulation: Use bloblist to hold tables Simon Glass
2025-01-09 22:28 ` Tom Rini
2025-01-06 14:32 ` [PATCH v2 23/33] x86: Create more space for SPL with qemu-x86_64 Simon Glass
2025-01-06 14:32 ` [PATCH v2 24/33] pci: video: Set up the pixel-format field Simon Glass
2025-01-06 14:32 ` [PATCH v2 25/33] x86: Show an error if video fails Simon Glass
2025-01-06 14:32 ` [PATCH v2 26/33] x86: Support jumping to a UPL image Simon Glass
2025-01-06 14:32 ` [PATCH v2 27/33] x86: Enable UPL handoff for SPL Simon Glass
2025-01-06 14:32 ` [PATCH v2 28/33] x86: Move tables to use SZ macros Simon Glass
2025-01-06 14:32 ` [PATCH v2 29/33] x86: Align the SMBIOS table to a 4K boundary Simon Glass
2025-01-06 14:32 ` [PATCH v2 30/33] x86: emulation: Enable bloblist Simon Glass
2025-01-06 14:32 ` [PATCH v2 31/33] dm: core: Clarify behaviour of ofnode_name_eq() Simon Glass
2025-01-06 14:32 ` [PATCH v2 32/33] dm: core: Provide ofnode_name_eq_unit() to accept a unit address Simon Glass
2025-01-06 14:32 ` [PATCH v2 33/33] dm: core: Provide ofnode_find_subnode_unit() Simon Glass
2025-01-06 21:42 ` [PATCH v2 00/33] upl: Prerequite patches for updated spec Tom Rini
2025-01-08 18:37 ` Tom Rini
2025-01-09 12:37 ` Simon Glass
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=20250110161732.GI3476@bill-the-cat \
--to=trini@konsulko.com \
--cc=ada@thorsis.com \
--cc=al.kochet@gmail.com \
--cc=alexander.sverdlin@siemens.com \
--cc=bmeng.cn@gmail.com \
--cc=caleb.connolly@linaro.org \
--cc=devarsht@ti.com \
--cc=hugo.cornelis@essensium.com \
--cc=igor.opaniuk@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=j@jannau.net \
--cc=jmasson@baylibre.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=maximmosk4@gmail.com \
--cc=mgarrett@aurora.tech \
--cc=mkorpershoek@baylibre.com \
--cc=n-jain1@ti.com \
--cc=paulerwan.rio@gmail.com \
--cc=r.stratiienko@gmail.com \
--cc=raymond.mao@linaro.org \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
--cc=ycliang@andestech.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