On the sandbox efi_acpi_register() used sandbox virtual addressed instead of pointers required by the invoked API function. This lead to EFI applications crashing when trying to access the tables.
The first patch corrects the API invocation. The second patch provides a unit test to ensure we don't do this wrong again. The third patch fixes starts_with() in smbiosdump returning NULL instead of false though the return value is declared as boolean. The fourth patch fixes an incorrect condition for freeing a buffer in dtbdump.c and smbiosdump.c. The next for five patches factor out common code of the EFI apps dbginfodump, dtbdump, initrddump, and smbiosdump. The tenth patch corrects the checksum in the RSDP table. The last patch provides an EFI app to dump ACPI tables. Changes in v3: 4/11 rephrase the subject line and the commit message 5/11 mention bs, handle, systable are deduplicated in a later patch mention printx() signature change 6/11 actually add drain_input() to dbginfodump 8/11 use sizeof(efi_guid_t) when calling memcmp() for GUID correct type of ret in save_file() document the partition search logic of open_file_system and save_file 9/11 move external variable to efi_app_common.h remove printx comment (which is in 05/11 now) safely handle command with length 0 in command_loop() smbiosdump: don't remove check in do_save() dbginfodump: remove stray blank line dbginfodump: keep writing error if Device Path To Text protocol not found intirddump: use efi_status_t for status code 11/11 extend the commit message reformat with clang-format roll in u32_to_utf16_dec() in add_tables() check against max_tables Heinrich Schuchardt (11): efi_loader: use pointers in efi_acpi_register() efi_selftest: add ACPI configuration table test efi_loader: smbiosdump: fix starts_with() returning NULL efi_loader: fix void* check in open_file_system() efi_loader: add efi_app_common skeleton efi_loader: move console-input helpers to efi_app_common efi_loader: move string helpers to efi_app_common efi_loader: move file-system helpers to efi_app_common efi_loader: move efi_main and command loop to efi_app_common qfw: fix RSDP ext_checksum recomputation efi_loader: add ACPI table dump EFI app drivers/misc/qfw_acpi.c | 1 + lib/efi_loader/Makefile | 14 +- lib/efi_loader/acpidump.c | 566 +++++++++++++++++++++++++++ lib/efi_loader/dbginfodump.c | 234 +---------- lib/efi_loader/dtbdump.c | 482 ++--------------------- lib/efi_loader/efi_acpi.c | 35 +- lib/efi_loader/efi_app_common.c | 413 +++++++++++++++++++ lib/efi_loader/efi_app_common.h | 156 ++++++++ lib/efi_loader/initrddump.c | 410 +------------------ lib/efi_loader/smbiosdump.c | 442 ++------------------- lib/efi_selftest/Makefile | 1 + lib/efi_selftest/efi_selftest_acpi.c | 138 +++++++ 13 files changed, 1408 insertions(+), 1489 deletions(-) create mode 100644 lib/efi_loader/acpidump.c create mode 100644 lib/efi_loader/efi_app_common.c create mode 100644 lib/efi_loader/efi_app_common.h create mode 100644 lib/efi_selftest/efi_selftest_acpi.c -- 2.53.0

