[PATCH v2] efi_loader: fix append write behavior to non-existent variable

2024-04-02 Thread Masahisa Kojima
the U-Boot file storage implementation to get aligned with the EDK II reference implementation. Signed-off-by: Masahisa Kojima --- v1 -> v2 - return EFI_SUCCESS for append write with data size 0 - add comment that we follow the EDK II implementation lib/efi_loader/efi_variable.c

[PATCH] board: developerbox: fix mem_map setup timing

2024-03-05 Thread Masahisa Kojima
IP and bss is available in dram_init(), let's move mem_map setup in dram_init(). Signed-off-by: Masahisa Kojima --- board/socionext/developerbox/developerbox.c | 60 - 1 file changed, 21 insertions(+), 39 deletions(-) diff --git a/board/socionext/developerbox/developerbox.c b/board

[PATCH] efi_loader: accept append write with valid size and data

2024-03-03 Thread Masahisa Kojima
Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_variable.c | 13 +- lib/efi_selftest/efi_selftest_variables.c | 30 +-- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index

[PATCH v2] board: synquacer: developerbox: add myself as maintainer

2024-02-29 Thread Masahisa Kojima
Add myself as maintainer for SynQuacer Developerbox, as I'm currently working on it. This commit also removes Jassi from maintainer since he no longer has a Developerbox. Cc: Jassi Brar Signed-off-by: Masahisa Kojima --- v1 -> v2 - remove Jassi from maintainer board/socionext/developer

[PATCH] board: synquacer: developerbox: add myself as co-maintainer

2024-02-29 Thread Masahisa Kojima
Add myself as co-maintainer for SynQuacer Developerbox, as I'm currently working on it. Signed-off-by: Masahisa Kojima --- board/socionext/developerbox/MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/board/socionext/developerbox/MAINTAINERS b/board/socionext/developerbox

[PATCH v2] FWU: developerbox: read boot index from NOR flash

2024-02-28 Thread Masahisa Kojima
. Signed-off-by: Masahisa Kojima --- v1 -> v2 - update my email address board/socionext/developerbox/fwu_plat.c | 31 + include/configs/synquacer.h | 1 + 2 files changed, 32 insertions(+) diff --git a/board/socionext/developerbox/fwu_plat.c b/board/socion

[PATCH] FWU: developerbox: read boot index from NOR flash

2024-02-07 Thread Masahisa Kojima
. Signed-off-by: Masahisa Kojima --- board/socionext/developerbox/fwu_plat.c | 31 + include/configs/synquacer.h | 1 + 2 files changed, 32 insertions(+) diff --git a/board/socionext/developerbox/fwu_plat.c b/board/socionext/developerbox/fwu_plat.c index

[PATCH v2] efi_loader: check efi_get_variable_int return value

2024-01-28 Thread Masahisa Kojima
efi_get_variable_int() may fail, the buffer should be cleared before using it. Signed-off-by: Masahisa Kojima Addresses-Coverity-ID: 478333 ("Error handling issues") --- Changes in v2: - use malloc instead of calloc lib/efi_loader/efi_firmware.c | 10 +- 1 file changed, 5

Re: [PATCH] efi_loader: check efi_get_variable_int return value

2024-01-28 Thread Masahisa Kojima
On Fri, 26 Jan 2024 at 21:58, Heinrich Schuchardt wrote: > > On 26.01.24 12:36, Masahisa Kojima wrote: > > Hi Heinrich, > > > > On Fri, 26 Jan 2024 at 16:20, Heinrich Schuchardt > > wrote: > >> > >> On 1/22/24 08:26, Masahisa Kojima wrote: &

Re: [PATCH] efi_loader: check efi_get_variable_int return value

2024-01-26 Thread Masahisa Kojima
Hi Heinrich, On Fri, 26 Jan 2024 at 16:20, Heinrich Schuchardt wrote: > > On 1/22/24 08:26, Masahisa Kojima wrote: > > efi_get_variable_int() may fail, the buffer should be > > cleared before using it. > > > > Signed-off-by: Masahisa Kojima > > Addresses-

[PATCH v2] efi_loader: migrate SMBIOS 3.0 entry point structure for measurement

2024-01-25 Thread Masahisa Kojima
SMBIOS3_TABLE_GUID instead of SMBIOS_TABLE_GUID. Signed-off-by: Masahisa Kojima --- Changes in v2: - add SMBIOS 3.0 anchor string check include/efi_loader.h | 1 + include/smbios.h | 4 +- lib/efi_loader/efi_tcg2.c| 19 -- lib/efi_selftest

[PATCH] smbios: use struct_table_length to get SMBIOS 2.1 total table length

2024-01-24 Thread Masahisa Kojima
b ("smbios: copy QEMU tables") Signed-off-by: Masahisa Kojima --- drivers/misc/qfw_smbios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/qfw_smbios.c b/drivers/misc/qfw_smbios.c index 9019345783..a898cb4eea 100644 --- a/drivers/misc/qfw_smbios.

