public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	"Robert Marko" <robert.marko@sartura.hr>,
	"Andre Przywara" <andre.przywara@arm.com>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"AKASHI Takahiro" <takahiro.akashi@linaro.org>,
	"Adam Ford" <aford173@gmail.com>,
	"Alexandru Gagniuc" <mr.nuke.me@gmail.com>,
	"Alexey Brodkin" <alexey.brodkin@synopsys.com>,
	"Andrii Anisov" <andrii_anisov@epam.com>,
	"Asherah Connor" <ashe@kivikakk.ee>,
	"Bastian Krause" <bst@pengutronix.de>,
	"Chan, Donald" <hoiho@lab126.com>,
	"Chee Hong Ang" <chee.hong.ang@intel.com>,
	"Chin-Liang See" <chin.liang.see@intel.com>,
	"Christian Gmeiner" <christian.gmeiner@gmail.com>,
	"Dinh Nguyen" <dinh.nguyen@intel.com>,
	"Etienne Carriere" <etienne.carriere@linaro.org>,
	"Eugeniy Paltsev" <Eugeniy.Paltsev@synopsys.com>,
	"Fabien Parent" <fparent@baylibre.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Frieder Schrempf" <frieder.schrempf@kontron.de>,
	"Frédéric Danis" <frederic.danis@collabora.com>,
	"George McCollister" <george.mccollister@gmail.com>,
	"Giulio Benetti" <giulio.benetti@benettiengineering.com>,
	"Harald Seiler" <hws@denx.de>, "Heiko Schocher" <hs@denx.de>,
	"Heiko Stuebner" <heiko.stuebner@theobroma-systems.com>,
	"Hongwei Zhang" <hongweiz@ami.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	"Jan Luebbe" <jlu@pengutronix.de>,
	"Jernej Skrabec" <jernej.skrabec@siol.net>,
	"Joe Hershberger" <joe.hershberger@ni.com>,
	"Joel Peshkin" <joel.peshkin@broadcom.com>,
	"Joel Stanley" <joel@jms.id.au>, "Jonathan Gray" <jsg@jsg.id.au>,
	"Jorge Ramirez-Ortiz" <jorge@foundries.io>,
	"Kever Yang" <kever.yang@rock-chips.com>,
	"Klaus Heinrich Kiwi" <klaus@linux.vnet.ibm.com>,
	"Ley Foon Tan" <ley.foon.tan@intel.com>,
	"Lukasz Majewski" <lukma@denx.de>,
	"Marcin Juszkiewicz" <marcin@juszkiewicz.com.pl>,
	"Marek Behun" <marek.behun@nic.cz>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Marek Vasut" <marex@denx.de>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Matthieu CASTET" <castet.matthieu@free.fr>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Michal Simek" <monstr@monstr.eu>,
	"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	"Naoki Hayama" <naoki.hayama@lineo.co.jp>,
	"Oleksandr Andrushchenko" <oleksandr_andrushchenko@epam.com>,
	"Ovidiu Panait" <ovidiu.panait@windriver.com>,
	"Pali Rohár" <pali@kernel.org>,
	"Patrick Delaunay" <patrick.delaunay@foss.st.com>,
	"Patrick Oppenlander" <patrick.oppenlander@gmail.com>,
	"Peng Fan" <peng.fan@nxp.com>,
	"Philippe Reynes" <philippe.reynes@softathome.com>,
	"Pragnesh Patel" <pragnesh.patel@sifive.com>,
	"Qu Wenruo" <wqu@suse.com>,
	"Rasmus Villemoes" <rasmus.villemoes@prevas.dk>,
	"Reuben Dowle" <reubendowle0@gmail.com>,
	"Rick Chen" <rick@andestech.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Sean Anderson" <sean.anderson@seco.com>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	"Siew Chin Lim" <elly.siew.chin.lim@intel.com>,
	"Stefan Roese" <sr@denx.de>, "Stefano Babic" <sbabic@denx.de>,
	"Suniel Mahesh" <sunil@amarulasolutions.com>,
	"T Karthik Reddy" <t.karthik.reddy@xilinx.com>,
	"Tero Kristo" <t-kristo@ti.com>,
	"Thirupathaiah Annapureddy" <thiruan@linux.microsoft.com>,
	"Trevor Woerner" <twoerner@gmail.com>,
	"Wasim Khan" <wasim.khan@nxp.com>, chenshuo <chenshuo@eswin.com>,
	linux-btrfs@vger.kernel.org, uboot-snps-arc@synopsys.com
