[PATCH v3 00/22] passage: Define a standard for firmware data flow

Simon Glass sjg at chromium.org
Tue Apr 29 16:33:16 CEST 2025


Hi Raymond,

On Mon, 28 Apr 2025 at 08:41, Raymond Mao <raymond.mao at linaro.org> wrote:
>
> Hi Simon,
>
> On Thu, 17 Apr 2025 at 14:16, Simon Glass <sjg at chromium.org> wrote:
> >
> >
> > This series adds a standard way of passing information between different
> > firmware phases. This already exists in U-Boot at a very basic level, in
> > the form of a bloblist containing an spl_handoff structure, but the intent
> > here is to define something useful across projects.
> >
> > The need for this is growing as firmware fragments into multiple binaries
> > each with its own purpose. Without any run-time connection, we must rely
> > on build-time settings which are brittle and painful to keep in sync.
> >
> > This feature is named 'standard passage' since the name is more unique
> > than many others that could be chosen, it is a passage in the sense that
> > information is flowing from one place to another and it is standard,
> > because that is what we want to create.
> >
> > The implementation is mostly a pointer to a bloblist in a register, with
> > an extra register to point to a devicetree, for more complex data. This
> > should cover all cases (small memory footprint as well as complex data
> > flow) and be easy enough to implement on all architectures.
> >
> > The emphasis is on enabling open communcation between binaries, not
> > enabling passage of secret, undocumented data, although this is possible
> > in a private environment.
> >
> > This series is available at u-boot-dm/pass-working
> >
>
> First of all, can you group those patches which are necessary for
> refactoring the "passage" concept into a smaller series for an easy
> review?

What do you mean by refactoring? I don't believe my series has much
value unless it actually brings in 'standard passage' and everything
that goes with that, e.g. the validation and documentation.

>
> Actually as I mentioned in our previous discussions, I don't agree to
> add a OF_BLOBLIST as this is duplicated with "BLOBLIST +
> BLOBLIST_PASSAGE_MANDATORY (aka PASSAGE_IN in the context of your
> patch - I am not sure the reason you prefer to rename it - do we have
> any other passage approaches other than using bloblist? And do you
> have any considerations to allow a fallback or not in case passage
> failures?)"

This is how I would like it to work, i.e. that one specifically
chooses OF_BLOBLIST. This split of bloblib and whether or not it is
mandatory is just confusing.

>
> Secondly I prefer to keep the register convention code as a xferlist
> library that can be used for arm arches other than split them into
> different low level assemblies. In case of any firmware handoff
> specification update, we just need to maintain this library.

I don't agree with that, sorry. This should be a standard feature of
U-Boot. It is easier to update three 'store' instructions in the
assembler than to figure out what is going on with the xferlist
functions. They are really just an obfuscation from the Arm point of
view, the only current implementer of the spec.

I have tried my series with your QEMU things but it doesn't work. So I
went back to try your original instructions with your series and it
didn't work either. Would it be possible for you to get the pending
patches in the other projects submitted and then send me an update re
the instructions? I would like to get the environment running again,
but there are too many moving parts at present.

Regards,
SImon