Re: [PATCH] efi_loader: migrate SMBIOS 3.0 entry point structure for measurement

2024-01-24 Thread Masahisa Kojima
Hi Heinrich, On Wed, 24 Jan 2024 at 22:54, Heinrich Schuchardt wrote: > > On 24.01.24 12:51, Masahisa Kojima wrote: > > Hi Heinrich, > > > > On Wed, 24 Jan 2024 at 18:29, Heinrich Schuchardt > > wrote: > >> > >> On 1/24/24 10:15, Masahisa

Re: [PATCH] efi_loader: migrate SMBIOS 3.0 entry point structure for measurement

2024-01-24 Thread Masahisa Kojima
Hi Heinrich, On Wed, 24 Jan 2024 at 18:29, Heinrich Schuchardt wrote: > > On 1/24/24 10:15, Masahisa Kojima wrote: > > Current U-Boot only supports the SMBIOS 3.0 entry point structure. > > TCG2 measurement code should migrate to SMBIOS 3.0 entry > > point structure. &

[PATCH] efi_loader: migrate SMBIOS 3.0 entry point structure for measurement

2024-01-24 Thread Masahisa Kojima
SMBIOS3_TABLE_GUID instead of SMBIOS_TABLE_GUID. Signed-off-by: Masahisa Kojima --- include/efi_loader.h | 1 + include/smbios.h | 4 +- lib/efi_loader/efi_tcg2.c| 14 ++-- lib/efi_selftest/efi_selftest_tcg2.c | 97 +--- lib/smbios

[PATCH] efi_loader: check efi_get_variable_int return value

2024-01-21 Thread Masahisa Kojima
efi_get_variable_int() may fail, the buffer should be cleared before using it. Signed-off-by: Masahisa Kojima Addresses-Coverity-ID: 478333 ("Error handling issues") --- lib/efi_loader/efi_firmware.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/

Re: New Defects reported by Coverity Scan for Das U-Boot

2024-01-21 Thread Masahisa Kojima
ar_state buffer is allocated by calloc(), and efi_get_variable_int() will not update the buffer in case of error. But it is better to set NUL values to var_state, I will send a fix. Thanks, Masahisa Kojima > > Best regards > > Heinrich

[PATCH v3 3/3] efi_loader: return immediately in UCLASS_EFI_LOADER removal

2024-01-18 Thread Masahisa Kojima
In case of UCLASS_EFI_LOADER, EFI handles are managed by EFI application/driver, we must not delete EFI handles. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/efi_loader/efi_disk.c b/lib

[PATCH v3 2/3] efi_loader: create common function to free struct efi_disk_obj

2024-01-18 Thread Masahisa Kojima
, this commit creates the common function to free the struct efi_disk_obj resources and calls it in case of error. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- lib/efi_loader/efi_disk.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff

[PATCH v3 1/3] efi_loader: avoid pointer access after calling efi_delete_handle

2024-01-18 Thread Masahisa Kojima
ing efi_delete_handle(). This commit also fixes the missing free for volume member in struct efi_disk_obj. This commit also removes the container_of() calls, and adds the TODO comment of missing efi_close_protocol() call for the parent EFI_BLOCK_IO_PROTOCOL. Signed-off-by: Masahisa Kojima Revie

[PATCH v3 0/3] fix and refactoring of efi_disk.c

2024-01-18 Thread Masahisa Kojima
iately in UCLASS_EFI_LOADER removal Masahisa Kojima (3): efi_loader: avoid pointer access after calling efi_delete_handle efi_loader: create common function to free struct efi_disk_obj efi_loader: return immediately in UCLASS_EFI_LOADER removal lib/efi_loader/efi_disk.

Re: [PATCH v2 1/3] efi_loader: avoid pointer access after calling efi_delete_handle

2024-01-17 Thread Masahisa Kojima
On Wed, 17 Jan 2024 at 20:52, Ilias Apalodimas wrote: > > Hi Kojima-san > > On Wed, 17 Jan 2024 at 11:46, Masahisa Kojima > wrote: > > > > efi_delete_handle() calls efi_purge_handle(), then it finally > > frees the EFI handle. > > Both diskobj and han

[PATCH v2 3/3] efi_loader: return immediately in UCLASS_EFI_LOADER removal

2024-01-17 Thread Masahisa Kojima
In case of UCLASS_EFI_LOADER, EFI handles are managed by EFI application/driver, we must not delete EFI handles. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/efi_loader/efi_disk.c b/lib

[PATCH v2 2/3] efi_loader: create common function to free struct efi_disk_obj

2024-01-17 Thread Masahisa Kojima
, this commit creates the common function to free the struct efi_disk_obj resources and calls it in case of error. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/efi_loader/efi_disk.c

[PATCH v2 1/3] efi_loader: avoid pointer access after calling efi_delete_handle

