diff options
author | Tom Rini <trini@konsulko.com> | 2020-10-06 08:36:38 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-10-06 08:36:38 -0400 |
commit | 5dcf7cc590b348f1e730ec38242df64c179f10a8 (patch) | |
tree | 7ba5948897352b913338be6cf27061570e96a128 /lib/efi_selftest/efi_selftest.c | |
parent | 987ab49366f3fcd25039eab431bf099b587b3265 (diff) | |
parent | 4cbb2930bd8c67f40f848528941930cf4c2a1841 (diff) |
Merge tag 'efi-2021-01-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-01-rc1
The following bugs in the UEFI system are resolved:
* illegal free in EFI_LOAD_FILE2_PROTOCOL implementation
* incorrect documentation of EFI_LOAD_FILE2_PROTOCOL implementation
* output of CRC32 as decimal instead hexadecimal in unit test
* use EfiReservedMemoryType for no-map reserved memory
* avoid unnecessary resets in UEFI unit tests
* call EFI bootmgr even without having /EFI/boot
Diffstat (limited to 'lib/efi_selftest/efi_selftest.c')
-rw-r--r-- | lib/efi_selftest/efi_selftest.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/efi_selftest/efi_selftest.c b/lib/efi_selftest/efi_selftest.c index 165fa265f23..85e819bdfa1 100644 --- a/lib/efi_selftest/efi_selftest.c +++ b/lib/efi_selftest/efi_selftest.c @@ -143,6 +143,27 @@ static int teardown(struct efi_unit_test *test, unsigned int *failures) } /* + * Check that a test requiring reset exists. + * + * @testname: name of the test + * @return: test, or NULL if not found + */ +static bool need_reset(const u16 *testname) +{ + struct efi_unit_test *test; + + for (test = ll_entry_start(struct efi_unit_test, efi_unit_test); + test < ll_entry_end(struct efi_unit_test, efi_unit_test); ++test) { + if (testname && efi_st_strcmp_16_8(testname, test->name)) + continue; + if (test->phase == EFI_SETUP_BEFORE_BOOTTIME_EXIT || + test->phase == EFI_SETUP_AFTER_BOOTTIME_EXIT) + return true; + } + return false; +} + +/* * Check that a test exists. * * @testname: name of the test @@ -290,6 +311,16 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle, EFI_ST_SETUP | EFI_ST_EXECUTE | EFI_ST_TEARDOWN, &failures); + if (!need_reset(testname)) { + if (failures) + ret = EFI_PROTOCOL_ERROR; + + /* Give feedback */ + efi_st_printc(EFI_WHITE, "\nSummary: %u failures\n\n", + failures); + return ret; + } + /* Execute mixed tests */ efi_st_do_tests(testname, EFI_SETUP_BEFORE_BOOTTIME_EXIT, EFI_ST_SETUP, &failures); |