summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-08 16:02:51 -0400
committerTom Rini <trini@konsulko.com>2019-07-08 16:02:51 -0400
commitcad28d37d5146cf293fe841c7c8e6f658c8a4940 (patch)
tree1181bd0941a69e8b690fa62d1eeaee2bbee90488 /lib/efi_loader/efi_boottime.c
parent0b7f1a95df8fe312ff8f1f548f51e6d656e8e67e (diff)
parent7f95104d91ccfb26f802feb5300838b41bc5fbb1 (diff)
Merge tag 'efi-2019-10-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for v2019.10-rc1 Fix a possible overflow for GUID partition tables. For some runtime services we only have implementations valid at boottime. So we replace them when leaving boottime. Move this from SetVirtualAddressMap() to ExitBootServices() as SetVirtualAddressMap() is not called by all operating systems. Adjust the Python tests accordingly. Bump the supported UEFI specification version to 2.8.
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r--lib/efi_loader/efi_boottime.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index d104cc6b316..c2f89805c76 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-2.0+
/*
- * EFI application boot time services
+ * EFI application boot time services
*
- * Copyright (c) 2016 Alexander Graf
+ * Copyright (c) 2016 Alexander Graf
*/
#include <common.h>
@@ -1968,10 +1968,14 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
/* Make sure that notification functions are not called anymore */
efi_tpl = TPL_HIGH_LEVEL;
- /* TODO: Should persist EFI variables here */
+ /* Notify variable services */
+ efi_variables_boot_exit_notify();
board_quiesce_devices();
+ /* Patch out unsupported runtime function */
+ efi_runtime_detach();
+
/* Fix up caches for EFI payloads if necessary */
efi_exit_caches();
@@ -3234,7 +3238,7 @@ static efi_status_t efi_connect_single_controller(
if (r != EFI_SUCCESS)
return r;
- /* Context Override */
+ /* Context Override */
if (driver_image_handle) {
for (; *driver_image_handle; ++driver_image_handle) {
for (i = 0; i < count; ++i) {
@@ -3341,7 +3345,7 @@ static efi_status_t EFIAPI efi_connect_controller(
}
}
}
- /* Check for child controller specified by end node */
+ /* Check for child controller specified by end node */
if (ret != EFI_SUCCESS && remain_device_path &&
remain_device_path->type == DEVICE_PATH_TYPE_END)
ret = EFI_SUCCESS;
@@ -3620,11 +3624,7 @@ struct efi_system_table __efi_runtime_data systab = {
},
.fw_vendor = firmware_vendor,
.fw_revision = FW_VERSION << 16 | FW_PATCHLEVEL << 8,
- .con_in = &efi_con_in,
- .con_out = &efi_con_out,
- .std_err = &efi_con_out,
.runtime = &efi_runtime_services,
- .boottime = &efi_boot_services,
.nr_tables = 0,
.tables = NULL,
};
@@ -3644,6 +3644,15 @@ efi_status_t efi_initialize_system_table(void)
sizeof(struct efi_configuration_table),
(void **)&systab.tables);
+ /*
+ * These entries will be set to NULL in ExitBootServices(). To avoid
+ * relocation in SetVirtualAddressMap(), set them dynamically.
+ */
+ systab.con_in = &efi_con_in;
+ systab.con_out = &efi_con_out;
+ systab.std_err = &efi_con_out;
+ systab.boottime = &efi_boot_services;
+
/* Set CRC32 field in table headers */
efi_update_table_header_crc32(&systab.hdr);
efi_update_table_header_crc32(&efi_runtime_services.hdr);