2024-01-17 Thread Masahisa Kojima
ing efi_delete_handle(). This commit also fixes the missing free for volume member in struct efi_disk_obj. This commit also removes the container_of() calls, and adds the TODO comment of missing efi_close_protocol() call for the parent EFI_BLOCK_IO_PROTOCOL. Signed-off-by: Masahisa Kojima ---

[PATCH v2 0/3] fix and refactoring of efi_disk.c

2024-01-17 Thread Masahisa Kojima
This series fixes the memory leak issue in lib/efi_loader/efi_disk.c and refactor the efi_disk_remove() implementation. [Changelog] v1 -> v2 - remove already merged patch - remove container_of() calls - add TODO comments - return immediately in UCLASS_EFI_LOADER removal Masahisa Kojima

Re: [PATCH 2/3] efi_loader: avoid pointer access after calling efi_delete_handle

2024-01-15 Thread Masahisa Kojima
Hi Heinrich, On Tue, 26 Dec 2023 at 10:43, Heinrich Schuchardt wrote: > > > > Am 26. Dezember 2023 02:13:08 MEZ schrieb Masahisa Kojima > : > >Hi Heinrich, > > > >On Mon, 25 Dec 2023 at 19:05, Heinrich Schuchardt wrote: > >> >

[PATCH v3 3/3] efi_loader: auto-generate removable media boot option first

2024-01-11 Thread Masahisa Kojima
This commit auto-generates the boot option for removable block io devices followed by fixed block io devices. This is what EDK II reference implementation does. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_bootmgr.c | 33 ++--- 1 file changed, 26 insertions

[PATCH v3 2/3] efi_loader: auto-generate boot option for each blkio device

2024-01-11 Thread Masahisa Kojima
modifies the efibootmgr to get aligned to EDK II. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_bootmgr.c | 101 ++- 1 file changed, 75 insertions(+), 26 deletions(-) diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index eda2619142

[PATCH v3 1/3] efi_loader: rename check_disk_has_default_file function

2024-01-11 Thread Masahisa Kojima
check_disk_has_default_file() function checks if the architecture-specific default file exists in the blk device, and fills the default file device path if it exists. Rename the function name to fill_default_file_path(). Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_bootmgr.c | 10

[PATCH v3 0/3] fix auto-generated boot options

2024-01-11 Thread Masahisa Kojima
ame misleading function and variable name - fix comments v1 -> v2 - fix make htmldocs error - fix bootmenu python test failure Masahisa Kojima (3): efi_loader: rename check_disk_has_default_file function efi_loader: auto-generate boot option for each blkio device efi_loader: auto-ge

[PATCH v3 2/2] efi_loader: support fmp versioning for multi bank update

2024-01-10 Thread Masahisa Kojima
-by: Masahisa Kojima --- lib/efi_loader/efi_firmware.c | 75 --- 1 file changed, 60 insertions(+), 15 deletions(-) diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index e558336bc1..9fd13297a6 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib

[PATCH v3 1/2] fwu: fix fwu_get_image_index interface

2024-01-10 Thread Masahisa Kojima
, it is better that FWU returns the dfu_alt_num. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- include/fwu.h | 13 + lib/efi_loader/efi_firmware.c | 11 +-- lib/fwu_updates/fwu.c | 32 3 files changed, 26

[PATCH v3 0/2] fix FMP versioning for FWU multi bank update

2024-01-10 Thread Masahisa Kojima
_index() function to return the dfu_alt_num - store firmware version into the array of fmp_state structure Masahisa Kojima (2): fwu: fix fwu_get_image_index interface efi_loader: support fmp versioning for multi bank update include/fwu.h | 13 ++ lib/efi_loader/efi_firmware.

Re: [PATCH v2 2/2] efi_loader: support fmp versioning for multi bank update

2024-01-10 Thread Masahisa Kojima
Hi Ilias, On Thu, 11 Jan 2024 at 10:53, Masahisa Kojima wrote: > > On Wed, 10 Jan 2024 at 18:10, Ilias Apalodimas > wrote: > > > > On Wed, 10 Jan 2024 at 02:53, Masahisa Kojima > > wrote: > > > > > > On Tue, 9 Jan 2024 at 22:02, Ilias Apalodimas >

Re: [PATCH v2 1/2] efi_loader: auto-generate boot option for each blkio device

2024-01-10 Thread Masahisa Kojima
Hi Heinrich, On Wed, 10 Jan 2024 at 22:53, Heinrich Schuchardt wrote: > > On 26.12.23 07:28, Masahisa Kojima wrote: > > Current efibootmgr auto-generates the boot option for all > > disks and partitions installing EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, > > while EDK II refer

Re: [PATCH v2 2/2] efi_loader: support fmp versioning for multi bank update

