[PATCH 0/7] efi: Various tidy-ups and drop the default

Mark Kettenis mark.kettenis at xs4all.nl
Mon Jun 28 10:38:50 CEST 2021


> From: Simon Glass <sjg at 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.

> 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.

> EFI_LOADER is required by EBBR, a new boot standard which aims to
> bring in UEFI protocols to U-Boot. But EBRR is not required for
> booting. U-Boot already provides support for FIT, the 'bootm' command
> and a suitable hand-off to Linux. EBRR has made the decision to create
> a parallel infrastructure, e.g. does not use FIT, nor U-Boot's signing
> infrastructure.

EFI_LOADER is required to boot FreeBSD and OpenBSD on several
platforms as well as generic Linux distros.  For example
OpenBSD/armv7, OpenBSD/arm64 and OpenBSD/riscv64 all rely on
EFI_LOADER to boot and have done so for the last 4 years.  The fact
that ARM has embraced UEFI as an embedded boot standard and branded it
EBBR really isn't all that relevant.

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.

> EBBR should be truly optional, enabled only by boards that use it. Most
> don't use it but it is enabled anyway. The default boot path should be
> one that makes use of the existing U-Boot support.

I don't particularly care about EBBR myself, but EFI_LOADER should be
the default for as many armv7/arm64/riscv U-Boot targets as possible
to give users an easy way to choose the OS they want to run on their
machines.  That is the best way to guarantee that vendors ship their
firmware with it enabled.

> To try to retify this situation, this series adds a new Kconfig option
> for EBBR so that the naming is more explicit. Then EFI_LOADER is updated
> to depend on it.

Isn't using the the term EBBR for non-ARM platforms misleading?
EFI_LOADER is used much more widely.  Anyway, I disagree with this
direction.

If size really matters here, we should look at reducing the EFI_LOADER
feature set to reduce the amount of code i adds, and maybe introduce
an EBBR option that can be enabled by those boards that desire full
EBBR compliance?

