aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05Merge branch 'next'Tom Rini26-211/+1905
2021-03-31efi_loader: typo 'devide path'Heinrich Schuchardt1-1/+1
Fix a typo in helloworld.efi. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-31efi_loader: Uart device path missing breakHeinrich Schuchardt1-0/+2
In the devicepath node to text conversion for Uart nodes a break statement is missing. Indicated by Coverity Scan CID 330038 Fixes: 62df6e9c9994 ("efi_loader: Uart device path") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-27bloblist: Make BLOBLIST_TABLES depend on BLOBLISTSimon Glass1-1/+1
Add an extra condition here since we cannot put x86 tables in a bloblist when bloblists are not supported. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-27binman: Show a message when changing subnodesSimon Glass1-2/+2
This change seems important enough to warrant a visible message. Change the log_debug() to log_info(). Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-27smbios: Allow writing to the coreboot version stringSimon Glass2-4/+38
When U-Boot is booted from coreboot the SMBIOS tables are written by coreboot, not U-Boot. The existing method of updating the BIOS version string does not work in that case, since gd->smbios_version is only set when U-Boot writes the tables. Add a new function which allows the version to be updated by parsing the tables and writing the string in the correct place. Since coreboot provides a pointer to the SMBIOS tables in its sysinfo structure, this makes it easy to do the update. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-25efi_loader: Clean up file size calculationsIlias Apalodimas1-15/+1
We recently added a common function for calculating file size, instead of copy pasting the code around. Switch one of the occurences over to the common function Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviwed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_selfest: redefine enum efi_test_phaseHeinrich Schuchardt2-6/+7
Setup will always occur before ExitBootServices(). So eliminate EFI_SETUP_AFTER_BOOTTIME_EXIT. Put the SetVirtualAddressMap() test into a separate class so that we can execute it last. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Add an S-CRTM even for firmware versionIlias Apalodimas1-0/+35
TCG PC Client Platform Firmware Profile Spec mandates that an S-CRTM event for the version identifier using the event type EV_S_CRTM_VERSION must be measured. So since we are trying to add more conformance into U-Boot, let's add the event using U_BOOT_VERSION_STRING, extend PCR[0] accordingly and log it in the EventLog Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-25efi_loader: EFI TCG2 free efi memory on protocol failureIlias Apalodimas1-8/+32
Current code doesn't free the efi allocated memory in case the protocol failed to install Fixes: c8d0fd582576 ("efi_loader: Introduce eventlog support for TCG2_PROTOCOL") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-25efi: ESRT creation testsJose Marinho2-0/+293
This commmit exercises the ESRT creation in a EFI selftest. A fake FMP, with TEST_ESRT_NUM_ENTRIES FW images, is installed in the system leading to the corresponding ESRT entries being populated. The ESRT entries are checked against the datastructure used to initialize the FMP. Invocation from the sandbox platform: add to sandbox_defconfig: +CONFIG_CMD_BOOTEFI_SELFTEST=y make sandbox_capsule_defconfig all ./u-boot -d arch/sandbox/dts/test.dtb bootefi selftest CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Andre Przywara <andre.przywara@arm.com> CC: Alexander Graf <agraf@csgraf.de> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi: Add ESRT to the EFI system tableJose Marinho6-4/+535
The ESRT is initialised during efi_init_objlist after efi_initialize_system_table(). The ESRT is recreated from scratch at the following events: - successful UpdateCapsule; - FMP instance install. The code ensures that every ESRT entry has a unique fw_class value. Limitations: - The ESRT is not updated if an FMP instance is uninstalled; - the fields image_type and flags are in the current implementation left undefined. Setting these values will require a per-platform function that returns the image_type/flags as a function of the image fw_class. CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Andre Przywara <andre.przywara@arm.com> CC: Alexander Graf <agraf@csgraf.de> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Remove two EFI_CALL() indirections. Move ESRT GUID in efidebug's list of GUIDs. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Replace config option for initrd loadingIlias Apalodimas3-98/+140
Up to now we install EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader, only falls back to the cmdline interpreted initrd if the protocol is not installed. This creates a problem for EFI installers, since they won't be able to load their own initrd and continue the installation. It also makes the feature hard to use, since we can either have a single initrd or we have to recompile u-boot if the filename changes. So let's introduce a different logic that will decouple the initrd path from the config option we currently have. When defining a UEFI BootXXXX we can use the filepathlist and store a file path pointing to our initrd. Specifically the EFI spec describes: "The first element of the array is a device path that describes the device and location of the Image for this load option. Other device paths may optionally exist in the FilePathList, but their usage is OSV specific" When the EFI application is launched through the bootmgr, we'll try to interpret the extra device path. If that points to a file that exists on our disk, we'll now install the load_file2 and the efi-stub will be able to use it. This opens up another path using U-Boot and defines a new boot flow. A user will be able to control the kernel/initrd pairs without explicit cmdline args or GRUB. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Add helper functions for EFIIlias Apalodimas4-0/+171
A following patch introduces a different logic for loading initrd's based on the EFI_LOAD_FILE2_PROTOCOL. Since similar logic can be applied in the future for other system files (i.e DTBs), let's add some helper functions which will retrieve and parse file paths stored in EFI variables. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-25efi_loader: Add device path related functions for initrd via Boot####Ilias Apalodimas1-5/+105
On the following patches we allow for an initrd path to be stored in Boot#### variables. Specifically we encode in the FIlePathList[] of the EFI_LOAD_OPTIONS for each Boot#### variable. The FilePathList[] array looks like this: kernel - 0xff - VenMedia(initrd GUID) - initrd1 - 0x01 initrd2 - 0xff So let's add the relevant functions to concatenate and retrieve a device path based on a Vendor GUID. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reformat function descriptions. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: Uart device pathHeinrich Schuchardt2-9/+45
When uploading an EFI binary via the UART we need to assign a device path. * Provide devicepath node to text conversion for Uart() node. * Provide function to create Uart() device path. * Add UART support to efi_dp_from_name(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: NULL dereference in EFI consoleHeinrich Schuchardt1-13/+38
Even if CONFIG_DM_VIDEO=y and stdout="vidconsole", a video device may not be available. Check the return values of the relevant functions. If no video output device is available, assume that the serial console is in use. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi: Fix compiler warningsSimon Glass2-4/+4
This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them. Examples: cmd/efidebug.c: In function ‘do_efi_capsule_update’: cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:9: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:19: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ In file included from include/common.h:20, from lib/efi_loader/efi_capsule.c:9: lib/efi_loader/efi_capsule.c: In function ‘efi_update_capsule’: include/efi_loader.h:83:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:229:2: note: in expansion of macro ‘log’ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ ^~~ include/log.h:249:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ include/efi_loader.h:83:2: note: in expansion of macro ‘debug’ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~ lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ‘EFI_ENTRY’ EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ^~~~~~~~~ lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ~~^ %u Signed-off-by: Simon Glass <sjg@chromium.org> Replace (uintptr_t)NULL by 0. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_selftest: Remove loadfile2 for initrd selftestsIlias Apalodimas2-222/+0
We are redefining how u-boot locates the initrd to load via the kernel LoadFile2 protocol. This selftest is not relevant any more, so remove it. A new one will be added later Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_selftest: illegal cast to pointer in initrddumpHeinrich Schuchardt1-1/+1
On 32bit systems u64 cannot directly be cast to void *. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: fix memory type for memory reservation blockMark Kettenis1-1/+1
The (yet unreleased version of the) devicetree specification clearly states that: As with the /reserved-memory node, when booting via UEFI entries in the Memory Reservation Block must also be listed in the system memory map obtained via the GetMemoryMap() toi protect against allocations by UEFI applications. The memory reservation block entries should be listed with type EfiReservedMemoryType. This restores the behaviour that was changed by commit 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory"). Fixes: 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory") Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-25efi_loader: disable GRUB_ARM32_WORKAROUND on ARCH_SUNXIHeinrich Schuchardt1-1/+1
GRUB_ARM32_WORKAROUND can be disabled on ARCH_SUNXI as the Allwinner SoCs only have a level 2 cache controlled via CP15 and not an architecturally defined cache. Having the cache available speeds up booting Linux. On ARCH_BCM283X it is already disabled via rpi_2_defconfig. But let's move this setting to Kconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-19efi_loader: Uart device pathHeinrich Schuchardt2-9/+45
When uploading an EFI binary via the UART we need to assign a device path. * Provide devicepath node to text conversion for Uart() node. * Provide function to create Uart() device path. * Add UART support to efi_dp_from_name(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-19efi_loader: NULL dereference in EFI consoleHeinrich Schuchardt1-13/+38
Even if CONFIG_DM_VIDEO=y and stdout="vidconsole", a video device may not be available. Check the return values of the relevant functions. If no video output device is available, assume that the serial console is in use. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi: Fix compiler warningsSimon Glass2-4/+4
This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them. Examples: cmd/efidebug.c: In function ‘do_efi_capsule_update’: cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:9: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:19: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ In file included from include/common.h:20, from lib/efi_loader/efi_capsule.c:9: lib/efi_loader/efi_capsule.c: In function ‘efi_update_capsule’: include/efi_loader.h:83:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:229:2: note: in expansion of macro ‘log’ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ ^~~ include/log.h:249:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ include/efi_loader.h:83:2: note: in expansion of macro ‘debug’ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~ lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ‘EFI_ENTRY’ EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ^~~~~~~~~ lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ~~^ %u Signed-off-by: Simon Glass <sjg@chromium.org> Replace (uintptr_t)NULL by 0. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi_selftest: Remove loadfile2 for initrd selftestsIlias Apalodimas2-222/+0
We are redefining how u-boot locates the initrd to load via the kernel LoadFile2 protocol. This selftest is not relevant any more, so remove it. A new one will be added later Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi_selftest: illegal cast to pointer in initrddumpHeinrich Schuchardt1-1/+1
On 32bit systems u64 cannot directly be cast to void *. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi_loader: fix memory type for memory reservation blockMark Kettenis1-1/+1
The (yet unreleased version of the) devicetree specification clearly states that: As with the /reserved-memory node, when booting via UEFI entries in the Memory Reservation Block must also be listed in the system memory map obtained via the GetMemoryMap() toi protect against allocations by UEFI applications. The memory reservation block entries should be listed with type EfiReservedMemoryType. This restores the behaviour that was changed by commit 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory"). Fixes: 4cbb2930bd8c ("efi_loader: consider no-map property of reserved memory") Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-16efi_loader: disable GRUB_ARM32_WORKAROUND on ARCH_SUNXIHeinrich Schuchardt1-1/+1
GRUB_ARM32_WORKAROUND can be disabled on ARCH_SUNXI as the Allwinner SoCs only have a level 2 cache controlled via CP15 and not an architecturally defined cache. Having the cache available speeds up booting Linux. On ARCH_BCM283X it is already disabled via rpi_2_defconfig. But let's move this setting to Kconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-15Merge tag 'v2021.04-rc4' into nextTom Rini5-33/+96
Prepare v2021.04-rc4
2021-03-07lib/charset: UTF-8 stream conversionHeinrich Schuchardt1-9/+46
Provide functions to convert an UTF-8 stream to code page 437 or UTF-32. Add unit tests. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-07lib/charset: utf8_get() should return errorHeinrich Schuchardt1-9/+16
utf8_get() should return an error if hitting an illegal UTF-8 sequence and not silently convert the input to a question mark. Correct utf_8() and the its unit test. console_read_unicode() now will ignore illegal UTF-8 sequences. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-07efi_loader: carve out utf_to_cp()Heinrich Schuchardt2-16/+31
Carve out a function to translate a Unicode code point to an 8bit codepage. Provide a unit test for the new function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-07efi_loader: move codepage 437 tableHeinrich Schuchardt2-1/+7
Move the Unicode to codepage 437 table to charset.c Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-07efi_loader: console size of vidconsoleHeinrich Schuchardt1-1/+1
If stdout is 'vidconsole', we correctly set the console size. If stdout is 'vidconsole,serial', the video console is ignored. We should always evaluate the size of vidconsole if it is the primary console. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-03-05lib: kconfig: Mention CONFIG_ADDR_MAP limitation in the helpBin Meng1-0/+2
Mention that CONFIG_ADDR_MAP only works in the post-relocation phase. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-03-05lib: addr_map: Move address_map[] type to the header fileBin Meng1-5/+1
At present address_map[] is static and its type is unknown to external modules. In preparation to create a command to list its contents, this patch moves its type definition and declaration to the header file. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-03-03lib: Fix BINMAN_FDT dependencyBin Meng1-1/+1
lib/binman.c references the following 3 ofnode APIs: ofnode_first_subnode(), ofnode_path() and ofnode_read_bool(). These APIs get built only when DM is on. Fix the dependency then. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-02tpm: Allow disabling platform hierarchy with TPM2Simon Glass1-0/+35
With TPM2 we don't actually lock the TPM once verified boot is finished. Instead we disable the platform hierarchy which serves the same purpose. Add an implementation of this so we can safely boot into the kernel. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Add TPM2 support for write_lockSimon Glass2-1/+24
Implement this API function for TPM2. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Add TPM2 support for read/write valuesSimon Glass2-2/+86
Implement this API function for TPM2. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Add an implementation of define_spaceSimon Glass1-0/+47
Add support for this so that the TPM can be set up for use with Chromium OS verified boot. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Reduce duplication in a few functionsSimon Glass1-5/+8
Update tpm2_clear() and tpm2_pcr_extend() so that the command size is not repeated twice. Add a small comment to the latter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Add a basic API implementation for TPMv2Simon Glass1-7/+77
Add support for TPMv2 versions of API functions. So far this is not complete as the standard is quite large, but it implements everything currently available for TPMv2 in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Switch TPMv1 over to use the new APISimon Glass2-61/+55
Take over the plain 'tpm_...' functions for use by the new TPM API. Rename all the TPMv1 functions so they are called from the API. Update the TPMv1 functions so that they are called from the API. Change existing users to use the tpm1_ prefix so they don't need to go through the API, which might introduce uncertainty. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Add an API that can support v1.2 and v2Simon Glass1-0/+215
There are two different TPM standards. U-Boot supports both but each has its own set of functions. We really need a single TPM API that can call one or the other. This is not always possible as there are some differences between the two standards, but it is mostly possible. Add an API to handle this. So far it is not plumbed into the build and only supports TPMv1. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-03-02tpm: Add debugging of request in tpm_sendrecv_command()Simon Glass1-2/+8
The response is shown but not the request. Update the code to show both if debugging is enabled. Use a 'uint' type for size so it matches the register-word size on both 32- and 64-bit machines. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-02-26efi_loader: limit output length for VenHw, VenMediaHeinrich Schuchardt1-2/+4
VenHw and VenMedia device path nodes may carry vendor defined data of arbitrary length. When converting a device path node to text ensure that we do not overrun our internal buffer. In our implementation of EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText() we could first determine the output length and then allocate buffers but that would nearly double the code size. Therefore keep the preallocated buffers and truncate excessive device paths instead. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-02-26efi_loader: ACPI tables must be in EfiACPIReclaimMemoryHeinrich Schuchardt1-2/+1
The UEFI spec does not allow ACPI tables to be in runtime services memory. It recommends EfiACPIReclaimMemory. Remove a superfluous check that the allocated pages are 16 byte aligned. EFI pages are 4 KiB aligned. Fixes: 86df34d42b05 ("efi_loader: Install ACPI configuration tables") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-02-24lib: sha512: include "compiler.h"Siew Chin Lim1-0/+1
Include "compiler.h" in sha512.c. This is needed by 'cpu_to_be64' macro that used in 'sha512_base_do_finalize' function. Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>