2024-01-10 Thread Masahisa Kojima
On Wed, 10 Jan 2024 at 18:10, Ilias Apalodimas wrote: > > On Wed, 10 Jan 2024 at 02:53, Masahisa Kojima > wrote: > > > > On Tue, 9 Jan 2024 at 22:02, Ilias Apalodimas > > wrote: > > > > > > On Tue, 9 Jan 2024 at 03:00, Masahisa K

Re: [PATCH v2 2/2] efi_loader: support fmp versioning for multi bank update

2024-01-09 Thread Masahisa Kojima
On Tue, 9 Jan 2024 at 22:02, Ilias Apalodimas wrote: > > On Tue, 9 Jan 2024 at 03:00, Masahisa Kojima > wrote: > > > > Hi Ilias, > > > > On Thu, 28 Dec 2023 at 00:14, Ilias Apalodimas > > wrote: > > > > > > Kojima-san > > > >

Re: [PATCH v2 1/2] efi_loader: auto-generate boot option for each blkio device

2024-01-08 Thread Masahisa Kojima
tion(, (u8 > > **)[num].lo); > > + if (!opt[num].size) { > > I am a bit lost here. Why are we using 'num' instead of 'i'? The opt > variable contains all media boot options with a block_io_protocol right? > Aren't we going to copy the wrong load options in optio

Re: [PATCH v2 2/2] efi_loader: support fmp versioning for multi bank update

2024-01-08 Thread Masahisa Kojima
Hi Ilias, On Thu, 28 Dec 2023 at 00:14, Ilias Apalodimas wrote: > > Kojima-san > > On Thu, Dec 21, 2023 at 06:52:58PM +0900, Masahisa Kojima wrote: > > This commit stores the firmware version into the array > > of fmp_state structure to support the fmp versioning &

[PATCH v2 2/2] efi_loader: auto-generate removable media boot option first

2023-12-25 Thread Masahisa Kojima
This commit auto-generates the boot option for removable block io devices followed by fixed block io devices. This is what EDK II reference implementation does. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_bootmgr.c | 35 +++ 1 file changed, 27

[PATCH v2 1/2] efi_loader: auto-generate boot option for each blkio device

2023-12-25 Thread Masahisa Kojima
modifies the efibootmgr to get aligned to EDK II. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_bootmgr.c | 94 +++- 1 file changed, 71 insertions(+), 23 deletions(-) diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 56d97f2382

[PATCH v2 0/2] fix auto-generated boot options

2023-12-25 Thread Masahisa Kojima
ake htmldocs error - fix bootmenu python test failure Masahisa Kojima (2): efi_loader: auto-generate boot option for each blkio device efi_loader: auto-generate removable media boot option first lib/efi_loader/efi_bootmgr.c | 121 +++ 1 file changed, 94 inserti

Re: [PATCH 0/2] fix auto-generated boot options

2023-12-25 Thread Masahisa Kojima
On Tue, 26 Dec 2023 at 02:14, Heinrich Schuchardt wrote: > > On 12/20/23 09:41, Masahisa Kojima wrote: > > This series aims to get aligned to the EDK II reference > > implementation for auto-generated boot options, and tries > > to address the following issue. > >

Re: [PATCH 1/2] efi_loader: auto-generate boot option for each blkio device

2023-12-25 Thread Masahisa Kojima
On Mon, 25 Dec 2023 at 21:22, Heinrich Schuchardt wrote: > > On 12/20/23 09:41, Masahisa Kojima wrote: > > Current efibootmgr auto-generates the boot option for all > > disks and partitions installing EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, > > while EDK II reference imple

Re: [PATCH 3/3] efi_loader: create common function to free struct efi_disk_obj

2023-12-25 Thread Masahisa Kojima
On Mon, 25 Dec 2023 at 19:31, Heinrich Schuchardt wrote: > > On 12/25/23 05:43, Masahisa Kojima wrote: > > Current error handling of creating raw disk/partition has > > following issues. > > - duplicate free for efi handle, efi handle is already freed > > in ef

Re: [PATCH 2/3] efi_loader: avoid pointer access after calling efi_delete_handle

2023-12-25 Thread Masahisa Kojima
Hi Heinrich, On Mon, 25 Dec 2023 at 19:05, Heinrich Schuchardt wrote: > > On 12/25/23 05:43, Masahisa Kojima wrote: > > efi_delete_handle() calls efi_purge_handle(), then it finally > > frees the efi handle. > > Both diskobj and handle variables in efi_disk_remove() have

[PATCH 3/3] efi_loader: create common function to free struct efi_disk_obj

2023-12-24 Thread Masahisa Kojima
, this commit creates the common function to free the struct efi_disk_obj resources and calls it in case of error. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/efi_loader/efi_disk.c b

[PATCH 2/3] efi_loader: avoid pointer access after calling efi_delete_handle

2023-12-24 Thread Masahisa Kojima
ing efi_delete_handle(). This commit also fixes the missing free for volume member in struct efi_disk_obj. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_dis

[PATCH 1/3] efi_loader: remove unused members from struct efi_disk_obj

2023-12-24 Thread Masahisa Kojima
part and dev_index in struct efi_disk_obj are not used, let's remove it. This commit also removes the invalid structure comment for @dev, it does not exist. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff

[PATCH 0/3] fix and refactoring of efi_disk.c

2023-12-24 Thread Masahisa Kojima
This series fixes the memory leak issue in lib/efi_loader/efi_disk.c and removes the unused members in struct efi_disk_obj. Masahisa Kojima (3): efi_loader: remove unused members from struct efi_disk_obj efi_loader: avoid pointer access after calling efi_delete_handle efi_loader: create

[PATCH v2 2/2] efi_loader: support fmp versioning for multi bank update

2023-12-21 Thread Masahisa Kojima
-by: Masahisa Kojima --- lib/efi_loader/efi_firmware.c | 69 +++ 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index 9b8630625f..5459f3d38d 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib

[PATCH v2 1/2] fwu: fix fwu_get_image_index interface

2023-12-21 Thread Masahisa Kojima
, it is better that FWU returns the dfu_alt_num. Signed-off-by: Masahisa Kojima --- include/fwu.h | 13 + lib/efi_loader/efi_firmware.c | 11 +-- lib/fwu_updates/fwu.c | 32 3 files changed, 26 insertions(+), 30 deletions(-) diff

[PATCH v2 0/2] fix FMP versioning for FWU multi bank update

2023-12-21 Thread Masahisa Kojima
ate structure Masahisa Kojima (2): fwu: fix fwu_get_image_index interface efi_loader: support fmp versioning for multi bank update include/fwu.h | 13 +++--- lib/efi_loader/efi_firmware.c | 80 +++ lib/fwu_updates/fwu.c |

[PATCH 2/2] efi_loader: auto-generate removable media boot option first

2023-12-20 Thread Masahisa Kojima
This commit auto-generates the boot option for removable block io devices followed by fixed block io devices. This is what EDK II reference implementation does. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_bootmgr.c | 37 1 file changed, 29

[PATCH 1/2] efi_loader: auto-generate boot option for each blkio device

2023-12-20 Thread Masahisa Kojima
modifies the efibootmgr to get aligned to EDK II. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_bootmgr.c | 94 +++- 1 file changed, 71 insertions(+), 23 deletions(-) diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 56d97f2382

[PATCH 0/2] fix auto-generated boot options

2023-12-20 Thread Masahisa Kojima
This series aims to get aligned to the EDK II reference implementation for auto-generated boot options, and tries to address the following issue. https://source.denx.de/u-boot/custodians/u-boot-efi/-/issues/13 This series is based on the efi-next-20231217 tag. Masahisa Kojima (2): efi_loader

[PATCH v2] efi_loader: fix iteration of FMP protocols

2023-12-18 Thread Masahisa Kojima
protocols fails. Signed-off-by: Masahisa Kojima --- Note that this patch addresses the following issue. https://source.denx.de/u-boot/custodians/u-boot-efi/-/issues/3 changes in v2 - add error handling when num_entries is 0 after calling fmp->get_image_info() lib/efi_loader/efi_esrt.c |

Re: [PATCH] efi_loader: eliminate efi_disk_obj structure

2023-12-18 Thread Masahisa Kojima
Hi Heinrich, On Sun, 17 Dec 2023 at 19:26, Heinrich Schuchardt wrote: > > On 12/14/23 09:23, Masahisa Kojima wrote: > >>>> Depending on the number of handles and pointers this will take a > >>>> considerable time. A private field for the handle appended to st

Re: [PATCH] efi_loader: fix iteration of FMP protocols

2023-12-17 Thread Masahisa Kojima
On Fri, 15 Dec 2023 at 19:07, Ilias Apalodimas wrote: > > Hi Kojima-san > > On Fri, 8 Dec 2023 at 07:40, Masahisa Kojima > wrote: > > > > If one of the FMP protocols fails when calling GetImageInfo(), > > populating the ESRT ends up with failure and othe

Re: [PATCH] efi_loader: eliminate efi_disk_obj structure

2023-12-14 Thread Masahisa Kojima
Hi Heinrich, On Thu, 14 Dec 2023 at 16:31, Heinrich Schuchardt wrote: > > > > Am 14. Dezember 2023 02:55:27 MEZ schrieb Masahisa Kojima > : > >Hi Heinrich, > > > >On Wed, 13 Dec 2023 at 23:22, Heinrich Schuchardt wrote: > >> > >> On 13.12.2

Re: [PATCH] efi_loader: eliminate efi_disk_obj structure

2023-12-13 Thread Masahisa Kojima
Hi Heinrich, On Wed, 13 Dec 2023 at 23:22, Heinrich Schuchardt wrote: > > On 13.12.23 09:57, Masahisa Kojima wrote: > > Current code uses struct efi_disk_obj to keep information > > about block devices and partitions. As the efi handle already > > has a field wit

[PATCH] efi_loader: eliminate efi_disk_obj structure

2023-12-13 Thread Masahisa Kojima
of efi_disk_add_dev() function to simplify the cleanup process in case of error. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 209 +- 1 file changed, 116 insertions(+), 93 deletions(-) diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index

Re: [PATCH 2/2] efi_loader: support FMP versioning for FWU multi bank update

2023-12-10 Thread Masahisa Kojima
Hi Heinrich, On Sun, 10 Dec 2023 at 00:09, Heinrich Schuchardt wrote: > > On 11/14/23 10:25, Masahisa Kojima wrote: > > Current FMP versioning uses the FMPState UEFI variables > > Do you mean FmpState? > > > that indicates image_index. When C

Re: [PATCH 1/2] efi_loader: use original image_index for FMP versioning

2023-12-10 Thread Masahisa Kojima
Hi Heinrich, On Sat, 9 Dec 2023 at 23:51, Heinrich Schuchardt wrote: > > On 11/14/23 10:25, Masahisa Kojima wrote: > > FMP versioning uses the image_index argument of > > EFI_FIRMWARE_MANAGEMENT_PROTOCOL.SetImage() service. > > When CONFIG_FWU_MULTI_BANK_UPDATE

[PATCH] efi_loader: fix iteration of FMP protocols

2023-12-07 Thread Masahisa Kojima
protocols fails. Signed-off-by: Masahisa Kojima --- Note that this patch addresses the following issue. https://source.denx.de/u-boot/custodians/u-boot-efi/-/issues/3 lib/efi_loader/efi_esrt.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/efi_loader

Re: [PATCH 1/1] efi_loader: boot options should relate to the ESP

2023-12-04 Thread Masahisa Kojima
> _simple_file_system_protocol_guid, > + _system_partition_guid, In EDK II reference implementation[0], it enumerates all block_io_protocol devices and eliminates logical partitions. Should we do th

[PATCH] efi_loader: use event callback for initrd deregistration

2023-12-03 Thread Masahisa Kojima
Currently efi_initrd_deregister() is called in bootefi.c when the image started from bootefi command returns. Since efi_guid_event_group_return_to_efibootmgr event is implemented, so let's use this event for invoking initrd deregistration. Signed-off-by: Masahisa Kojima --- Note that this patch

Re: [PATCH 1/1] cmd: eficonfig: create shortened boot options

2023-11-16 Thread Masahisa Kojima
> 1 file changed, 1 insertion(+) Acked-by: Masahisa Kojima Thanks, Masahisa Kojima > > diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c > index e6e8a0a488..3d95092109 100644 > --- a/cmd/eficonfig.c > +++ b/cmd/eficonfig.c > @@ -528,6 +528,7 @@ struct efi_device_pa

Re: [PATCH v12 9/9] doc: uefi: add HTTP Boot support

2023-11-14 Thread Masahisa Kojima
Hi Fabio, On Tue, 14 Nov 2023 at 18:05, Fabio Estevam wrote: > > Hi Masahisa, > > On Fri, Nov 10, 2023 at 1:29 AM Masahisa Kojima > wrote: > > > +Set up the load option specifying the target URI:: > > + > > +efidebug boot add -u 1 netinst http://foo/

[PATCH 2/2] efi_loader: support FMP versioning for FWU multi bank update

2023-11-14 Thread Masahisa Kojima
-A_DEN0118_1.0ALP3.pdf, but 1-255 range is practically enough big. This commit adds the range for FWU_NUM_BANKS since above XX(bank_index) has 1 byte. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_firmware.c | 63 ++- lib/fwu_updates/Kconfig | 1 + 2 files changed

[PATCH 1/2] efi_loader: use original image_index for FMP versioning

2023-11-14 Thread Masahisa Kojima
-off-by: Masahisa Kojima --- lib/efi_loader/efi_firmware.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index 9abb29f1df..9c1a273926 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib/efi_loader/efi_firmware.c

[PATCH 0/2] fix FMP versioning for FWU multi bank update

2023-11-14 Thread Masahisa Kojima
The current FMP versioning does not work when CONFIG_FWU_MULTI_BANK_UPDATE is enabled. This series aims to support FMP versioning for FWU multi bank update. Masahisa Kojima (2): efi_loader: use original image_index for FMP versioning efi_loader: support FMP versioning for FWU multi bank

Re: [PATCH v12 9/9] doc: uefi: add HTTP Boot support

2023-11-09 Thread Masahisa Kojima
Hi Ilias, On Fri, 10 Nov 2023 at 15:58, Ilias Apalodimas wrote: > > On Fri, 10 Nov 2023 at 06:27, Masahisa Kojima > wrote: > > > > This adds the description about HTTP Boot. > > > > Signed-off-by: Masahisa Kojima > > Reviewed-by: Ilias Apalodimas >

Re: [PATCH v12 7/9] efi_loader: support boot from URI device path

2023-11-09 Thread Masahisa Kojima
On Fri, 10 Nov 2023 at 15:50, Ilias Apalodimas wrote: > > Hi Kojima-san > > Going through the patch one last time before I merge it I noticed some > memory leaks > > On Fri, 10 Nov 2023 at 06:27, Masahisa Kojima > wrote: > > > > This supports to boot fro

[PATCH v12 9/9] doc: uefi: add HTTP Boot support

2023-11-09 Thread Masahisa Kojima
This adds the description about HTTP Boot. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- doc/develop/uefi/uefi.rst | 30 ++ 1 file changed, 30 insertions(+) diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst index fb16ac743a

[PATCH v12 7/9] efi_loader: support boot from URI device path

2023-11-09 Thread Masahisa Kojima
be reserved to avoid the unintended access to the image and expose the ramdisk to the OS. For PE-COFF file case, this memory reservation is done in LoadImage Boot Service. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- lib/efi_loader/Kconfig | 9 + lib/efi_loader

[PATCH v12 8/9] cmd: efidebug: add uri device path

2023-11-09 Thread Masahisa Kojima
This adds the URI device path option for 'boot add' subcommand. User can add the URI load option for downloading ISO image file or EFI application through network. Currently HTTP is only supported. Signed-off-by: Masahisa Kojima --- cmd/efidebug.c | 78

[PATCH v12 6/9] efi_loader: add return to efibootmgr event group

2023-11-09 Thread Masahisa Kojima
When the image loaded by efibootmgr returns, efibootmgr needs to clean the resources. Adding the event of returning to efibootmgr is useful to simplify the implementation. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- cmd/bootefi.c | 12 include

[PATCH v12 5/9] efi_loader: add missing const classifier for event service

2023-11-09 Thread Masahisa Kojima
implementation calls the common efi_create_event() function from both CreateEventEx() and CreateEvent() services, NotifyContext parameter leaves as is. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- include/efi_api.h | 2 +- include/efi_loader.h | 2 +- lib

[PATCH v12 4/9] efi_loader: Boot var automatic management

2023-11-09 Thread Masahisa Kojima
with unexpected failure. The efi_secboot tests need to be modified to explicitly set the BootOrder EFI variable. squashfs and erofs ls tests are also affected by this modification, need to clear the previous state before squashfs ls test starts. Co-developed-by: Masahisa Kojima Signed-off

[PATCH v12 3/9] blk: blkmap: add ramdisk creation utility function

2023-11-09 Thread Masahisa Kojima
User needs to call several functions to create the ramdisk with blkmap. This adds the utility function to create blkmap device and mount the ramdisk. Signed-off-by: Masahisa Kojima Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- drivers/block/Makefile| 3 +- drivers/block

[PATCH v12 2/9] net: wget: add wget with dns utility function

2023-11-09 Thread Masahisa Kojima
Current wget takes the target uri in this format: ":" e.g.) 192.168.1.1:/bar The http server ip address must be resolved before calling wget. This commit adds the utility function runs wget with dhs. User can call wget with the uri like "http://foo/bar;. Signed-off-by:

