[PATCH v2 0/7] efi_loader: Add support for logging to a buffer

Simon Glass sjg at chromium.org
Mon Dec 2 01:12:36 CET 2024


It is a bit of a pain to log EFI boot-services calls at present. The
output goes to the console so cannot easily be inspected later. Also it
would be useful to be able to store the log and review it later, perhaps
after something has gone wrong.

This series makes a start on implementing a log-to-buffer feature. It
provides a simple 'efidebug log' command to inspect the buffer. For now,
only memory allocations are logged.

This feature makes it possible to add tests to check which EFI calls are
made by U-Boot itself. It may also make it easier to figure out what is
needed for booting Windows.

Some patches to help with debugging sandbox memory-mapping are included,
but for now EFI's use of mapping is not adjusted.

Changes in v2:
- Rebase on efil series (memory address/pointers)

Simon Glass (7):
  efi_loader: Fix free in ..._media_device_boot_option()
  efi_loader: Add support for logging EFI calls
  efi_loader: Create the log on startup
  efi_loader: Add a command to show the EFI log
  test: efi_loader: Add a simple test for the EFI log
  efi_loader: Use the log with memory-related functions
  efi_loader: Add documentation for the EFI log

 MAINTAINERS                  |   7 +
 cmd/efidebug.c               |  53 ++++-
 configs/sandbox_defconfig    |   3 +
 doc/develop/uefi/uefi.rst    |  22 ++
 doc/usage/cmd/efidebug.rst   | 109 +++++++++
 doc/usage/index.rst          |   1 +
 include/bloblist.h           |   1 +
 include/efi.h                |   1 +
 include/efi_log.h            | 316 +++++++++++++++++++++++++
 lib/efi_loader/Kconfig       |  19 ++
 lib/efi_loader/Makefile      |   1 +
 lib/efi_loader/efi_bootmgr.c |   3 +-
 lib/efi_loader/efi_log.c     | 444 +++++++++++++++++++++++++++++++++++
 lib/efi_loader/efi_memory.c  |  66 +++++-
 lib/efi_loader/efi_setup.c   |   7 +
 test/lib/Makefile            |   1 +
 test/lib/efi_log.c           |  93 ++++++++
 17 files changed, 1131 insertions(+), 16 deletions(-)
 create mode 100644 doc/usage/cmd/efidebug.rst
 create mode 100644 include/efi_log.h
 create mode 100644 lib/efi_loader/efi_log.c
 create mode 100644 test/lib/efi_log.c

-- 
2.34.1



More information about the U-Boot mailing list