Subject: Re: [PATCH 00/49] image: Reduce #ifdefs and ad-hoc defines in image code
Date: Tue, 4 May 2021 17:40:16 -0400	[thread overview]
Message-ID: <20210504214016.GA17669@bill-the-cat> (raw)
In-Reply-To: <20210503231136.744283-1-sjg@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 5723 bytes --]

On Mon, May 03, 2021 at 05:10:47PM -0600, Simon Glass wrote:

> Much of the image-handling code predates the introduction of Kconfig and
> has quite a few #ifdefs in it. It also uses its own IMAGE_... defines to
> help reduce the #ifdefs, which is unnecessary now that we can use
> IS_ENABLED() et al.
> 
> The image code is also where quite a bit of code is shared with the host
> tools. At present this uses a lot of checks of USE_HOSTCC.
> 
> This series introduces 'host' Kconfig options and a way to use
> CONFIG_IS_ENABLED() to check them. This works in a similar way to SPL, so
> 
>    CONFIG_IS_ENABLED(FIT)
> 
> will evaluate to true on the host build (USE_HOSTCC) if CONFIG_HOST_FIT is
> enabled. This allows quite a bit of clean-up of the image.h header file
> and many of the image C files.
> 
> The 'host' Kconfig options should help to solve a more general problem in
> that we mostly want the host tools to build with all features enabled, no
> matter which features the 'target' build actually uses. This is a pain to
> arrange at present, but with 'host' Kconfigs, we can just define them all
> to y.
> 
> There are cases where the host tools do not have features which are
> present on the target, for example environment and physical addressing.
> To help with this, some of the core image code is split out into
> image-board.c and image-host.c files.
> 
> Even with these changes, some #ifdefs remain (101 down to 42 in
> common/image*). But the code is somewhat easier to follow and there are
> fewer build paths.
> 
> In service of the above, this series includes a patch to add an API function
> for zstd, so the code can be dropped from bootm.c
> 
> It also introduces a function to handle manual relocation.

I like this idea overall.  The good news is this reduces the size in a
few places.  The bad news, but I can live with if we can't restructure
the changes more, is a few functions grow a bit.  This shows the good
and the bad (something like sama5d2_ptc_ek_mmc shows only growth, to be
clear):
            px30-core-edimm2.2-px30: all -36 rodata -24 text -12
               u-boot: add: 0/0, grow: 3/-4 bytes: 36/-48 (-12)
                 function                                   old     new   delta
                 boot_get_fdt                               896     924     +28
                 image_decomp                               372     376      +4
                 boot_get_ramdisk                           868     872      +4
                 do_bootm_vxworks                           552     540     -12
                 do_bootm_rtems                             124     112     -12
                 do_bootm_plan9                             228     216     -12
                 do_bootm_netbsd                            324     312     -12
            odroid-c2      : all -105 bss +128 rodata -65 text -168
               u-boot: add: 0/0, grow: 2/-3 bytes: 108/-172 (-64)
                 function                                   old     new   delta
                 images                                     504     608    +104
                 image_decomp                               372     376      +4
                 image_setup_linux                          108      96     -12
                 boot_get_ramdisk                           620     580     -40
                 boot_get_fdt                               660     540    -120
            origen         : all +47 bss +96 rodata -57 text +8
               u-boot: add: 0/0, grow: 15/-2 bytes: 180/-104 (76)
                 function                                   old     new   delta
                 images                                     288     340     +52
                 do_bootm_states                           1304    1348     +44
                 do_bootz                                   164     176     +12
                 do_bootm_vxworks                           332     344     +12
                 image_setup_libfdt                         168     176      +8
                 image_decomp                               156     164      +8
                 bootm_find_images                          212     220      +8
                 boot_prep_linux                            276     284      +8
                 image_setup_linux                           54      58      +4
                 do_bootm_standalone                         60      64      +4
                 do_bootm_plan9                             104     108      +4
                 do_bootm_netbsd                            168     172      +4
                 boot_prep_vxworks                           48      52      +4
                 boot_jump_vxworks                            6      10      +4
                 boot_jump_linux                            148     152      +4
                 boot_get_ramdisk                           420     392     -28
                 boot_get_fdt                               420     344     -76