[PATCH v12 1/9] net: wget: prevent overwriting reserved memory

2023-11-09 Thread Masahisa Kojima
This introduces the valid range check to store the received blocks using lmb. The same logic is implemented in tftp. Signed-off-by: Masahisa Kojima Acked-by: Ilias Apalodimas Reviewed-by: Simon Glass Reviewed-by: Ramon Fried --- net/wget.c | 80

[PATCH v12 0/9] Add EFI HTTP boot support

2023-11-09 Thread Masahisa Kojima
ode under drivers/block/blkmap_helper.c - wget supports the valid range check to store the received blocks using lmb - support when the downloaded image have no partiton table but a file system - not start the .efi file in try_load_entry() - call efi_check_pe() for .efi file to check the file is PE

Re: [PATCH v11 8/9] cmd: efidebug: add uri device path

2023-11-09 Thread Masahisa Kojima
Hi Simon, Ilias, On Thu, 9 Nov 2023 at 17:00, Ilias Apalodimas wrote: > > Hi Simon, > > On Thu, 9 Nov 2023 at 03:15, Simon Glass wrote: > > > > Hi Masahisa, > > > > On Wed, 8 Nov 2023 at 04:08, Masahisa Kojima > > wrote: > > > >

Re: [PATCH v11 7/9] efi_loader: support boot from URI device path

