From patchwork Sat Jul 11 22:05:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 241368 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Sun, 12 Jul 2020 00:05:27 +0200 Subject: [PATCH v4 00/17] efi_loader: non-volatile and runtime variables Message-ID: <20200711220544.120976-1-xypron.glpk@gmx.de> With this patch series file ubootefi.var in the EFI system partition is used for saving UEFI variables. Furthermore the UEFI variables are exposed for reading at runtime. v4: Correct appending of variables when using the memory based store. Performance enhancement for the memory based store. v3: Use efi_var_mem_ins() when restoring variables from file. Remove EFI_VARIABLE_READ_ONLY attribute in runtime GetVariable(). Avoid setting efi_runtime_services.set_variable twice. v2: Rebase the series to consider OP-TEE based variables and authenticated variables. Do not enable SetVariable() at runtime as we cannot persist non-volatile variables at runtime. Display read-only attribute in printenv -e. Heinrich Schuchardt (17): efi_loader: prepare for read only OP-TEE variables efi_loader: display RO attribute in printenv -e efi_loader: separate UEFI variable API from implemementation efi_loader: OsIndicationsSupported, PlatformLangCodes efi_loader: simplify boot manager efi_loader: keep attributes in efi_set_variable_int efi_loader: value of VendorKeys efi_loader: read-only AuditMode and DeployedMode efi_loader: secure boot flag efi_loader: UEFI variable persistence efi_loader: export efi_convert_pointer() efi_loader: optional pointer for ConvertPointer efi_loader: new function efi_memcpy_runtime() efi_loader: memory buffer for variables efi_loader: use memory based variable storage efi_loader: enable UEFI variables at runtime efi_selftest: adjust runtime test for variables cmd/nvedit_efi.c | 24 +- doc/api/efi.rst | 2 + include/efi_api.h | 2 + include/efi_loader.h | 6 + include/efi_variable.h | 198 +++++ lib/efi_loader/Kconfig | 8 + lib/efi_loader/Makefile | 3 + lib/efi_loader/efi_bootmgr.c | 28 +- lib/efi_loader/efi_runtime.c | 35 +- lib/efi_loader/efi_setup.c | 59 +- lib/efi_loader/efi_var_common.c | 140 +++ lib/efi_loader/efi_var_file.c | 239 +++++ lib/efi_loader/efi_var_mem.c | 266 ++++++ lib/efi_loader/efi_variable.c | 836 ++++-------------- lib/efi_loader/efi_variable_tee.c | 130 +-- .../efi_selftest_variables_runtime.c | 13 +- 16 files changed, 1162 insertions(+), 827 deletions(-) create mode 100644 include/efi_variable.h create mode 100644 lib/efi_loader/efi_var_common.c create mode 100644 lib/efi_loader/efi_var_file.c create mode 100644 lib/efi_loader/efi_var_mem.c --- 2.27.0