From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH 00/10] efi_loader: add capsule update support
Date: Tue, 28 Apr 2020 08:45:58 +0900 [thread overview]
Message-ID: <20200427234558.GA16947@laputa> (raw)
In-Reply-To: <1b2769b3-4544-dbee-72b3-1d040ea85343@gmx.de>
Heinrich,
On Mon, Apr 27, 2020 at 10:33:41PM +0200, Heinrich Schuchardt wrote:
> On 4/27/20 11:48 AM, AKASHI Takahiro wrote:
> > Summary
> > =======
> > 'UpdateCapsule' is one of runtime services defined in UEFI specification
> > and its aim is to allow a caller (OS) to pass information to the firmware,
> > i.e. U-Boot. This is mostly used to update firmware binary on devices by
> > instructions from OS.
> >
> > While 'UpdateCapsule' is a runtime services function, it is, at least
> > initially, suported only before exiting boot services alike other runtime
> > functions, [Get/]SetVariable. This is because modifying storage which may
> > be shared with OS must be carefully designed and there is no general
> > assumption that we can do it.
> >
> > Therefore, we practically support only "capsule on disk"; any capsule can
> > be handed over to UEFI subsystem as a file on a specific file system.
> >
> > In this patch series, all the related definitions and structures are given
> > as UEFI specification describes, and basic framework for capsule support
> > is provided. Currently supported is
> > * firmware update (Firmware Management Protocol or simply FMP)
> >
> > Most of functionality of firmware update is provided by FMP driver and
> > it will be, by nature, system/platform-specific. So you can and should
> > implement your own FMP driver(s) based on your system requirements.
> > Only a simple FMP driver based on FIT image for a single region is
> > provided here. (So it is "for reference only")
>
> Do think this FMP driver will be actually used?
It's totally up to users (and their requirements).
> Or should it be moved to lib/efi_selftest?
Well, I hope that someone will come in and add more features
that will meet additional requirements.
So I would like you to keep it under lib/efi_loader for now.
> > ^^^^^^^^^^^^^^^^^^
> > See more details in the commit, "efi_loader: capsule: add simple firmware
> > management protocol."
>
> In this patch series I am missing the update of the documentation in
> doc/uefi/.
Okay.
-Takahiro Akashi
> Best regards
>
> Heinrich
>
> >
> > Patch structure
> > ===============
> > Patch#1-#2: preparatory patches
> > Patch#3-#7: main part of implementation
> > Patch#8-#10: utilities and tests
> >
> > [1] https://git.linaro.org/people/takahiro.akashi/u-boot.git efi/capsule
> >
> > Prerequisite patches
> > ====================
> > [2] part: detect EFI system partition
> > https://lists.denx.de/pipermail/u-boot/2020-March/403562.html
> > [3] common: update_tftp: remove unnecessary build check
> > https://lists.denx.de/pipermail/u-boot/2020-March/401727.html
> > [4] sandbox: drop CONFIG_SYS_RELOC_GD_ENV_ADDR
> > https://lists.denx.de/pipermail/u-boot/2020-April/408711.html
> >
> > Test
> > ====
> > * passed all the pytests which are included in this patch series
> > on sandbox build.
> > * passed Travis CI.
> >
> > Please note that, while Travic CI passed, the capsule pytest
> > itself won't be run in the CI because some specific configuration
> > for sandbox build is required. See test_efi_capsule_firmware.py.
> >
> > Issues
> > ======
> > * Timing of executing capsules-on-disk
> > Currently, processing a capsule is triggered only as part of
> > UEFI subsystem initialization. This means that, for example,
> > firmware update, may not take place at system booting time and
> > will potentially be delayed until a first call of any UEFI functions.
> >
> > => See patch#4 for my proposal
> >
> > TODO's
> > ======
> > (May not be addressed in future versions of this series.)
> > * capsule authentication
> > * capsule dependency (dependency expression instruction set)
> > * loading drivers in a capsule
> > * handling RESET flag in a capsule and QeuryCapsuleCaps
> > * full semantics of ESRT (EFI System Resource Table)
> > * enabling capsule API at runtime
> > * json capsule
> > * recovery from update failure
> >
> > Changes
> > =======
> > v1 (April 27, 2020)
> > * rebased to v2020.07-rc
> > * removed already-merged patches (RFC's #1 to #4)
> > * dropped 'variable update' capsule support (RFC's patch#10)
> > * dropped 'variable configuration table' support (RFC's patch#11)
> > (Those two should be discussed separately.)
> > * add preparatory patches (patch#1/#2)
> > * fix several build errors
> > * rename some Kconfig options to be aligned with UEFI specification's terms
> > (patch#3,4,6,7)
> > * enforce UpdateCapsule API to be disabled after ExitBootServices (patch#3)
> > * use config table, runtime_services_supported, instead of variable (patch#3)
> > * make EFI_CAPSULE_ON_DISK buildable even if UpdateCapsule API is disabled
> > (patch4)
> > * support OsIndications, invoking capsule-on-disk only if the variable
> > indicates so (patch#4)
> > * introduced EFI_CAPSULE_ON_DISK_EARLY to invoke capsule-on-disk in U-Boot
> > initialization (patch#4)
> > * detect capsule files only if they are on EFI system partition (patch#4)
> > * use printf, rather than EFI_PRINT, in error cases (patch#4)
> > * use 'header_size' field to retrieve capsule data, adding sanity checks
> > against capsule size (patch#6)
> > * call fmpt driver interfaces with EFI_CALL (patch#6)
> > * remove 'variable update capsule'-related code form mkeficapsule (patch#9)
> > * add a test case of OsIndications not being set properly (patch#10)
> > * adjust test scenario for EFI_CAPSULE_ON_DISK_EARLY (patch#10)
> > * revise pytest scripts (patch#10)
> >
> > Initial release as RFC (March 17, 2020)
> >
> > AKASHI Takahiro (10):
> > efi_loader: disk: add efi_disk_is_system_part()
> > efi_loader: add option to initialise EFI subsystem early
> > efi_loader: define UpdateCapsule api
> > efi_loader: capsule: add capsule_on_disk support
> > efi_loader: capsule: add memory range capsule definitions
> > efi_loader: capsule: support firmware update
> > efi_loader: add simple firmware management protocol for FIT image
> > cmd: add "efidebug capsule" command
> > tools: add mkeficapsule command for UEFI capsule update test
> > test/py: add a test for efi firmware update capsule
> >
> > cmd/efidebug.c | 234 +++++
> > common/board_r.c | 6 +
> > common/main.c | 4 +
> > include/efi_api.h | 156 ++++
> > include/efi_loader.h | 35 +
> > lib/efi_loader/Kconfig | 69 ++
> > lib/efi_loader/Makefile | 2 +
> > lib/efi_loader/efi_capsule.c | 802 ++++++++++++++++++
> > lib/efi_loader/efi_disk.c | 22 +
> > lib/efi_loader/efi_firmware.c | 191 +++++
> > lib/efi_loader/efi_runtime.c | 104 ++-
> > lib/efi_loader/efi_setup.c | 44 +-
> > test/py/tests/test_efi_capsule/conftest.py | 73 ++
> > test/py/tests/test_efi_capsule/defs.py | 24 +
> > .../test_efi_capsule/test_capsule_firmware.py | 198 +++++
> > test/py/tests/test_efi_capsule/uboot_env.its | 25 +
> > tools/Makefile | 3 +
> > tools/mkeficapsule.c | 209 +++++
> > 18 files changed, 2150 insertions(+), 51 deletions(-)
> > create mode 100644 lib/efi_loader/efi_capsule.c
> > create mode 100644 lib/efi_loader/efi_firmware.c
> > create mode 100644 test/py/tests/test_efi_capsule/conftest.py
> > create mode 100644 test/py/tests/test_efi_capsule/defs.py
> > create mode 100644 test/py/tests/test_efi_capsule/test_capsule_firmware.py
> > create mode 100644 test/py/tests/test_efi_capsule/uboot_env.its
> > create mode 100644 tools/mkeficapsule.c
> >
>
prev parent reply other threads:[~2020-04-27 23:45 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 9:48 [PATCH 00/10] efi_loader: add capsule update support AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 01/10] efi_loader: disk: add efi_disk_is_system_part() AKASHI Takahiro
2020-04-27 19:57 ` Heinrich Schuchardt
2020-04-27 23:54 ` AKASHI Takahiro
2020-05-01 7:06 ` Heinrich Schuchardt
2020-05-05 22:33 ` Heinrich Schuchardt
2020-04-27 9:48 ` [PATCH 02/10] efi_loader: add option to initialise EFI subsystem early AKASHI Takahiro
2020-04-27 20:09 ` Heinrich Schuchardt
2020-04-28 0:16 ` AKASHI Takahiro
2020-05-17 7:29 ` Heinrich Schuchardt
2020-05-18 1:43 ` AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 03/10] efi_loader: define UpdateCapsule api AKASHI Takahiro
2020-05-17 8:02 ` Heinrich Schuchardt
2020-05-18 1:34 ` AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 04/10] efi_loader: capsule: add capsule_on_disk support AKASHI Takahiro
2020-04-27 20:28 ` Heinrich Schuchardt
2020-04-28 0:28 ` AKASHI Takahiro
2020-04-30 12:52 ` Sughosh Ganu
2020-04-30 19:51 ` Heinrich Schuchardt
2020-05-07 2:50 ` AKASHI Takahiro
2020-05-07 12:05 ` Sughosh Ganu
2020-04-27 9:48 ` [PATCH 05/10] efi_loader: capsule: add memory range capsule definitions AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 06/10] efi_loader: capsule: support firmware update AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 07/10] efi_loader: add simple firmware management protocol for FIT image AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 08/10] cmd: add "efidebug capsule" command AKASHI Takahiro
2020-04-30 12:38 ` Sughosh Ganu
2020-05-07 1:58 ` AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 09/10] tools: add mkeficapsule command for UEFI capsule update test AKASHI Takahiro
2020-04-27 20:15 ` Heinrich Schuchardt
2020-04-28 1:52 ` AKASHI Takahiro
2020-04-27 9:48 ` [PATCH 10/10] test/py: add a test for efi firmware update capsule AKASHI Takahiro
2020-04-27 20:33 ` [PATCH 00/10] efi_loader: add capsule update support Heinrich Schuchardt
2020-04-27 23:45 ` AKASHI Takahiro [this message]
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=20200427234558.GA16947@laputa \
--to=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.