2023-11-09 Thread Masahisa Kojima
On Thu, 9 Nov 2023 at 17:04, Ilias Apalodimas wrote: > > Kojima-san > > On Wed, 8 Nov 2023 at 13:08, Masahisa Kojima > wrote: > > > > This supports to boot from the URI device path. > > When user selects the URI device path, bootmgr downloads > > the fil

Re: [PATCH 1/8] tools: mkeficapsule: Add support for parsing capsule params from config file

2023-11-09 Thread Masahisa Kojima
Hi Sughosh, On Fri, 20 Oct 2023 at 15:02, Masahisa Kojima wrote: > > Hi Sughosh, > > On Fri, 8 Sept 2023 at 21:00, Sughosh Ganu wrote: > > > > Add support for specifying the parameters needed for capsule > > generation through a config file, instead of passing

[PATCH v11 9/9] doc: uefi: add HTTP Boot support

2023-11-08 Thread Masahisa Kojima
This adds the description about HTTP Boot. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- doc/develop/uefi/uefi.rst | 30 ++ 1 file changed, 30 insertions(+) diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst index fb16ac743a

[PATCH v11 8/9] cmd: efidebug: add uri device path

2023-11-08 Thread Masahisa Kojima
This adds the URI device path option for 'boot add' subcommand. User can add the URI load option for downloading ISO image file or EFI application through network. Currently HTTP is only supported. Signed-off-by: Masahisa Kojima Acked-by: Ilias Apalodimas --- cmd/efidebug.c | 51