And looking at ls1088ardb_sdcard_qspi_SECURE_BOOT I think there might be
something wrong as that looks to drop all crypto algos from SPL.  Other
layerscape SECURE_BOOT configs show this as well.  It does however seem
to clear up some other issues around unused code, so a deeper dive on
which patch is dropping stuff is needed.  I see a huge drop on
am65x_evm_a53 / j721e_evm_a72 SPL as well but I can test those and at
least the basic case is fine.  socfpga_agilex_atf is one I don't know
about being right or wrong.  socfpga_agilex_vab dropping hashing code
does look worrying however, but maybe it's a configuration issue in the
end?

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  parent reply	other threads:[~2021-05-04 21:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 23:10 [PATCH 00/49] image: Reduce #ifdefs and ad-hoc defines in image code Simon Glass
2021-05-03 23:10 ` [PATCH 04/49] btrfs: Use U-Boot API for decompression Simon Glass
2021-05-03 23:25   ` Qu Wenruo
2021-05-03 23:45   ` Marek Behun
2021-05-04 16:58     ` Simon Glass
2021-05-04 21:40 ` Tom Rini [this message]
2021-05-04 21:49   ` [PATCH 00/49] image: Reduce #ifdefs and ad-hoc defines in image code Simon Glass
2021-05-04 23:24   ` Sean Anderson
2021-05-05  1:11     ` Tom Rini
2021-05-05 23:38   ` 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=20210504214016.GA17669@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=aford173@gmail.com \
    --cc=alexey.brodkin@synopsys.com \
    --cc=andre.przywara@arm.com \
    --cc=andrii_anisov@epam.com \
    --cc=ashe@kivikakk.ee \
    --cc=bmeng.cn@gmail.com \
    --cc=bst@pengutronix.de \
    --cc=castet.matthieu@free.fr \
    --cc=chee.hong.ang@intel.com \
    --cc=chenshuo@eswin.com \
    --cc=chin.liang.see@intel.com \
    --cc=christian.gmeiner@gmail.com \
    --cc=dinh.nguyen@intel.com \
    --cc=elly.siew.chin.lim@intel.com \
    --cc=etienne.carriere@linaro.org \
    --cc=festevam@gmail.com \
    --cc=fparent@baylibre.com \
    --cc=frederic.danis@collabora.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=george.mccollister@gmail.com \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=heiko.stuebner@theobroma-systems.com \
    --cc=hoiho@lab126.com \
    --cc=hongweiz@ami.com \
    --cc=hs@denx.de \
    --cc=hws@denx.de \
    --cc=jagan@amarulasolutions.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jernej.skrabec@siol.net \
    --cc=jlu@pengutronix.de \
    --cc=joe.hershberger@ni.com \
    --cc=joel.peshkin@broadcom.com \
    --cc=joel@jms.id.au \
    --cc=jorge@foundries.io \
    --cc=jsg@jsg.id.au \
    --cc=kever.yang@rock-chips.com \
    --cc=klaus@linux.vnet.ibm.com \
    --cc=ley.foon.tan@intel.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lukma@denx.de \
    --cc=m.szyprowski@samsung.com \
    --cc=marcin@juszkiewicz.com.pl \
    --cc=marek.behun@nic.cz \
    --cc=marex@denx.de \
    --cc=masahiroy@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=mr.nuke.me@gmail.com \
    --cc=naoki.hayama@lineo.co.jp \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=ovidiu.panait@windriver.com \
    --cc=pali@kernel.org \
    --cc=patrick.delaunay@foss.st.com \
    --cc=patrick.oppenlander@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=philippe.reynes@softathome.com \
    --cc=pragnesh.patel@sifive.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=reubendowle0@gmail.com \
    --cc=rick@andestech.com \
    --cc=robert.marko@sartura.hr \
    --cc=samuel@sholland.org \
    --cc=sbabic@denx.de \
    --cc=sean.anderson@seco.com \
    --cc=seanga2@gmail.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=sunil@amarulasolutions.com \
    --cc=t-kristo@ti.com \
    --cc=t.karthik.reddy@xilinx.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=thiruan@linux.microsoft.com \
    --cc=twoerner@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=uboot-snps-arc@synopsys.com \
    --cc=wasim.khan@nxp.com \
    --cc=wqu@suse.com \
    --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