[U-Boot] [PATCH v8 00/30] efi: Enable sandbox support for EFI loader

Simon Glass sjg at chromium.org
Mon Jun 18 14:08:05 UTC 2018


A limitation of the EFI loader at present is that it does not build with
sandbox. This makes it hard to write tests, since sandbox is used for most
testing in U-Boot.

This series enables the EFI loader feature. It allows sandbox to build and
run a trivial function which calls the EFI API to output a message.

Also included in v8 is support for running the full EFI self tests. These
run OK with some tweaks to a few parts of the code.

This series is at u-boot-dm/efi-working

Changes in v8:
- Expand series substantially to support bootefi selftest
- Rebase to master

Changes in v7:
- Drop an unnecessary comment
- Drop patch "efi: Init the 'rows' and 'cols' variables"
- Drop patches previous applied
- Move some of the code from efi_memory_init() into a separate function
- Update patch subject s/builder/build/

Changes in v6:
- Warn about building sandbox EFI support on something other than __x86_64__

Changes in v5:
- Add new patch to disallow CMD_BOOTEFI_SELFTEST on sandbox
- Drop call to efi_init_obj_list() which is now done in do_bootefi()
- Introduce load_options_path to specifyc U-Boot env var for load_options_path
- Rebase to master

Changes in v4:
- Rebase to master
- Update SPDX tags

Changes in v3:
- Add new patch to rename bootefi_test_finish() to bootefi_run_finish()
- Add new patch to split out test init/uninit into functions
- Add patch to create a function to set up for running EFI code
- Drop incorrect map_sysmem() in write_smbios_table()
- Init the 'rows' and 'cols' vars to avoid a compiler error (gcc 4.8.4)
- Rebase to master

Changes in v2:
- Rebase to master
- Update to use mapmem instead of a cast

Alexander Graf (4):
  efi_loader: Use map_sysmem() in bootefi command
  efi_loader: Use compiler constants for image loader
  efi_loader: Disable miniapps on sandbox
  efi_loader: Pass address to fs_read()

Heinrich Schuchardt (1):
  efi_loader: efi_allocate_pages is too restrictive

Simon Glass (25):
  efi: Don't allow CMD_BOOTEFI_SELFTEST on sandbox
  efi: sandbox: Adjust memory usage for sandbox
  sandbox: smbios: Update to support sandbox
  efi: sandbox: Add distroboot support
  efi: sandbox: Add relocation constants
  efi: sandbox: Enable EFI loader build for sandbox
  efi: Split out test init/uninit into functions
  efi: sandbox: Add a simple 'bootefi test' command
  efi: Create a function to set up for running EFI code
  efi: Rename bootefi_test_finish() to bootefi_run_finish()
  sandbox: Align RAM buffer to the machine page size
  sandbox: Try to start the RAM buffer at a particular address
  sandbox: Add support for calling abort()
  efi: Don't build sandbox with __attribute__((ms_abi))
  vsprintf: Handle NULL with %pU
  efi_selftest: Clean up a few comments and messages
  sandbox: Enhance map_to_sysmem() to handle foreign pointers
  efi: Add a call to exit() along with why we can't use it
  efi: Relocate FDT to 127MB instead of 128MB
  efi: Tidy up device-tree-size calculation in copy_fdt()
  efi: sandbox: Tidy up copy_fdt() to work with sandbox
  efi: Drop error return in efi_carve_out_dt_rsv()
  efi: Adjust memory handling to support sandbox
  efi: Add more debugging for memory allocations
  efi: sandbox: Enable selftest command

 arch/sandbox/cpu/cpu.c            | 141 +++++++++++++++-
 arch/sandbox/cpu/os.c             |  17 +-
 arch/sandbox/cpu/state.c          |   8 +
 arch/sandbox/include/asm/state.h  |  21 +++
 cmd/bootefi.c                     | 270 ++++++++++++++++++++----------
 configs/sandbox_defconfig         |   1 +
 include/config_distro_bootcmd.h   |  11 ++
 include/efi.h                     |  19 ++-
 include/efi_loader.h              |   3 +
 include/os.h                      |   4 +
 lib/efi_loader/Kconfig            |  12 +-
 lib/efi_loader/Makefile           |   1 +
 lib/efi_loader/efi_boottime.c     |  31 +++-
 lib/efi_loader/efi_file.c         |   5 +-
 lib/efi_loader/efi_image_loader.c |  15 +-
 lib/efi_loader/efi_memory.c       |  57 +++++--
 lib/efi_loader/efi_runtime.c      |  11 ++
 lib/efi_loader/efi_test.c         |  26 +++
 lib/efi_selftest/Makefile         |   2 +-
 lib/efi_selftest/efi_selftest.c   |  14 +-
 lib/smbios.c                      |  32 +++-
 lib/vsprintf.c                    |   5 +-
 22 files changed, 562 insertions(+), 144 deletions(-)
 create mode 100644 lib/efi_loader/efi_test.c

-- 
2.18.0.rc1.244.gcf134e6275-goog



More information about the U-Boot mailing list