[PATCH v11 7/9] efi_loader: support boot from URI device path

2023-11-08 Thread Masahisa Kojima
be reserved to avoid the unintended access to the image and expose the ramdisk to the OS. For PE-COFF file case, this memory reservation is done in LoadImage Boot Service. Signed-off-by: Masahisa Kojima --- lib/efi_loader/Kconfig | 9 + lib/efi_loader/efi_bootmgr.c | 376

[PATCH v11 6/9] efi_loader: add return to efibootmgr event group

2023-11-08 Thread Masahisa Kojima
When the image loaded by efibootmgr returns, efibootmgr needs to clean the resources. Adding the event of returning to efibootmgr is useful to simplify the implementation. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- cmd/bootefi.c | 12 include

[PATCH v11 4/9] efi_loader: Boot var automatic management

2023-11-08 Thread Masahisa Kojima
with unexpected failure. The efi_secboot tests need to be modified to explicitly set the BootOrder EFI variable. squashfs and erofs ls tests are also affected by this modification, need to clear the previous state before squashfs ls test starts. Co-developed-by: Masahisa Kojima Signed-off

[PATCH v11 5/9] efi_loader: add missing const classifier for event service

2023-11-08 Thread Masahisa Kojima
implementation calls the common efi_create_event() function from both CreateEventEx() and CreateEvent() services, NotifyContext parameter leaves as is. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- include/efi_api.h | 2 +- include/efi_loader.h | 2 +- lib