> For now, only sandbox enables EBBR. Other boards can be added as needed,
> presumably by distributions that require it. Another approach would be
> to add 'CONFIG_EBBR=y' to the .config before building, in the build
> system. That might be more friendly to U-Boot users.
> 
> This series also fixes a minor issue noticed during testing.
> 
> 
> Simon Glass (7):
>   configs: Resync with savedefconfig
>   Makefile: Drop include/asm directory as well as symlink
>   disk: Tidy up #ifdefs in part_efi
>   Use LIB_UUID with ACPIGEN and FS_BTRFS
>   Allow efi_loader header to be included always
>   lib: Create a new Kconfig option for charset conversion
>   efi: Make EBBR optional
> 
>  Makefile                                      |   2 +-
>  common/Kconfig.boot                           |  15 ++
>  configs/am335x_igep003x_defconfig             |   1 -
>  configs/am335x_pdu001_defconfig               |   1 -
>  configs/am64x_evm_a53_defconfig               |  31 ++-
>  configs/am64x_evm_r5_defconfig                |   6 +-
>  configs/apalis-imx8_defconfig                 |   1 -
>  configs/apalis-imx8x_defconfig                |   1 -
>  configs/aristainetos2c_defconfig              |   1 -
>  configs/aristainetos2ccslb_defconfig          |   1 -
>  ...edev_cc_v1_0_ultrazedev_som_v1_0_defconfig |   1 -
>  configs/bcm7260_defconfig                     |   1 -
>  configs/bcm7445_defconfig                     |   1 -
>  configs/bcm963158_ram_defconfig               |   1 -
>  configs/bcm968580xref_ram_defconfig           |   1 -
>  configs/bitmain_antminer_s9_defconfig         |   1 -
>  configs/bk4r1_defconfig                       |   1 -
>  configs/brppt1_mmc_defconfig                  |   1 -
>  configs/brppt1_nand_defconfig                 |   1 -
>  configs/brppt1_spi_defconfig                  |   1 -
>  configs/brppt2_defconfig                      |   1 -
>  configs/brsmarc1_defconfig                    |   1 -
>  configs/brxre1_defconfig                      |   1 -
>  configs/chromebook_coral_defconfig            |   1 -
>  configs/chromebook_link_defconfig             |   1 -
>  configs/colibri-imx8x_defconfig               |   1 -
>  configs/colibri_vf_defconfig                  |   1 -
>  configs/controlcenterdc_defconfig             |   1 -
>  configs/crs305-1g-4s-bit_defconfig            |   1 -
>  configs/crs305-1g-4s_defconfig                |   1 -
>  configs/crs326-24g-2s-bit_defconfig           |   1 -
>  configs/crs326-24g-2s_defconfig               |   1 -
>  configs/crs328-4c-20s-4s-bit_defconfig        |   1 -
>  configs/crs328-4c-20s-4s_defconfig            |   1 -
>  configs/deneb_defconfig                       |   1 -
>  configs/draco_defconfig                       |   2 +-
>  configs/dragonboard820c_defconfig             |   1 -
>  configs/efi-x86_app_defconfig                 |   1 -
>  configs/etamin_defconfig                      |   2 +-
>  configs/evb-ast2600_defconfig                 |   1 -
>  configs/evb-px30_defconfig                    |   1 -
>  configs/evb-rk3308_defconfig                  |   1 -
>  configs/firefly-px30_defconfig                |   1 -
>  configs/ge_bx50v3_defconfig                   |   1 -
>  configs/giedi_defconfig                       |   1 -
>  configs/grpeach_defconfig                     |   1 -
>  configs/imx8mm-cl-iot-gate_defconfig          |   8 -
>  configs/imx8qm_mek_defconfig                  |   1 -
>  configs/imx8qm_rom7720_a1_4G_defconfig        |   1 -
>  configs/imx8qxp_mek_defconfig                 |   1 -
>  configs/j7200_evm_r5_defconfig                |  15 +-
>  configs/j721e_evm_r5_defconfig                |  13 +-
>  configs/kontron_sl28_defconfig                |   2 -
>  configs/kp_imx53_defconfig                    |   1 -
>  configs/ls1028aqds_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls1028aqds_tfa_defconfig              |   1 -
>  configs/ls1028aqds_tfa_lpuart_defconfig       |   1 -
>  configs/ls1028ardb_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls1028ardb_tfa_defconfig              |   1 -
>  configs/ls1043aqds_defconfig                  |   1 -
>  configs/ls1043aqds_lpuart_defconfig           |   1 -
>  configs/ls1043aqds_nand_defconfig             |   1 -
>  configs/ls1043aqds_nor_ddr3_defconfig         |   1 -
>  configs/ls1043aqds_qspi_defconfig             |   1 -
>  configs/ls1043aqds_sdcard_ifc_defconfig       |   1 -
>  configs/ls1043aqds_sdcard_qspi_defconfig      |   1 -
>  configs/ls1043aqds_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls1043aqds_tfa_defconfig              |   1 -
>  configs/ls1043ardb_SECURE_BOOT_defconfig      |   1 -
>  configs/ls1043ardb_defconfig                  |   1 -
>  configs/ls1043ardb_nand_SECURE_BOOT_defconfig |   1 -
>  configs/ls1043ardb_nand_defconfig             |   1 -
>  .../ls1043ardb_sdcard_SECURE_BOOT_defconfig   |   1 -
>  configs/ls1043ardb_sdcard_defconfig           |   1 -
>  configs/ls1043ardb_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls1043ardb_tfa_defconfig              |   1 -
>  configs/ls1046aqds_SECURE_BOOT_defconfig      |   1 -
>  configs/ls1046aqds_defconfig                  |   1 -
>  configs/ls1046aqds_lpuart_defconfig           |   1 -
>  configs/ls1046aqds_nand_defconfig             |   1 -
>  configs/ls1046aqds_qspi_defconfig             |   1 -
>  configs/ls1046aqds_sdcard_ifc_defconfig       |   1 -
>  configs/ls1046aqds_sdcard_qspi_defconfig      |   1 -
>  configs/ls1046aqds_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls1046aqds_tfa_defconfig              |   1 -
>  configs/ls1046ardb_emmc_defconfig             |   1 -
>  configs/ls1046ardb_qspi_SECURE_BOOT_defconfig |   1 -
>  configs/ls1046ardb_qspi_defconfig             |   1 -
>  configs/ls1046ardb_qspi_spl_defconfig         |   1 -
>  .../ls1046ardb_sdcard_SECURE_BOOT_defconfig   |   1 -
>  configs/ls1046ardb_sdcard_defconfig           |   1 -
>  configs/ls1046ardb_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls1046ardb_tfa_defconfig              |   1 -
>  configs/ls1088aqds_qspi_SECURE_BOOT_defconfig |   1 -
>  configs/ls1088aqds_qspi_defconfig             |   1 -
>  configs/ls1088aqds_tfa_defconfig              |   1 -
>  configs/ls1088ardb_qspi_SECURE_BOOT_defconfig |   1 -
>  configs/ls1088ardb_qspi_defconfig             |   1 -
>  configs/ls1088ardb_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls1088ardb_tfa_defconfig              |   1 -
>  configs/ls2080aqds_SECURE_BOOT_defconfig      |   1 -
>  configs/ls2080aqds_defconfig                  |   1 -
>  configs/ls2080aqds_nand_defconfig             |   1 -
>  configs/ls2080aqds_qspi_defconfig             |   1 -
>  configs/ls2080aqds_sdcard_defconfig           |   1 -
>  configs/ls2080ardb_SECURE_BOOT_defconfig      |   1 -
>  configs/ls2080ardb_defconfig                  |   1 -
>  configs/ls2080ardb_nand_defconfig             |   1 -
>  configs/ls2081ardb_defconfig                  |   1 -
>  configs/ls2088aqds_tfa_defconfig              |   1 -
>  configs/ls2088ardb_qspi_SECURE_BOOT_defconfig |   1 -
>  configs/ls2088ardb_qspi_defconfig             |   1 -
>  configs/ls2088ardb_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/ls2088ardb_tfa_defconfig              |   1 -
>  configs/lx2160aqds_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/lx2160aqds_tfa_defconfig              |   1 -
>  configs/lx2160ardb_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/lx2160ardb_tfa_defconfig              |   1 -
>  configs/lx2160ardb_tfa_stmm_defconfig         |   4 -
>  configs/lx2162aqds_tfa_SECURE_BOOT_defconfig  |   1 -
>  configs/lx2162aqds_tfa_defconfig              |   1 -
>  .../lx2162aqds_tfa_verified_boot_defconfig    |   1 -
>  configs/mt7623n_bpir2_defconfig               |   1 -
>  configs/mt7629_rfb_defconfig                  |   1 -
>  configs/mt8183_pumpkin_defconfig              |   1 -
>  configs/mt8516_pumpkin_defconfig              |   1 -
>  configs/mvebu_puzzle-m801-88f8040_defconfig   |   1 -
>  configs/mx6memcal_defconfig                   |   1 -
>  configs/octeontx2_95xx_defconfig              |   1 -
>  configs/octeontx2_96xx_defconfig              |   1 -
>  configs/octeontx_81xx_defconfig               |   1 -
>  configs/octeontx_83xx_defconfig               |   1 -
>  configs/omap4_sdp4430_defconfig               |   1 -
>  configs/opos6uldev_defconfig                  |   1 -
>  configs/pcm052_defconfig                      |   1 -
>  configs/phycore-am335x-r2-regor_defconfig     |   1 -
>  configs/phycore-am335x-r2-wega_defconfig      |   1 -
>  configs/pxm2_defconfig                        |   2 +-
>  configs/qemu-riscv32_defconfig                |   2 -
>  configs/qemu-riscv32_smode_defconfig          |   2 -
>  configs/qemu-riscv64_defconfig                |   2 -
>  configs/qemu-riscv64_smode_defconfig          |   2 -
>  configs/qemu-x86_64_defconfig                 |   2 -
>  configs/qemu-x86_defconfig                    |   2 -
>  configs/qemu_arm64_defconfig                  |   2 -
>  configs/qemu_arm_defconfig                    |   2 -
>  configs/rastaban_defconfig                    |   2 +-
>  configs/roc-cc-rk3308_defconfig               |   1 -
>  configs/rock-pi-n10-rk3399pro_defconfig       |   1 -
>  configs/rock-pi-n8-rk3288_defconfig           |   1 -
>  configs/rpi_0_w_defconfig                     |   1 -
>  configs/rpi_defconfig                         |   1 -
>  configs/rut_defconfig                         |   2 +-
>  configs/sama5d27_wlsom1_ek_mmc_defconfig      |   1 -
>  .../sama5d27_wlsom1_ek_qspiflash_defconfig    |   1 -
>  configs/sama5d2_icp_mmc_defconfig             |   1 -
>  configs/sama7g5ek_mmc1_defconfig              |   1 -
>  configs/sama7g5ek_mmc_defconfig               |   1 -
>  configs/sipeed_maix_bitm_defconfig            |   1 -
>  configs/sipeed_maix_smode_defconfig           |   1 -
>  configs/socfpga_de1_soc_defconfig             |   1 -
>  configs/somlabs_visionsom_6ull_defconfig      |   1 -
>  configs/stemmy_defconfig                      |   1 -
>  configs/stm32mp15_basic_defconfig             |   3 -
>  configs/stm32mp15_trusted_defconfig           |   3 -
>  configs/tbs2910_defconfig                     |   1 -
>  configs/thuban_defconfig                      |   2 +-
>  configs/vf610twr_defconfig                    |   1 -
>  configs/vf610twr_nand_defconfig               |   1 -
>  configs/xenguest_arm64_defconfig              |   1 -
>  configs/xilinx_versal_mini_defconfig          |   1 -
>  configs/xilinx_versal_mini_emmc0_defconfig    |   1 -
>  configs/xilinx_versal_mini_emmc1_defconfig    |   1 -
>  configs/xilinx_versal_virt_defconfig          |   2 -
>  configs/xilinx_zynqmp_mini_defconfig          |   1 -
>  configs/xilinx_zynqmp_mini_emmc0_defconfig    |   1 -
>  configs/xilinx_zynqmp_mini_emmc1_defconfig    |   1 -
>  configs/xilinx_zynqmp_mini_nand_defconfig     |   1 -
>  .../xilinx_zynqmp_mini_nand_single_defconfig  |   1 -
>  configs/xilinx_zynqmp_mini_qspi_defconfig     |   1 -
>  configs/xilinx_zynqmp_r5_defconfig            |   1 -
>  configs/xilinx_zynqmp_virt_defconfig          |   9 -
>  configs/zynq_cse_nand_defconfig               |   1 -
>  configs/zynq_cse_nor_defconfig                |   1 -
>  configs/zynq_cse_qspi_defconfig               |   1 -
>  disk/part_efi.c                               |  11 +-
>  drivers/core/Kconfig                          |   1 +
>  fs/btrfs/Kconfig                              |   1 +
>  include/efi_loader.h                          | 186 +++++++++---------
>  lib/Kconfig                                   |   8 +
>  lib/Makefile                                  |   2 +-
>  lib/efi_loader/Kconfig                        |   5 +-
>  192 files changed, 160 insertions(+), 353 deletions(-)
> 
> -- 
> 2.32.0.93.g670b81a890-goog
> 
> 


More information about the U-Boot mailing list