From f1991bdf9743cbdf90b98331232f90d4c12bbce3 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 16 Aug 2021 07:54:10 +0200 Subject: [PATCH 1/9] doc: move i.MX7D/i.MX8MM A/B booting to board specific Having "i.MX7D/i.MX8MM SRC_GPR10 PERSIST_SECONDARY_BOOT for bootloader A/B switching" at the top level of the documentation tree does not make sense. Move it to board specific information. Fixes: 59e3d1bd4992 ("doc: imx: psb: Document usage of SRC_GPR10 PERSIST_SECONDARY_BOOT for A/B switching") Signed-off-by: Heinrich Schuchardt --- doc/board/freescale/index.rst | 1 + doc/{imx/misc => board/freescale}/psb.rst | 0 doc/imx/index.rst | 9 --------- doc/imx/misc/index.rst | 9 --------- doc/index.rst | 11 ----------- 5 files changed, 1 insertion(+), 29 deletions(-) rename doc/{imx/misc => board/freescale}/psb.rst (100%) delete mode 100644 doc/imx/index.rst delete mode 100644 doc/imx/misc/index.rst diff --git a/doc/board/freescale/index.rst b/doc/board/freescale/index.rst index bddc6c6c2c7..aa192effabb 100644 --- a/doc/board/freescale/index.rst +++ b/doc/board/freescale/index.rst @@ -17,3 +17,4 @@ Freescale mx6sabresd mx6ul_14x14_evk mx6ullevk + psb diff --git a/doc/imx/misc/psb.rst b/doc/board/freescale/psb.rst similarity index 100% rename from doc/imx/misc/psb.rst rename to doc/board/freescale/psb.rst diff --git a/doc/imx/index.rst b/doc/imx/index.rst deleted file mode 100644 index b225b1d1837..00000000000 --- a/doc/imx/index.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0+ - -NXP i.MX Machine-specific doc -============================= - -.. toctree:: - :maxdepth: 2 - - misc/index diff --git a/doc/imx/misc/index.rst b/doc/imx/misc/index.rst deleted file mode 100644 index 85fbdb6588f..00000000000 --- a/doc/imx/misc/index.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0+ - -Miscellaneous -============= - -.. toctree:: - :maxdepth: 2 - - psb diff --git a/doc/index.rst b/doc/index.rst index 8066fcbfc0b..02de1d46842 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -64,17 +64,6 @@ implementation. arch/index -Machine-specific doc --------------------- - -These books provide programming details about machine-specific -implementation. - -.. toctree:: - :maxdepth: 2 - - imx/index - Board-specific doc ------------------ From 49dae655896cbe13802282959d2fef785f33c608 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 16 Aug 2021 08:18:37 +0200 Subject: [PATCH 2/9] doc: rename Freescale to NXP Freescale Semiconductor, Inc. was merged into NXP Semiconductors in 2015. Signed-off-by: Heinrich Schuchardt --- doc/board/index.rst | 2 +- doc/board/{freescale => nxp}/imx8mm_evk.rst | 0 doc/board/{freescale => nxp}/imx8mn_evk.rst | 0 doc/board/{freescale => nxp}/imx8mp_evk.rst | 0 doc/board/{freescale => nxp}/imx8mq_evk.rst | 0 doc/board/{freescale => nxp}/imx8qxp_mek.rst | 0 doc/board/{freescale => nxp}/imxrt1020-evk.rst | 0 doc/board/{freescale => nxp}/imxrt1050-evk.rst | 0 doc/board/{freescale => nxp}/index.rst | 4 ++-- doc/board/{freescale => nxp}/mx6sabreauto.rst | 0 doc/board/{freescale => nxp}/mx6sabresd.rst | 0 doc/board/{freescale => nxp}/mx6ul_14x14_evk.rst | 0 doc/board/{freescale => nxp}/mx6ullevk.rst | 0 doc/board/{freescale => nxp}/psb.rst | 0 14 files changed, 3 insertions(+), 3 deletions(-) rename doc/board/{freescale => nxp}/imx8mm_evk.rst (100%) rename doc/board/{freescale => nxp}/imx8mn_evk.rst (100%) rename doc/board/{freescale => nxp}/imx8mp_evk.rst (100%) rename doc/board/{freescale => nxp}/imx8mq_evk.rst (100%) rename doc/board/{freescale => nxp}/imx8qxp_mek.rst (100%) rename doc/board/{freescale => nxp}/imxrt1020-evk.rst (100%) rename doc/board/{freescale => nxp}/imxrt1050-evk.rst (100%) rename doc/board/{freescale => nxp}/index.rst (86%) rename doc/board/{freescale => nxp}/mx6sabreauto.rst (100%) rename doc/board/{freescale => nxp}/mx6sabresd.rst (100%) rename doc/board/{freescale => nxp}/mx6ul_14x14_evk.rst (100%) rename doc/board/{freescale => nxp}/mx6ullevk.rst (100%) rename doc/board/{freescale => nxp}/psb.rst (100%) diff --git a/doc/board/index.rst b/doc/board/index.rst index 9e909788916..33087074fa8 100644 --- a/doc/board/index.rst +++ b/doc/board/index.rst @@ -14,11 +14,11 @@ Board-specific doc congatec/index coreboot/index emulation/index - freescale/index google/index intel/index kontron/index microchip/index + nxp/index openpiton/index qualcomm/index rockchip/index diff --git a/doc/board/freescale/imx8mm_evk.rst b/doc/board/nxp/imx8mm_evk.rst similarity index 100% rename from doc/board/freescale/imx8mm_evk.rst rename to doc/board/nxp/imx8mm_evk.rst diff --git a/doc/board/freescale/imx8mn_evk.rst b/doc/board/nxp/imx8mn_evk.rst similarity index 100% rename from doc/board/freescale/imx8mn_evk.rst rename to doc/board/nxp/imx8mn_evk.rst diff --git a/doc/board/freescale/imx8mp_evk.rst b/doc/board/nxp/imx8mp_evk.rst similarity index 100% rename from doc/board/freescale/imx8mp_evk.rst rename to doc/board/nxp/imx8mp_evk.rst diff --git a/doc/board/freescale/imx8mq_evk.rst b/doc/board/nxp/imx8mq_evk.rst similarity index 100% rename from doc/board/freescale/imx8mq_evk.rst rename to doc/board/nxp/imx8mq_evk.rst diff --git a/doc/board/freescale/imx8qxp_mek.rst b/doc/board/nxp/imx8qxp_mek.rst similarity index 100% rename from doc/board/freescale/imx8qxp_mek.rst rename to doc/board/nxp/imx8qxp_mek.rst diff --git a/doc/board/freescale/imxrt1020-evk.rst b/doc/board/nxp/imxrt1020-evk.rst similarity index 100% rename from doc/board/freescale/imxrt1020-evk.rst rename to doc/board/nxp/imxrt1020-evk.rst diff --git a/doc/board/freescale/imxrt1050-evk.rst b/doc/board/nxp/imxrt1050-evk.rst similarity index 100% rename from doc/board/freescale/imxrt1050-evk.rst rename to doc/board/nxp/imxrt1050-evk.rst diff --git a/doc/board/freescale/index.rst b/doc/board/nxp/index.rst similarity index 86% rename from doc/board/freescale/index.rst rename to doc/board/nxp/index.rst index aa192effabb..63956287c5b 100644 --- a/doc/board/freescale/index.rst +++ b/doc/board/nxp/index.rst @@ -1,7 +1,7 @@ .. SPDX-License-Identifier: GPL-2.0+ -Freescale -========= +NXP Semiconductors +================== .. toctree:: :maxdepth: 2 diff --git a/doc/board/freescale/mx6sabreauto.rst b/doc/board/nxp/mx6sabreauto.rst similarity index 100% rename from doc/board/freescale/mx6sabreauto.rst rename to doc/board/nxp/mx6sabreauto.rst diff --git a/doc/board/freescale/mx6sabresd.rst b/doc/board/nxp/mx6sabresd.rst similarity index 100% rename from doc/board/freescale/mx6sabresd.rst rename to doc/board/nxp/mx6sabresd.rst diff --git a/doc/board/freescale/mx6ul_14x14_evk.rst b/doc/board/nxp/mx6ul_14x14_evk.rst similarity index 100% rename from doc/board/freescale/mx6ul_14x14_evk.rst rename to doc/board/nxp/mx6ul_14x14_evk.rst diff --git a/doc/board/freescale/mx6ullevk.rst b/doc/board/nxp/mx6ullevk.rst similarity index 100% rename from doc/board/freescale/mx6ullevk.rst rename to doc/board/nxp/mx6ullevk.rst diff --git a/doc/board/freescale/psb.rst b/doc/board/nxp/psb.rst similarity index 100% rename from doc/board/freescale/psb.rst rename to doc/board/nxp/psb.rst From 7075ef463eec1f4856c13b9873f8a5ae5f040ddf Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 16 Aug 2021 19:46:38 +0200 Subject: [PATCH 3/9] doc: move doc/board/st/st.rst 'make htmldocs' does not use file doc/board/st/st.rst because the name matches the directory name. Let's rename it to st-dt.rst. Signed-off-by: Heinrich Schuchardt --- doc/board/st/index.rst | 2 +- doc/board/st/{st.rst => st-dt.rst} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename doc/board/st/{st.rst => st-dt.rst} (100%) diff --git a/doc/board/st/index.rst b/doc/board/st/index.rst index 8a06a954a26..9bba42f1dae 100644 --- a/doc/board/st/index.rst +++ b/doc/board/st/index.rst @@ -6,5 +6,5 @@ STMicroelectronics .. toctree:: :maxdepth: 2 - st + st-dt stm32mp1 diff --git a/doc/board/st/st.rst b/doc/board/st/st-dt.rst similarity index 100% rename from doc/board/st/st.rst rename to doc/board/st/st-dt.rst From 7685d17b72bc4fee08ba669634f3dc3084af190d Mon Sep 17 00:00:00 2001 From: Masahisa Kojima Date: Fri, 13 Aug 2021 16:12:43 +0900 Subject: [PATCH 4/9] efi_loader: add comment for efi_tcg2.h This commit adds the comment of the TCG Specification efi_tcg2.h file refers, and comment for the structure. Signed-off-by: Masahisa Kojima Signed-off-by: Heinrich Schuchardt --- include/efi_tcg2.h | 57 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h index 497ba3ce940..b6b958da514 100644 --- a/include/efi_tcg2.h +++ b/include/efi_tcg2.h @@ -3,6 +3,13 @@ * Defines data structures and APIs that allow an OS to interact with UEFI * firmware to query information about the device * + * This file refers the following TCG specification. + * - TCG PC Client Platform Firmware Profile Specification + * https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/ + * + * - TCG EFI Protocol Specification + * https://trustedcomputinggroup.org/resource/tcg-efi-protocol-specification/ + * * Copyright (c) 2020, Linaro Limited */ @@ -36,11 +43,23 @@ typedef u32 efi_tcg_event_log_bitmap; typedef u32 efi_tcg_event_log_format; typedef u32 efi_tcg_event_algorithm_bitmap; +/** + * struct tdEFI_TCG2_VERSION - structure of EFI TCG2 version + * @major: major version + * @minor: minor version + */ struct efi_tcg2_version { u8 major; u8 minor; }; +/** + * struct tdEFI_TCG2_EVENT_HEADER - structure of EFI TCG2 event header + * @header_size: size of the event header + * @header_version: header version + * @pcr_index: index of the PCR that is extended + * @event_type: type of the event that is extended + */ struct efi_tcg2_event_header { u32 header_size; u16 header_version; @@ -48,12 +67,27 @@ struct efi_tcg2_event_header { u32 event_type; } __packed; +/** + * struct tdEFI_TCG2_EVENT - structure of EFI TCG2 event + * @size: total size of the event including the size component, the header + * and the event data + * @header: event header + * @event: event to add + */ struct efi_tcg2_event { u32 size; struct efi_tcg2_event_header header; u8 event[]; } __packed; +/** + * struct tdUEFI_IMAGE_LOAD_EVENT - structure of PE/COFF image measurement + * @image_location_in_memory: image address + * @image_length_in_memory: image size + * @image_link_time_address: image link time address + * @length_of_device_path: devive path size + * @device_path: device path + */ struct uefi_image_load_event { efi_physical_addr_t image_location_in_memory; u64 image_length_in_memory; @@ -62,6 +96,23 @@ struct uefi_image_load_event { struct efi_device_path device_path[]; }; +/** + * struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY - protocol capability information + * @size: allocated size of the structure + * @structure_version: version of this structure + * @protocol_version: version of the EFI TCG2 protocol. + * @hash_algorithm_bitmap: supported hash algorithms + * @supported_event_logs: bitmap of supported event log formats + * @tpm_present_flag: false = TPM not present + * @max_command_size: max size (in bytes) of a command + * that can be sent to the TPM + * @max_response_size: max size (in bytes) of a response that + * can be provided by the TPM + * @manufacturer_id: 4-byte Vendor ID + * @number_of_pcr_banks: maximum number of PCR banks + * @active_pcr_banks: bitmap of currently active + * PCR banks (hashing algorithms). + */ struct efi_tcg2_boot_service_capability { u8 size; struct efi_tcg2_version structure_version; @@ -86,7 +137,7 @@ struct efi_tcg2_boot_service_capability { #define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_ERRATA_TPM2 2 /** - * struct TCG_EfiSpecIdEventAlgorithmSize + * struct TCG_EfiSpecIdEventAlgorithmSize - hashing algorithm information * * @algorithm_id: algorithm defined in enum tpm2_algorithms * @digest_size: size of the algorithm @@ -97,7 +148,7 @@ struct tcg_efi_spec_id_event_algorithm_size { } __packed; /** - * struct TCG_EfiSpecIDEventStruct + * struct TCG_EfiSpecIDEventStruct - content of the event log header * * @signature: signature, set to Spec ID Event03 * @platform_class: class defined in TCG ACPI Specification @@ -130,7 +181,7 @@ struct tcg_efi_spec_id_event { } __packed; /** - * struct tdEFI_TCG2_FINAL_EVENTS_TABLE + * struct tdEFI_TCG2_FINAL_EVENTS_TABLE - log entries after Get Event Log * @version: version number for this structure * @number_of_events: number of events recorded after invocation of * GetEventLog() From 3ced574530e13b12cec3dc9ef87f1a175fb76c83 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 17 Aug 2021 14:52:16 +0200 Subject: [PATCH 5/9] efi_loader: use an enum for the memory allocation types For type checking we need an enum. Signed-off-by: Heinrich Schuchardt --- include/efi.h | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/include/efi.h b/include/efi.h index 6417a9b8c53..4eb573a2806 100644 --- a/include/efi.h +++ b/include/efi.h @@ -125,6 +125,34 @@ struct efi_table_hdr { u32 reserved; }; +/* Allocation types for calls to boottime->allocate_pages*/ +/** + * enum efi_allocate_type - address restriction for memory allocation + */ +enum efi_allocate_type { + /** + * @EFI_ALLOCATE_ANY_PAGES: + * Allocate any block of sufficient size. Ignore memory address. + */ + EFI_ALLOCATE_ANY_PAGES, + /** + * @EFI_ALLOCATE_MAX_ADDRESS: + * Allocate a memory block with an uppermost address less or equal + * to the indicated address. + */ + EFI_ALLOCATE_MAX_ADDRESS, + /** + * @EFI_ALLOCATE_ADDRESS: + * Allocate a memory block starting at the indicatged adress. + */ + EFI_ALLOCATE_ADDRESS, + /** + * @EFI_MAX_ALLOCATE_TYPE: + * Value use for range checking. + */ + EFI_MAX_ALLOCATE_TYPE, +}; + /* Enumeration of memory types introduced in UEFI */ enum efi_mem_type { EFI_RESERVED_MEMORY_TYPE, @@ -224,12 +252,6 @@ struct efi_mem_desc { #define EFI_MEMORY_DESCRIPTOR_VERSION 1 -/* Allocation types for calls to boottime->allocate_pages*/ -#define EFI_ALLOCATE_ANY_PAGES 0 -#define EFI_ALLOCATE_MAX_ADDRESS 1 -#define EFI_ALLOCATE_ADDRESS 2 -#define EFI_MAX_ALLOCATE_TYPE 3 - /* Types and defines for Time Services */ #define EFI_TIME_ADJUST_DAYLIGHT 0x1 #define EFI_TIME_IN_DAYLIGHT 0x2 From c91737b7f1a5180b8944eea2121347ef6429b17c Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 17 Aug 2021 15:02:23 +0200 Subject: [PATCH 6/9] efi_loader rename enum efi_mem_type to efi_memory_type Use the same name as in the UEFI specification to avoid confusion. Signed-off-by: Heinrich Schuchardt --- arch/x86/include/asm/hob.h | 2 +- include/efi.h | 2 +- include/efi_api.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/hob.h b/arch/x86/include/asm/hob.h index 56e11dbb28f..2f5b6e24c29 100644 --- a/arch/x86/include/asm/hob.h +++ b/arch/x86/include/asm/hob.h @@ -91,7 +91,7 @@ struct hob_mem_alloc { * Type EFI_MEMORY_TYPE is defined in AllocatePages() in the UEFI 2.0 * specification. */ - enum efi_mem_type mem_type; + enum efi_memory_type mem_type; /* padding */ u8 reserved[4]; }; diff --git a/include/efi.h b/include/efi.h index 4eb573a2806..18c13e0370a 100644 --- a/include/efi.h +++ b/include/efi.h @@ -154,7 +154,7 @@ enum efi_allocate_type { }; /* Enumeration of memory types introduced in UEFI */ -enum efi_mem_type { +enum efi_memory_type { EFI_RESERVED_MEMORY_TYPE, /* * The code portions of a loaded application. diff --git a/include/efi_api.h b/include/efi_api.h index 38ac47f1646..c8f959bb720 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -249,7 +249,7 @@ struct efi_memory_range { struct efi_memory_range_capsule { struct efi_capsule_header *header; /* EFI_MEMORY_TYPE: 0x80000000-0xFFFFFFFF */ - enum efi_mem_type os_requested_memory_type; + enum efi_memory_type os_requested_memory_type; u64 number_of_memory_ranges; struct efi_memory_range memory_ranges[]; } __packed; From 49d225e7bf3a26adfe6093978c04e454c82bd955 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 17 Aug 2021 15:05:31 +0200 Subject: [PATCH 7/9] efi_loader: use correct type for AllocatePages, AllocatePool Use enum efi_memory_type and enum_allocate_type in the definitions of the efi_allocate_pages(), efi_allocate_pool(). In the external UEFI API leave the type as int as the UEFI specification explicitely requires that enums use a 32bit type. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 9 +++++---- lib/efi_loader/efi_memory.c | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index 32cb8d0f1ef..c440962fe52 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -676,13 +676,14 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid); /* Generic EFI memory allocator, call this to get memory */ void *efi_alloc(uint64_t len, int memory_type); /* More specific EFI memory allocator, called by EFI payloads */ -efi_status_t efi_allocate_pages(int type, int memory_type, efi_uintn_t pages, - uint64_t *memory); +efi_status_t efi_allocate_pages(enum efi_allocate_type type, + enum efi_memory_type memory_type, + efi_uintn_t pages, uint64_t *memory); /* EFI memory free function. */ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages); /* EFI memory allocator for small allocations */ -efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, - void **buffer); +efi_status_t efi_allocate_pool(enum efi_memory_type pool_type, + efi_uintn_t size, void **buffer); /* EFI pool memory free function. */ efi_status_t efi_free_pool(void *buffer); /* Returns the EFI memory map */ diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index be2f655dffd..f4acbee4f9b 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -454,7 +454,8 @@ static uint64_t efi_find_free_memory(uint64_t len, uint64_t max_addr) * @memory allocated memory * @return status code */ -efi_status_t efi_allocate_pages(int type, int memory_type, +efi_status_t efi_allocate_pages(enum efi_allocate_type type, + enum efi_memory_type memory_type, efi_uintn_t pages, uint64_t *memory) { u64 len = pages << EFI_PAGE_SHIFT; @@ -556,7 +557,7 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages) * @buffer: allocated memory * Return: status code */ -efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer) +efi_status_t efi_allocate_pool(enum efi_memory_type pool_type, efi_uintn_t size, void **buffer) { efi_status_t r; u64 addr; From 426a15893f16c5f640bf8380b6a9086906e2f659 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 17 Aug 2021 15:15:23 +0200 Subject: [PATCH 8/9] efi_loader: use EfiBootServicesData for device path dp_alloc() was using a constant from the wrong enum resulting in creating device paths in EfiReservedMemory. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_device_path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 9c3ac712fef..cbdb466da41 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -68,7 +68,7 @@ static void *dp_alloc(size_t sz) { void *buf; - if (efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, sz, &buf) != + if (efi_allocate_pool(EFI_BOOT_SERVICES_DATA, sz, &buf) != EFI_SUCCESS) { debug("EFI: ERROR: out of memory in %s\n", __func__); return NULL; From 9a4b3c8e914dbb9d06640d8e04db8a06dedca051 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 17 Aug 2021 16:15:34 +0200 Subject: [PATCH 9/9] efi_loader: use EfiBootServicesData for DP to text Memory allocated in the implementation of the EFI_DEVICE_PATH_TO_TEXT_PROTOCOL must be of type EfiBootServicesData. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_device_path_to_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c index d46327a1c94..57fa9d97f71 100644 --- a/lib/efi_loader/efi_device_path_to_text.c +++ b/lib/efi_loader/efi_device_path_to_text.c @@ -34,7 +34,7 @@ static u16 *efi_str_to_u16(char *str) efi_status_t ret; len = sizeof(u16) * (utf8_utf16_strlen(str) + 1); - ret = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, len, (void **)&out); + ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, len, (void **)&out); if (ret != EFI_SUCCESS) return NULL; dst = out;