[PATCH v11 3/9] blk: blkmap: add ramdisk creation utility function

2023-11-08 Thread Masahisa Kojima
User needs to call several functions to create the ramdisk with blkmap. This adds the utility function to create blkmap device and mount the ramdisk. Signed-off-by: Masahisa Kojima Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- drivers/block/Makefile| 3 +- drivers/block

[PATCH v11 2/9] net: wget: add wget with dns utility function

2023-11-08 Thread Masahisa Kojima
Current wget takes the target uri in this format: ":" e.g.) 192.168.1.1:/bar The http server ip address must be resolved before calling wget. This commit adds the utility function runs wget with dhs. User can call wget with the uri like "http://foo/bar;. Signed-off-by:

[PATCH v11 1/9] net: wget: prevent overwriting reserved memory

2023-11-08 Thread Masahisa Kojima
This introduces the valid range check to store the received blocks using lmb. The same logic is implemented in tftp. Signed-off-by: Masahisa Kojima Acked-by: Ilias Apalodimas Reviewed-by: Simon Glass Reviewed-by: Ramon Fried --- net/wget.c | 80

[PATCH v11 0/9] Add EFI HTTP boot support

2023-11-08 Thread Masahisa Kojima
v1 -> v2 - carve out the network handling(wget and dns code) under net/wget.c - carve out ramdisk creation code under drivers/block/blkmap_helper.c - wget supports the valid range check to store the received blocks using lmb - support when the downloaded image have no partiton table but a file syste

Re: [RESEND PATCH v10 7/9] efi_loader: support boot from URI device path

2023-11-08 Thread Masahisa Kojima
_media_path(device_path); > >ret = EFI_CALL(efi_load_image(true, efi_root, file_path, NULL, 0, > > image_handle)); > > efi_free_pool(file_path); > >

Re: [RESEND PATCH v10 7/9] efi_loader: support boot from URI device path

2023-11-07 Thread Masahisa Kojima
Hi Ilias, On Tue, 7 Nov 2023 at 18:37, Ilias Apalodimas wrote: > > Kojima-san > > On Mon, 6 Nov 2023 at 13:40, Masahisa Kojima > wrote: > [...] > > > +/** > > + * search_default_file() - search default file > > + * > > + * @dev: pointer

  1   2   3   4   5   6   7   8   9   10   >