dd1a1ec2 | 05-Mar-2019 |
Matthias Brugger <mbrugger@suse.com> |
efi_loader: Fix serial console size detection
Function term_read_reply tries to read from the serial console until the end_char was read. This can hang forever if we are, for some reason, not able t
efi_loader: Fix serial console size detection
Function term_read_reply tries to read from the serial console until the end_char was read. This can hang forever if we are, for some reason, not able to read the full response (e.g. serial buffer too small, frame error). This patch moves the timeout detection into term_read_reply() to assure we will make progress.
Fixes: 6bb591f704 ("efi_loader: query serial console size reliably") Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Throw missing error when an incomplete reply for the cursor position is received.
Change type of argument of term_get_char() *s32. This renders the function reusable in efi_cin_read_key().
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
1a9fce50 | 28-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: HII protocols: debug messages
When package types are not supported by our implementation of the HII database protocol supported error messages are displayed.
Essentially the output is o
efi_loader: HII protocols: debug messages
When package types are not supported by our implementation of the HII database protocol supported error messages are displayed.
Essentially the output is only needed for debugging. By using EFI_PRINT() the messages are only written for in debug mode and with correct indentation.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
fdef2983 | 28-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: HII protocols: fix new_package_list()
In new_package_list() we call new_packagelist() to create a new package list. Next we try to add the packages which fails for form packages. Due to
efi_loader: HII protocols: fix new_package_list()
In new_package_list() we call new_packagelist() to create a new package list. Next we try to add the packages which fails for form packages. Due to this error we call free_packagelist(). Now in free_packagelist() list_del() is called for an uninitialized field hii->link. This leads to changing random memory addresses.
To solve the problem move the initialization of hii->link to new_packagelist().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
show more ...
|
30a231dc | 23-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: do not add \ in efi_fs_from_name()
In the `efidebug boot add` command we do not want an unsolicited leading backslash added to the file name.
There is no good reason to mark a loaded fi
efi_loader: do not add \ in efi_fs_from_name()
In the `efidebug boot add` command we do not want an unsolicited leading backslash added to the file name.
There is no good reason to mark a loaded file with a backslash as absolute. Anyway when reading files the file name will be interpreted as relative to root directory of the device.
So let's get rid of this backslash.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
454568b4 | 25-Feb-2019 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
efi_loader: define load option attributes
See UEFI specification v2.7a, section 3.1.3, "Load Option Processing."
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Sc
efi_loader: define load option attributes
See UEFI specification v2.7a, section 3.1.3, "Load Option Processing."
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
ccecc345 | 23-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: fix entry count in bootmgr
Since commit 914df75b0c97 ("efi_loader: fix EFI entry counting") entry_count is already set to 1 before efi_bootmgr_load() is called. So we should not incremen
efi_loader: fix entry count in bootmgr
Since commit 914df75b0c97 ("efi_loader: fix EFI entry counting") entry_count is already set to 1 before efi_bootmgr_load() is called. So we should not increment it when entering the function.
Without the patch an assert error occurs in efi_get_variable() if DEBUG is defined.
Fixes: 914df75b0c97 ("efi_loader: fix EFI entry counting") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
33e44971 | 23-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: error message if BootOrder not defined
For booting via `bootefi bootmgr` it is necessary that the EFI variable BootOrder is defined. Provide a diagnostic message if the variable is missi
efi_loader: error message if BootOrder not defined
For booting via `bootefi bootmgr` it is necessary that the EFI variable BootOrder is defined. Provide a diagnostic message if the variable is missing.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
c7cd4afb | 04-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
tpm: simplify: tpm_set_global_lock()
When in pack_byte_string() memcpy() is called for size 0 the source buffer address has no relevance. So we can use NULL here.
Signed-off-by: Heinrich Schuchardt
tpm: simplify: tpm_set_global_lock()
When in pack_byte_string() memcpy() is called for size 0 the source buffer address has no relevance. So we can use NULL here.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
997fc12e | 16-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: do not miss last relocation block
If the last block in the relocation table contains only a single relocation, the current coding ignores it.
Fix the determination of the end of the rel
efi_loader: do not miss last relocation block
If the last block in the relocation table contains only a single relocation, the current coding ignores it.
Fix the determination of the end of the relocation table.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
1db561e1 | 16-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: documentation of image loader
- Add missing function descriptions. - Update existing function descriptions to match Sphinx style. - Add lib/efi_loader/efi_image_loader.c to the input fil
efi_loader: documentation of image loader
- Add missing function descriptions. - Update existing function descriptions to match Sphinx style. - Add lib/efi_loader/efi_image_loader.c to the input files for Sphinx generated documentation.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
914df75b | 09-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: fix EFI entry counting
`bootefi selftest` fails on qemu-x86_defconfig if efi_selftest() is not invoked using EFI_CALL().
Likewise we call the entry point of EFI payloads with EFI_CALL(e
efi_loader: fix EFI entry counting
`bootefi selftest` fails on qemu-x86_defconfig if efi_selftest() is not invoked using EFI_CALL().
Likewise we call the entry point of EFI payloads with EFI_CALL(efi_start_image()).
entry_count indicates if we are in U-Boot (1) or in EFI payload code (0). As we start in U-Boot code the initial value has to be 1.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
f69d63fa | 26-Dec-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: use efi_start_image() for bootefi
Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command.
Signed-off-by: Heinrich Schuch
efi_loader: use efi_start_image() for bootefi
Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
8f7e2b29 | 26-Dec-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage().
Let efi
efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage().
Let efi_load_pe() return a status code and fill in the entry point in the corresponding field of the image object.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
0e18f584 | 24-Dec-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: LoadImage: always allocate new pages
If we want to properly unload images in Exit() the memory should always be allocated in the same way. As we allocate memory when reading from file we
efi_loader: LoadImage: always allocate new pages
If we want to properly unload images in Exit() the memory should always be allocated in the same way. As we allocate memory when reading from file we should do the same when the original image is in memory.
A further patch will be needed to free the memory when Exit() is called.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
16112f9f | 06-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: error handling in efi_setup_loaded_image()
In case of an error we should set the returned pointers to NULL. This ensures that an illegal free does not occur even if the caller calls free
efi_loader: error handling in efi_setup_loaded_image()
In case of an error we should set the returned pointers to NULL. This ensures that an illegal free does not occur even if the caller calls free() for the handles.
If protocols cannot be installed, release all resources.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
60c4454d | 15-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib/vsprintf: print '?' for illegal Unicode sequence
Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings") broke the Unicode unit tests: an illegal UTF16 code point should be
lib/vsprintf: print '?' for illegal Unicode sequence
Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings") broke the Unicode unit tests: an illegal UTF16 code point should be printed as '?'.
Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
d787cadd | 09-Jan-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_selftest: LoadImage from file device path
Provide a unit test that calls LoadImage() with a file device path and executes the application via StartImage().
Signed-off-by: Heinrich Schuchardt <x
efi_selftest: LoadImage from file device path
Provide a unit test that calls LoadImage() with a file device path and executes the application via StartImage().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
95288b1e | 04-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: comments for efi_file_from_path()
Add more comments for efi_file_from_path().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> |
caf6d2fd | 04-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: efi_dp_split_file_path() error handling
If the path passed to efi_dp_split_file_path() does not contain a reference to a file it returns EFI_OUT_OF_RESOURCES. This does not properly indi
efi_loader: efi_dp_split_file_path() error handling
If the path passed to efi_dp_split_file_path() does not contain a reference to a file it returns EFI_OUT_OF_RESOURCES. This does not properly indicate the kind of the problem that occurred. Return EFI_INVALID_PARAMETER instead.
Update function description.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
ee3c8ba8 | 12-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_selftest: fix memory allocation in HII tests
In efi_selftest we are in EFI land. We cannot call U-Boot library functions malloc() and free() but should use the boot time services instead.
Signe
efi_selftest: fix memory allocation in HII tests
In efi_selftest we are in EFI land. We cannot call U-Boot library functions malloc() and free() but should use the boot time services instead.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@suse.de>
show more ...
|
afa17aa2 | 12-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_selftest: do not use efi_free_pool()
In efi_selftest we are in EFI land. We should not use U-Boot library functions but boot time services for memory management.
Signed-off-by: Heinrich Schucha
efi_selftest: do not use efi_free_pool()
In efi_selftest we are in EFI land. We should not use U-Boot library functions but boot time services for memory management.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@suse.de>
show more ...
|
823c233b | 09-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: fix EFI_FILE_PROTOCOL.GetInfo()
We check the existence of files with fs_exist(). This function calls fs_close(). If we do not set the active block device again fs_opendir() fails and we
efi_loader: fix EFI_FILE_PROTOCOL.GetInfo()
We check the existence of files with fs_exist(). This function calls fs_close(). If we do not set the active block device again fs_opendir() fails and we do not set the flag EFI_FILE_DIRECTORY. Due to this error the `cd` command in the EFI shell fails.
So let's add the missing set_blk_dev(fh) call.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
0e66c10a | 10-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib: vsprintf: avoid overflow printing UTF16 strings
We have to ensure while printing UTF16 strings that we do not exceed the end of the print buffer.
Signed-off-by: Heinrich Schuchardt <xypron.glp
lib: vsprintf: avoid overflow printing UTF16 strings
We have to ensure while printing UTF16 strings that we do not exceed the end of the print buffer.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
5fbb2895 | 11-Feb-2019 |
Alexander Graf <agraf@suse.de> |
efi_loader: Make HII a config option
Heinrich ran into issues with HII and iPXE which lead to #SErrors on his Odroid-C2 system. We definitely do not want to regress just yet, so let's not expose the
efi_loader: Make HII a config option
Heinrich ran into issues with HII and iPXE which lead to #SErrors on his Odroid-C2 system. We definitely do not want to regress just yet, so let's not expose the HII protocols by default.
Instead, let's make it a config option that people can play with This way, we can stabilize the code in tree without breaking any users.
Once someone figures out, why this breaks iPXE (probably a NULL dereference), we can enable it by default.
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
---
v1 -> v2:
- Remove HII selftest as well
v2 -> v3:
- Make config option
show more ...
|
6f8f4217 | 23-Jan-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: debug output for HII protocols
For correct indention use EFI_PRINT() instead of debug().
For printing efi_uintn_t or size_t use the %zu or %zx format code.
Signed-off-by: Heinrich Schu
efi_loader: debug output for HII protocols
For correct indention use EFI_PRINT() instead of debug().
For printing efi_uintn_t or size_t use the %zu or %zx format code.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|