>
> Regards,
> Raymond
>
> > Changes in v3:
> > - Add a build for aarch64 as well
> > - Add conditions to avoid enaling the test on qemu_arm_sbsa
> > - Add mention of QEMU_MANUAL_DTB in doc/
> > - Add new patch to adjust how the bloblist is received from stdpass
> > - Add new patch to redo how a devicetree is set up
> > - Add passage_valid() to decide if stdpass was provided
> > - Add support for a 64-bit test also
> > - Add support for aarch64 also
> > - Add test for aarch64
> > - Add tests for azure
> > - Drop common.h
> > - Fix 'that' typo
> > - Fix 'usiing' typo
> > - Make the global_data fields present only when needed
> > - Move arch_passage_entry() into this patch
> > - Move passage.h into this patch
> > - Rebase to -master
> > - Refresh the U-Boot output in the documentation
> > - Update docs for the various code changes
> > - Update registers to match the Firmware Handoff protocol
> > - Use bootph tags
> >
> > Changes in v2:
> > - Add a devicetree for qemu-arm so that qemu_arm_spl can work
> > - Add a new QEMU-specific Kconfig instead
> > - Add comments about how to pass standard passage to EFI
> > - Add comments about passing a bloblist to Linux
> > - Add detailed arch-specific information
> > - Add new patch with the arm-specific standard passage implementation
> > - Fix 'it' typo
> > - Make the stdpass calling standard arch-specific
> > - Move patch into the standard-passage series
> > - Rebase on -master
> > - Rebase to master
> > - Rebase to master (dropping bloblist patches already applied)
> > - Rework global_data for new stdpass convention
> > - Split the jump_to_image_no_args() change into its own patch
> > - Update the commit message to mention the long lines
> > - Use three registers instead of two for the entry
> >
> > Simon Glass (22):
> >   RFC: scripts: Add a script for running QEMU
> >   emulation: fdt: Allow using U-Boot's device tree with QEMU
> >   spl: Tidy up the header includes
> >   x86: Move Intel GNVS file into the common include directory
> >   spl: Rename jump_to_image_no_args()
> >   passage: Support an incoming passage
> >   fdt: Redo devicetree setup
> >   fdt: Support reading FDT from standard passage
> >   bloblist: Adjust how the bloblist is received from passage
> >   passage: arm: Accept a passage from the previous phase
> >   passage: spl: Support adding the dtb to the passage bloblist
> >   passage: spl: Support passing the passage to U-Boot
> >   passage: arm: Add the arch-specific standard passage impl
> >   arm: qemu: Add an SPL build
> >   arm: qemu: Add a 64-bit SPL build
> >   xferlist: Drop old xferlist code
> >   passage: Add a qemu test for ARM
> >   sandbox: Add a way of checking structs for standard passage
> >   passage: Add documentation
> >   passage: Add docs for spl_handoff
> >   passage: Add checks for pre-existing blobs
> >   CI: Add tests for gitlab and azure
> >
> >  .azure-pipelines.yml                          |   6 +
> >  .gitlab-ci.yml                                |  12 +
> >  MAINTAINERS                                   |  10 +
> >  Makefile                                      |   2 +-
> >  arch/arm/Kconfig                              |   2 +-
> >  arch/arm/cpu/armv7/cpu.c                      |  18 +
> >  arch/arm/cpu/armv7/start.S                    |  10 +-
> >  arch/arm/cpu/armv8/cpu.c                      |  19 +
> >  arch/arm/cpu/armv8/start.S                    |  12 +
> >  arch/arm/dts/qemu-arm-u-boot.dtsi             |  22 +
> >  arch/arm/dts/qemu-arm.dts                     | 393 +++++++++++++++++-
> >  arch/arm/dts/qemu-arm64-u-boot.dtsi           |  29 ++
> >  arch/arm/dts/qemu-arm64.dts                   | 338 ++++++++++++++-
> >  arch/arm/lib/Makefile                         |   1 -
> >  arch/arm/lib/crt0.S                           |   6 +
> >  arch/arm/lib/crt0_64.S                        |   6 +
> >  arch/arm/lib/xferlist.c                       |  23 -
> >  arch/arm/lib/xferlist.h                       |  19 -
> >  arch/arm/mach-imx/imx8ulp/soc.c               |   2 +-
> >  arch/arm/mach-imx/spl.c                       |   2 +-
> >  arch/arm/mach-omap2/boot-common.c             |   2 +-
> >  arch/arm/mach-qemu/Kconfig                    |  20 +-
> >  arch/arm/mach-tegra/spl.c                     |   2 +-
> >  arch/mips/lib/spl.c                           |   2 +-
> >  arch/riscv/lib/spl.c                          |   2 +-
> >  arch/sandbox/cpu/spl.c                        |   4 +-
> >  arch/x86/cpu/apollolake/acpi.c                |   2 +-
> >  arch/x86/cpu/intel_common/acpi.c              |   2 +-
> >  .../include/asm/arch-apollolake/global_nvs.h  |   2 +-
> >  arch/x86/lib/spl.c                            |   2 +-
> >  arch/x86/lib/tpl.c                            |   2 +-
> >  board/emulation/common/Kconfig                |  12 +
> >  board/emulation/qemu-arm/Kconfig              |  29 +-
> >  board/emulation/qemu-arm/MAINTAINERS          |   2 +
> >  board/emulation/qemu-arm/Makefile             |   1 +
> >  board/emulation/qemu-arm/qemu-arm.c           |   3 +
> >  board/emulation/qemu-arm/spl.c                |  26 ++
> >  board/freescale/common/fsl_chain_of_trust.c   |   2 +-
> >  board/google/chromebook_coral/coral.c         |   2 +-
> >  board/renesas/common/rcar64-spl.c             |   2 +-
> >  board/sandbox/Makefile                        |   3 +-
> >  board/sandbox/stdpass_check.c                 | 104 +++++
> >  common/Kconfig                                |  58 ++-
> >  common/bloblist.c                             | 108 ++---
> >  common/board_f.c                              |  13 +-
> >  common/spl/spl.c                              | 112 +++--
> >  configs/qemu_arm64_spl_defconfig              |  95 +++++
> >  configs/qemu_arm_spl_defconfig                |  88 ++++
> >  configs/vexpress_fvp_bloblist_defconfig       |   2 +-
> >  doc/board/armltd/vexpress64.rst               |   2 +-
> >  doc/board/emulation/qemu-arm.rst              |  84 ++++
> >  doc/develop/bloblist.rst                      |   4 +-
> >  doc/develop/devicetree/dt_qemu.rst            |   8 +
> >  doc/develop/index.rst                         |   1 +
> >  doc/develop/std_passage.rst                   | 384 +++++++++++++++++
> >  drivers/usb/gadget/f_sdp.c                    |   2 +-
> >  dts/Kconfig                                   |  17 +-
> >  include/asm-generic/global_data.h             |  37 ++
> >  include/bloblist.h                            |  26 +-
> >  include/fdtdec.h                              |   4 +-
> >  include/handoff.h                             |  10 +-
> >  .../x86/include/asm => include}/intel_gnvs.h  |   0
> >  include/passage.h                             |  53 +++
> >  include/spl.h                                 |   4 +-
> >  include/stdpass/README                        |   4 +
> >  include/stdpass/tpm2_eventlog.h               |  42 ++
> >  include/stdpass/vboot_ctx.h                   | 267 ++++++++++++
> >  lib/asm-offsets.c                             |   8 +
> >  lib/fdtdec.c                                  |  42 +-
> >  scripts/Makefile.xpl                          |   2 +-
> >  scripts/build-qemu.sh                         | 226 ++++++++++
> >  test/py/tests/test_passage.py                 |  13 +
> >  72 files changed, 2618 insertions(+), 258 deletions(-)
> >  create mode 100644 arch/arm/dts/qemu-arm-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/qemu-arm64-u-boot.dtsi
> >  delete mode 100644 arch/arm/lib/xferlist.c
> >  delete mode 100644 arch/arm/lib/xferlist.h
> >  create mode 100644 board/emulation/qemu-arm/spl.c
> >  create mode 100644 board/sandbox/stdpass_check.c
> >  create mode 100644 configs/qemu_arm64_spl_defconfig
> >  create mode 100644 configs/qemu_arm_spl_defconfig
> >  create mode 100644 doc/develop/std_passage.rst
> >  rename {arch/x86/include/asm => include}/intel_gnvs.h (100%)
> >  create mode 100644 include/passage.h
> >  create mode 100644 include/stdpass/README
> >  create mode 100644 include/stdpass/tpm2_eventlog.h
> >  create mode 100644 include/stdpass/vboot_ctx.h
> >  create mode 100755 scripts/build-qemu.sh
> >  create mode 100644 test/py/tests/test_passage.py
> >
> > --
> > 2.43.0
> >
> > base-commit: 278be62c052f3a5749c3c7a57bcd307b82dcdc2d
> > branch: pass3


More information about the U-Boot mailing list