14deb5e6 | 30-Aug-2018 |
Stephen Warren <swarren@nvidia.com> |
Revert "Revert "efi_loader: efi_allocate_pages is too restrictive""
This reverts commit ccfc78b820e5e431c5bd73b072e7536a972e1710.
Now that the underlying issue is fixed, we can revert the revert an
Revert "Revert "efi_loader: efi_allocate_pages is too restrictive""
This reverts commit ccfc78b820e5e431c5bd73b072e7536a972e1710.
Now that the underlying issue is fixed, we can revert the revert and hence restore the original EFI code.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
75cb1cd2 | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib: charset: remove obsolete functions
Remove functions: - utf8_to_utf16() - utf16_strcpy() - utf16_strdup()
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <
lib: charset: remove obsolete functions
Remove functions: - utf8_to_utf16() - utf16_strcpy() - utf16_strdup()
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
ba7bd5c2 | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: don't use unlimited stack as buffer
The length of a string printed to the console by the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL is not limited by the UEFI spec. Hence should not allocate a buff
efi_loader: don't use unlimited stack as buffer
The length of a string printed to the console by the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL is not limited by the UEFI spec. Hence should not allocate a buffer for it on the stack.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
dcdb64f7 | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: remove limit on variable length
The EFI spec does not provide a length limit for variables.
Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@g
efi_loader: remove limit on variable length
The EFI spec does not provide a length limit for variables.
Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
31bd711c | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib: vsprintf: correct printing of Unicode strings
The width and precision of the printf() function refer to the number of characters not to the number of bytes printed.
Signed-off-by: Heinrich Sch
lib: vsprintf: correct printing of Unicode strings
The width and precision of the printf() function refer to the number of characters not to the number of bytes printed.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
f11a164b | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
test: unit tests for Unicode functions
Provide unit tests for Unicode functions.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de> |
d8c28232 | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib: charset: utility functions for Unicode
utf8_get() - get next UTF-8 code point from buffer utf8_put() - write UTF-8 code point to buffer utf8_utf16_strnlen() - length of a utf-8 string after con
lib: charset: utility functions for Unicode
utf8_get() - get next UTF-8 code point from buffer utf8_put() - write UTF-8 code point to buffer utf8_utf16_strnlen() - length of a utf-8 string after conversion to utf-16 utf8_utf16_strncpy() - copy a utf-8 string to utf-16 utf16_get() - get next UTF-16 code point from buffer utf16_put() - write UTF-16 code point to buffer utf16_strnlen() - number of codes points in a utf-16 string utf16_utf8_strnlen() - length of a utf-16 string after conversion to utf-8 utf16_utf8_strncpy() - copy a utf-16 string to utf-8
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
1dde0d57 | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: rename utf16_strlen, utf16_strnlen
The function names utf16_strlen() and utf16_strnlen() are misnomers. The functions do not count utf-16 characters but non-zero words. So let's rename t
efi_loader: rename utf16_strlen, utf16_strnlen
The function names utf16_strlen() and utf16_strnlen() are misnomers. The functions do not count utf-16 characters but non-zero words. So let's rename them to u16_strlen and u16_strnlen().
In utf16_dup() avoid assignment in if clause.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
fbb3ea80 | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib: build charset.o only if needed
charset.o is only needed for the EFI subsystem
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de> |
4ddcc4e5 | 31-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)
Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.
Suggested-by: Alexander Graf <agraf@suse.de> Signed-off-by: Heinrich Schuc
vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)
Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.
Suggested-by: Alexander Graf <agraf@suse.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
d5a5a5a7 | 08-Aug-2018 |
Alexander Graf <agraf@suse.de> |
efi_loader: Pass address to fs_read()
The fs_read() function wants to get an address rather than the pointer to a buffer.
So let's convert the passed buffer from pointer back a the address to make
efi_loader: Pass address to fs_read()
The fs_read() function wants to get an address rather than the pointer to a buffer.
So let's convert the passed buffer from pointer back a the address to make efi_loader on sandbox happier.
Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
efe79a7c | 26-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_selftest: test for loaded image protocol
Verify that the loaded image protocol is installed on the image handle. Verify that the loaded image protocol points to the system table.
Signed-off-by:
efi_selftest: test for loaded image protocol
Verify that the loaded image protocol is installed on the image handle. Verify that the loaded image protocol points to the system table.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
7e1effce | 26-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: pass system table in loaded image protocol
The system table must be passed as a pointer in the loaded image protocol.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-
efi_loader: pass system table in loaded image protocol
The system table must be passed as a pointer in the loaded image protocol.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
e470efd2 | 26-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_selftest: memory leak testing manage protocols
Remove memory leak in efi_selftest_manageprotocols.c.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf
efi_selftest: memory leak testing manage protocols
Remove memory leak in efi_selftest_manageprotocols.c.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
b87b0d8d | 06-Sep-2018 |
Miquel Raynal <miquel.raynal@bootlin.com> |
lib: strto: fix metric suffix parsing in strtoul[l]
While 1kB or 1kiB will be parsed correctly, 1k will return the right amount, but the metric suffix will not be escaped once the char pointer updat
lib: strto: fix metric suffix parsing in strtoul[l]
While 1kB or 1kiB will be parsed correctly, 1k will return the right amount, but the metric suffix will not be escaped once the char pointer updated. Fix this situation by simplifying the move of the endp pointer.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Stefan Roese <sr@denx.de>
show more ...
|
a353e6aa | 06-Sep-2018 |
Miquel Raynal <miquel.raynal@bootlin.com> |
lib: strto: parse all lowercase metric prefixes in ustrtoul[l]
Both ustrtoul and ustrtoull interpret 1k but not 1m or 1g. Even if the SI symbols for Mega and Giga are 'M' and 'G', certain entries of
lib: strto: parse all lowercase metric prefixes in ustrtoul[l]
Both ustrtoul and ustrtoull interpret 1k but not 1m or 1g. Even if the SI symbols for Mega and Giga are 'M' and 'G', certain entries of eg. mtdparts also use (wrongly) the metric prefix 'm' and 'g'.
I do not see how parsing lowercase prefixes could break anything, so parse them like their uppercase counterpart.
Also, even though kiB is not equal to kB in general, lets not change U-Boot behavior and always use kiB and kB (same applies for MiB vs. MB and GiB vs. GB) as a representation for 1024 instead of 1000.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Stefan Roese <sr@denx.de>
show more ...
|
9c2cb97e | 03-Aug-2018 |
Bin Meng <bmeng.cn@gmail.com> |
lib: bitrev: Sync with Linux kernel v4.17
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> |
dee37fc9 | 06-Aug-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
Remove <inttypes.h> includes and PRI* usages in printf() entirely
In int-ll64.h, we always use the following typedefs:
typedef unsigned int u32; typedef unsigned long uintptr_t;
Remove <inttypes.h> includes and PRI* usages in printf() entirely
In int-ll64.h, we always use the following typedefs:
typedef unsigned int u32; typedef unsigned long uintptr_t; typedef unsigned long long u64;
This does not need to match to the compiler's <inttypes.h>. Do not include it.
The use of PRI* makes the code super-ugly. You can simply use "l" for printing uintptr_t, "ll" for u64, and no modifier for u32.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
f8503719 | 09-Sep-2018 |
Marek Vasut <marek.vasut@gmail.com> |
fdt: fix get_next_memory_node()
The get_next_memory_node() always sets mem to -1 , which is incorrect, because then every iteration of memory bank parsing will start from the first memory bank inste
fdt: fix get_next_memory_node()
The get_next_memory_node() always sets mem to -1 , which is incorrect, because then every iteration of memory bank parsing will start from the first memory bank instead of the previous one.
On systems with 1 memory bank defined in DT and CONFIG_NR_DRAM_BANKS=4 , like ie. r8a77965-salvator-x , this will result in U-Boot incorrectly reporting four identical memory banks with the same memory configuration.
Fix this by setting mem to startoffset value, which restores the behavior before the fixed patch was applied.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jens Wiklander <jens.wiklander@linaro.org> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Fixes: 452bc121027d ("fdt: fix fdtdec_setup_memory_banksize()") Tested-by: Michal Simek <michal.simek@xilinx.com> [on ZynqMP}
show more ...
|
f2906e5f | 02-Sep-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib/slre: remove superfluous assignment
It makes no sense to assign a value to 'res' if the next use of the variable is an assignment.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> |
e3332e1a | 24-Aug-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
Make kmalloc'ed memory really DMA-safe
In Linux, the memory returned by kmalloc() is DMA-capable. However, it is not true in U-Boot.
At a glance, kmalloc() in U-Boot returns address aligned with AR
Make kmalloc'ed memory really DMA-safe
In Linux, the memory returned by kmalloc() is DMA-capable. However, it is not true in U-Boot.
At a glance, kmalloc() in U-Boot returns address aligned with ARCH_DMA_MINALIGN. However, it never pads the allocated memory. This half-way house is completely useless because calling kmalloc() and malloc() in this order causes a cache sharing problem.
Change the implementation to call malloc_cache_aligned(), which allocates really DMA-capable memory.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
cbe503fb | 23-Aug-2018 |
Bin Meng <bmeng.cn@gmail.com> |
efi: stub: Pass EFI system table address to U-Boot payload
This updates the EFI stub codes to pass UEFI BIOS's system table address to U-Boot payload so that U-Boot can utilize it.
Signed-off-by: B
efi: stub: Pass EFI system table address to U-Boot payload
This updates the EFI stub codes to pass UEFI BIOS's system table address to U-Boot payload so that U-Boot can utilize it.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
ecc6f6be | 13-Aug-2018 |
Ievgen Maliarenko <ievgen.maliarenko@globallogic.com> |
libavb: Handle wrong hashtree_error_mode in avb_append_options()
Exit with AVB_SLOT_VERIFY_RESULT_ERROR_INVALID_ARGUMENT when hashtree_error_mode value passed to avb_append_options() is unknown (not
libavb: Handle wrong hashtree_error_mode in avb_append_options()
Exit with AVB_SLOT_VERIFY_RESULT_ERROR_INVALID_ARGUMENT when hashtree_error_mode value passed to avb_append_options() is unknown (not from AvbHashtreeErrorMode enum).
Otherwise, default value is not handled in the switch(hashtree_error_mode), which causes below compile warning:
lib/libavb/avb_cmdline.c: In function ‘avb_append_options’: lib/libavb/avb_cmdline.c:354:13: warning: ‘dm_verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized] new_ret = avb_replace( ~~~~~~~~^~~~~~~~~~~~~~ slot_data->cmdline, "$(ANDROID_VERITY_MODE)", dm_verity_mode); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/libavb/avb_cmdline.c:363:8: warning: ‘verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (!cmdline_append_option( ^~~~~~~~~~~~~~~~~~~~~~ slot_data, "androidboot.veritymode", verity_mode)) {
Signed-off-by: Ievgen Maliarenko <ievgen.maliarenko@globallogic.com> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
show more ...
|
9b89183b | 14-Jul-2018 |
Eugeniu Rosca <roscaeugeniu@gmail.com> |
efi: Fix truncation of constant value
Starting with commit 867a6ac86dd8 ("efi: Add start-up library code"), sparse constantly complains about truncated constant value in efi.h:
include/efi.h:176:35
efi: Fix truncation of constant value
Starting with commit 867a6ac86dd8 ("efi: Add start-up library code"), sparse constantly complains about truncated constant value in efi.h:
include/efi.h:176:35: warning: cast truncates bits from constant value (8000000000000000 becomes 0)
This can get quite noisy, preventing real issues to be noticed:
$ make defconfig *** Default configuration is based on 'sandbox_defconfig' $ make C=2 -j12 2>&1 | grep truncates | wc -l 441
After the patch is applied: $ make C=2 -j12 2>&1 | grep truncates | wc -l 0 $ sparse --version v0.5.2
Following the suggestion of Heinrich Schuchardt, instead of only fixing the root-cause, I replaced the whole enum of _SHIFT values by ULL defines. This matches both the UEFI 2.7 spec and the Linux kernel implementation.
Some ELF size comparison before and after the patch (gcc 7.3.0):
efi-x86_payload64_defconfig: text data bss dec hex filename 407174 29432 278676 715282 aea12 u-boot.old 407152 29464 278676 715292 aea1c u-boot.new -22 +32 0 +10
efi-x86_payload32_defconfig: text data bss dec hex filename 447075 30308 280076 757459 b8ed3 u-boot.old 447053 30340 280076 757469 b8edd u-boot.new -22 +32 0 +10
Fixes: 867a6ac86dd8 ("efi: Add start-up library code") Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
9d12daff | 05-Jul-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()
Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
This should resolve the error reported by the SCT in Protocol/SimpleTextOut/B
efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()
Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
This should resolve the error reported by the SCT in Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_uefi.c:639
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|