[PATCH v3 4/5] doc: cmd: add documentation for scmi

2023-11-13 Thread AKASHI Takahiro
This is a help text for scmi command. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass Reviewed-by: Etienne Carriere --- v6 * add the manual to doc/usage/index.rst v4 * s/tranport/transport/ v2 * add more descriptions about SCMI --- doc/usage/cmd/scmi.rst | 126

[PATCH v3 5/5] test: dm: add scmi command test

2023-11-13 Thread AKASHI Takahiro
In this test, "scmi" command is tested against different sub-commands. Please note that scmi command is for debug purpose and is not intended in production system. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass Reviewed-by: Etienne Carriere --- v9 * return -EAGAIN if we want

[PATCH] xen: pvblock: fix the maximum io size in one operation

2023-11-14 Thread AKASHI Takahiro
PAGE_MASK; end = ((uintptr_t)aiocbp->aio_buf + aiocbp->aio_nbytes + PAGE_SIZE - 1) & PAGE_MASK; Then this will lead to BUG_ON() above. This can be fixed by decreasing the maximum size of aio_nbytes. Signed-off-by: AKASHI Takahiro Fixes: commit 3a739cc6c948 ("xen:

[PATCH v2 00/12] cmd: bootefi: refactor the code for bootmgr

2023-11-20 Thread AKASHI Takahiro
which was split from ex-patch#5 RFC (Oct 26, 2023) [1] https://lists.denx.de/pipermail/u-boot/2023-October/534598.html AKASHI Takahiro (12): cmd: bootefi: unfold do_bootefi_image() cmd: bootefi: re-organize do_bootefi() cmd: bootefi: carve out EFI boot manager interface cmd: boote

[PATCH v2 01/12] cmd: bootefi: unfold do_bootefi_image()

2023-11-20 Thread AKASHI Takahiro
Unfold do_bootefi_image() into do_bootefi() in order to make it easier to re-organize do_bootefi() in the next commit. Signed-off-by: AKASHI Takahiro --- cmd/bootefi.c | 101 ++ 1 file changed, 37 insertions(+), 64 deletions(-) diff --git a/cmd

[PATCH v2 02/12] cmd: bootefi: re-organize do_bootefi()

2023-11-20 Thread AKASHI Takahiro
Replicate some code and re-organize do_bootefi() into three cases, which will be carved out as independent functions in the next two commits. Signed-off-by: AKASHI Takahiro --- cmd/Kconfig | 15 ++-- cmd/bootefi.c| 82 ++-- include

[PATCH v2 03/12] cmd: bootefi: carve out EFI boot manager interface

2023-11-20 Thread AKASHI Takahiro
Carve EFI boot manager related code out of do_bootefi_image() in order to move boot manager specific code into library directory in the later commit. Signed-off-by: AKASHI Takahiro --- cmd/bootefi.c | 43 --- 1 file changed, 24 insertions(+), 19 deletions

[PATCH v2 05/12] cmd: bootefi: localize global device paths for efi_selftest

2023-11-20 Thread AKASHI Takahiro
Device paths allocated in bootefi_test_prepare() will be immediately consumed by do_efi_selftest() and there is no need to keep them for later use. Introduce test-specific varialbles to make it easier to move other bootmgr functions into library directory in the next commit. Signed-off-by: AKASHI

[PATCH v2 06/12] cmd: bootefi: move library interfaces under lib/efi_loader

2023-11-20 Thread AKASHI Takahiro
In the prior commits, interfaces for executing EFI binary and boot manager were carved out. Move them under efi_loader directory so that they can be called from other places without depending on bootefi command. Only efi_selftest-related code will be left in bootefi.c. Signed-off-by: AKASHI

[PATCH v2 07/12] cmd: efidebug: ease efi configuration dependency

2023-11-20 Thread AKASHI Takahiro
Now it is clear that the command actually depends on interfaces, not "bootefi bootmgr" command. Signed-off-by: AKASHI Takahiro --- cmd/efidebug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 78ef16f4cb5c..e10fbf891a42 10

[PATCH v2 04/12] cmd: bootefi: carve out binary execution interface

2023-11-20 Thread AKASHI Takahiro
Carve binary execution code out of do_bootefi_image() in order to move binary-execution specific code into library directory in the later commit. Signed-off-by: AKASHI Takahiro --- cmd/bootefi.c | 46 -- 1 file changed, 32 insertions(+), 14 deletions

[PATCH v2 08/12] bootmeth: use efi_loader interfaces instead of bootefi command

2023-11-20 Thread AKASHI Takahiro
Now that efi_loader subsystem provides interfaces that are equivalent with bootefi command, we can replace command invocations with APIs. Signed-off-by: AKASHI Takahiro --- boot/Kconfig| 4 ++-- boot/Makefile | 2 +- boot/bootm_os.c | 31

[PATCH v2 12/12] fs: remove explicit efi configuration dependency

2023-11-20 Thread AKASHI Takahiro
Now it is clear that the feature actually depends on efi interfaces, not "bootefi" command. efi_set_bootdev() will automatically be nullified if necessary efi component is disabled. Signed-off-by: AKASHI Takahiro --- fs/fs.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletion

[PATCH v2 10/12] efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGR

2023-11-20 Thread AKASHI Takahiro
At this point, EFI boot manager interfaces is fully independent from bootefi command. So just rename the configuration parameter. Signed-off-by: AKASHI Takahiro --- boot/Makefile | 2 +- cmd/Kconfig | 4 ++-- cmd/efidebug.c | 4 ++-- lib/efi_loader/Kconfig | 2

[PATCH v2 11/12] net: tftp: remove explicit efi configuration dependency

2023-11-20 Thread AKASHI Takahiro
Now it is clear that the feature actually depends on efi interfaces, not "bootefi" command. efi_set_bootdev() will automatically be nullified if necessary efi component is disabled. Signed-off-by: AKASHI Takahiro --- net/tftp.c | 10 -- 1 file changed, 4 insertions(+), 6

[PATCH v2 09/12] efi_loader: split unrelated code from efi_bootmgr.c

2023-11-20 Thread AKASHI Takahiro
ow how EFI boot manager is implemented. So introduce a new configuration, CONFIG_EFI_BINARY_EXEC, to enforce theem opted out explicitly. Signed-off-by: AKASHI Takahiro --- boot/Kconfig | 4 +- cmd/Kconfig | 6 +- include/efi_loader.h | 28 +-

Re: [PATCH v2 02/12] cmd: bootefi: re-organize do_bootefi()

2023-11-20 Thread AKASHI Takahiro
Hi Heinrich, On Tue, Nov 21, 2023 at 04:31:40AM +0100, Heinrich Schuchardt wrote: > On 11/21/23 02:29, AKASHI Takahiro wrote: > > Replicate some code and re-organize do_bootefi() into three cases, which > > will be carved out as independent functions in the next two commits. >

Re: [PATCH v2 03/12] cmd: bootefi: carve out EFI boot manager interface

2023-11-20 Thread AKASHI Takahiro
On Tue, Nov 21, 2023 at 04:38:12AM +0100, Heinrich Schuchardt wrote: > On 11/21/23 02:29, AKASHI Takahiro wrote: > > Carve EFI boot manager related code out of do_bootefi_image() in order > > to move boot manager specific code into library directory in the later > > commit. &

Re: [PATCH v1 1/3] efi: filestore: don't compile when config disabled

2023-11-21 Thread AKASHI Takahiro
On Tue, Nov 21, 2023 at 11:57:11PM +, Shantur Rathore wrote: > Compile out filestore functions when config isn't enabled. > > Signed-off-by: Shantur Rathore > --- > > include/efi_variable.h| 21 - > lib/efi_loader/efi_var_file.c | 13 +++-- > lib/efi_load

Re: [PATCH v1 2/3] efi_vars: Implement SPI Flash store

2023-11-21 Thread AKASHI Takahiro
On Tue, Nov 21, 2023 at 11:57:12PM +, Shantur Rathore wrote: > Currently U-boot uses ESP as storage for EFI variables. > Devices with SPI Flash are used for storing environment with this > commit we allow EFI variables to be stored on SPI Flash. > > Signed-off-by: Shantur Rathore > --- > >

Re: [PATCH v2 00/12] cmd: bootefi: refactor the code for bootmgr

2023-12-03 Thread AKASHI Takahiro
Hi Heinrich, Ilias On Tue, Nov 21, 2023 at 10:29:38AM +0900, AKASHI Takahiro wrote: > This patch set is motivated by the discussion[1] regarding > CONFIG_BOOTEFI_BOOTMGR option. > > At the end, bootefi.c will be decomposed into two parts, one for > providing the command its

Re: [PATCH] doc: Add basic information about running CI tests

2020-12-20 Thread AKASHI Takahiro
Tom, Thank you for adding this valuable doc about CI. I have a couple of comments from my real experience :) On Fri, Dec 18, 2020 at 05:14:56PM -0500, Tom Rini wrote: > Start out by documenting general expectations on when CI is run, how > anyone can run Azure pipelines, and how GitLab CI pipelin

Re: [PATCH] doc: Add basic information about running CI tests

2020-12-20 Thread AKASHI Takahiro
On Fri, Dec 18, 2020 at 07:44:42PM -0500, Tom Rini wrote: > On Fri, Dec 18, 2020 at 06:34:10PM -0500, Sean Anderson wrote: > > On 12/18/20 5:14 PM, Tom Rini wrote: > > > Start out by documenting general expectations on when CI is run, how > > > anyone can run Azure pipelines, and how GitLab CI pipe

Re: [PATCH 6/8 v2] efi_loader: Replace config option with EFI variable for initrd loading

2021-01-04 Thread AKASHI Takahiro
On Wed, Dec 30, 2020 at 05:07:18PM +0200, Ilias Apalodimas wrote: > 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 f

Re: [RFC PATCH 2/3] efi_loader: efi_loader: Replace config option for initrd loading

2021-01-13 Thread AKASHI Takahiro
Ilias, On Wed, Jan 13, 2021 at 01:11:48PM +0200, Ilias Apalodimas wrote: > 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

Re: [RFC PATCH 1/3] efi_loader: Introduce helper functions for EFI

2021-01-13 Thread AKASHI Takahiro
On Wed, Jan 13, 2021 at 01:11:47PM +0200, Ilias Apalodimas wrote: > 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), In this respect, > let's add some

Re: [RFC PATCH 3/3] efidebug: add multiple device path instances on Boot####

2021-01-13 Thread AKASHI Takahiro
Ilias, On Wed, Jan 13, 2021 at 01:11:49PM +0200, Ilias Apalodimas wrote: > The UEFI spec allow a packed array of UEFI device paths in the > FilePathList[] of an EFI_LOAD_OPTION. The first file path must > describe the laoded image but the rest are OS specific. > Previous patches parse the device p

Re: [PATCH 1/3] efi_loader: print boot device and file path in helloworld

2021-01-14 Thread AKASHI Takahiro
Heinrich, On Tue, Jan 12, 2021 at 08:58:40PM +0100, Heinrich Schuchardt wrote: > Let helloworld.efi print the device path of the boot device and the file > path as provided by the loaded image protocol. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/helloworld.c | 167 +++

Re: [RFC PATCH 3/3] efidebug: add multiple device path instances on Boot####

2021-01-14 Thread AKASHI Takahiro
On Thu, Jan 14, 2021 at 02:36:23PM +0200, Ilias Apalodimas wrote: > On Thu, Jan 14, 2021 at 01:07:42PM +0100, Heinrich Schuchardt wrote: > > On 14.01.21 10:55, Ilias Apalodimas wrote: > > > On Thu, Jan 14, 2021 at 02:11:33PM +0900, AKASHI Takahiro wrote: > > >> Ilias

Re: [PATCH 1/3] efi_loader: print boot device and file path in helloworld

2021-01-14 Thread AKASHI Takahiro
On Fri, Jan 15, 2021 at 04:12:18AM +0100, Heinrich Schuchardt wrote: > Am 15. Januar 2021 02:56:03 MEZ schrieb AKASHI Takahiro > : > >Heinrich, > > > >On Tue, Jan 12, 2021 at 08:58:40PM +0100, Heinrich Schuchardt wrote: > >> Let helloworld.efi print the devic

Re: [PATCH 1/3] efi_loader: print boot device and file path in helloworld

2021-01-17 Thread AKASHI Takahiro
On Fri, Jan 15, 2021 at 01:02:51PM +0100, Heinrich Schuchardt wrote: > On 15.01.21 05:29, AKASHI Takahiro wrote: > > On Fri, Jan 15, 2021 at 04:12:18AM +0100, Heinrich Schuchardt wrote: > >> Am 15. Januar 2021 02:56:03 MEZ schrieb AKASHI Takahiro > >> : > >>&g

Re: [PATCH 1/1] efi_loader: provide initrddump test tool

2021-01-17 Thread AKASHI Takahiro
Heinrich, On Sun, Jan 17, 2021 at 07:48:18AM +0100, Heinrich Schuchardt wrote: > Provide an UEFI application to save the initial RAM disk provided by U-Boot > via the Load File2 protocol. I don't have any specific comments on this "app," but as the size of efi selftest grows and even more app's a

Re: [PATCH 1/2] efi_loader: move load options to new module

2021-01-17 Thread AKASHI Takahiro
On Fri, Jan 15, 2021 at 07:02:49PM +0100, Heinrich Schuchardt wrote: > Move all load options related functions to a new module. So that they can > be compiled independently. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/efi_load_options.c | 151 ++ > 1

Re: [PATCH 0/2] efi_loader: make the UEFI boot manager configurable

2021-01-17 Thread AKASHI Takahiro
Heinrich, On Fri, Jan 15, 2021 at 07:02:48PM +0100, Heinrich Schuchardt wrote: > Some boards are very tight on the binary size. Booting via UEFI is possible > without using the boot manager. > > Provide a configuration option to make the boot manager available. > > Heinrich Schuchardt (2): > e

Re: [scan-ad...@coverity.com: New Defects reported by Coverity Scan for Das U-Boot]

2021-01-20 Thread AKASHI Takahiro
Tom, Regarding EFI capsule update, On Wed, Jan 20, 2021 at 09:43:57PM +0100, Heinrich Schuchardt wrote: > On 1/20/21 8:04 PM, Tom Rini wrote: > > CC: Takahiro > > > I decided to run Coverity part-way through the merge window this time > > and here's what's been found so far. > > > > - Forw

[PATCH] virtio_blk: set log2blksz correctly

2020-08-19 Thread AKASHI Takahiro
27;s ext4_probe() will calls fs_devread() to fetch a super block. If log2blksz is 0, the actual 'read' size, i.e. block_len >> log2blksz, is much bigger than a buffer's size, and it can end up with memory corruption. Signed-off-by: AKASHI Takahiro Fixes: f4802209e59d ("virtio

Re: [PATCH v5 00/17] efi_loader: add capsule update support

2020-08-24 Thread AKASHI Takahiro
ahiro Akashi On Mon, Aug 03, 2020 at 02:43:38PM +0900, AKASHI Takahiro wrote: > Summary > === > 'UpdateCapsule' is one of runtime services defined in UEFI specification > and its aim is to allow a caller (OS) to pass information to the firmware, > i.e. U-Boot. This is mostly

Re: [PATCH 1/1] efi_loader: check for image truncation

2020-08-27 Thread AKASHI Takahiro
On Thu, Aug 27, 2020 at 06:24:35PM +0200, Heinrich Schuchardt wrote: > Check in efi_load_pe() that the image size parameter is at least as large > as the image size indicated in the optional PE header. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/efi_image_loader.c | 28

Re: [PATCH v5 00/17] efi_loader: add capsule update support

2020-08-30 Thread AKASHI Takahiro
Lukasz, On Tue, Aug 25, 2020 at 02:42:01PM +0900, AKASHI Takahiro wrote: > Lukasz, > > Could you take the time to review my patches, especially > patch#1 to #4 and #12, please? A gentle ping. My patch series are stranded, waiting for your review. The discussion[1] about UPDATE_T

Re: [PATCH v5 15/17] tools: add mkeficapsule command for UEFI capsule update

2020-08-30 Thread AKASHI Takahiro
On Fri, Aug 28, 2020 at 05:58:00AM +0200, Heinrich Schuchardt wrote: > On 8/3/20 7:43 AM, AKASHI Takahiro wrote: > > This is a utility mainly for test purpose. > > mkeficapsule -f: create a test capsule file for FIT image firmware > > > > Having said that, you will be

Re: [PATCH v5 17/17] test/py: add a test for uefi firmware update capsule of raw image

2020-08-30 Thread AKASHI Takahiro
On Fri, Aug 28, 2020 at 06:07:10AM +0200, Heinrich Schuchardt wrote: > On 8/3/20 7:43 AM, AKASHI Takahiro wrote: > > The test can run on sandbox build and it attempts to execute a firmware > > update via a capsule-on-disk, using a raw image capsule, > > CONFIG_EFI_CAPSULE_RAW

Re: [PATCH v5 16/17] test/py: add a test for uefi firmware update capsule of FIT image

2020-08-31 Thread AKASHI Takahiro
Heinrich, On Mon, Aug 31, 2020 at 01:44:44PM +0200, Heinrich Schuchardt wrote: > On 03.08.20 07:43, AKASHI Takahiro wrote: > > The test can run on sandbox build and it attempts to execute a firmware > > update via a capsule-on-disk, using a FIT image capsule, > > C

[PATCH v6 00/17] efi_loader: add capsule update support

2020-09-06 Thread AKASHI Takahiro
ion (patch#4) * use printf, rather than EFI_PRINT, in error cases (patch#4) * use 'header_size' field to retrieve capsule data, adding sanity checks against capsule size (patch#6) * call fmpt driver interfaces with EFI_CALL (patch#6) * remove 'variable update capsule'-relate

[PATCH v6 01/17] dfu: rename dfu_tftp_write() to dfu_write_by_name()

2020-09-06 Thread AKASHI Takahiro
, particularly one added in a later commit. Signed-off-by: AKASHI Takahiro --- common/update.c | 5 +++-- drivers/dfu/Kconfig | 5 + drivers/dfu/Makefile | 2 +- drivers/dfu/{dfu_tftp.c => dfu_alt.c} | 17 -- incl

[PATCH v6 03/17] common: update: add a generic interface for FIT image

2020-09-06 Thread AKASHI Takahiro
The main purpose of this patch is to separate a generic interface for updating firmware using DFU drivers from "auto-update" via tftp. This function will also be used in implementing UEFI capsule update in a later commit. Signed-off-by: AKASHI Takahiro --- common/Kconfig

[PATCH v6 02/17] dfu: modify an argument type for an address

2020-09-06 Thread AKASHI Takahiro
The range of an addressable pointer can go beyond 'integer'. So change the argument type to a void pointer. Signed-off-by: AKASHI Takahiro Reviewed-by: Heinrich Schuchardt --- common/update.c | 3 ++- drivers/dfu/dfu_alt.c | 6 +++--- include/dfu.h | 4 ++-- 3 files

[PATCH v6 09/17] efi_loader: capsule: add memory range capsule definitions

2020-09-06 Thread AKASHI Takahiro
: AKASHI Takahiro --- include/efi_api.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/efi_api.h b/include/efi_api.h index c128a0a66ce8..7a2a087c60ed 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -221,6 +221,10 @@ enum efi_reset_type { EFI_GUID

[PATCH v6 05/17] efi_loader: add option to initialise EFI subsystem early

2020-09-06 Thread AKASHI Takahiro
this feature will be utilised in implementing capsule-on-disk feature. Signed-off-by: AKASHI Takahiro --- common/board_r.c | 6 ++ lib/efi_loader/Kconfig | 4 2 files changed, 10 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index 9b2fec701a55..0391a1b6acb7 100644

[PATCH v6 07/17] efi_loader: define UpdateCapsule api

2020-09-06 Thread AKASHI Takahiro
In this commit, skeleton functions for capsule-related API's are added under CONFIG_EFI_UPDATE_CAPSULE configuration. Detailed implementation for a specific capsule type will be added in the succeeding patches. Signed-off-by: AKASHI Takahiro --- include/efi_api.h| 12 +++ in

[PATCH v6 04/17] dfu: export dfu_list

2020-09-06 Thread AKASHI Takahiro
This variable will be utilized to enumerate all dfu entities for UEFI capsule firmware update in a later commit. Signed-off-by: AKASHI Takahiro --- drivers/dfu/dfu.c | 2 +- include/dfu.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dfu/dfu.c b/drivers/dfu

[PATCH v6 10/17] efi_loader: capsule: support firmware update

2020-09-06 Thread AKASHI Takahiro
set_image() interface against each binary in a capsule. In this commit, however, loading drivers is not supported. The result of applying a capsule is set to be stored in "Capsule" variable, but its implementation is deferred to a fmp driver. Signed-off-by: AKASHI Takahiro --- include

[PATCH v6 06/17] efi_loader: add efi_create_indexed_name()

2020-09-06 Thread AKASHI Takahiro
This function will be used from several places in UEFI subsystem to generate some specific form of utf-16 variable name. For example, L"Capsule0001" Signed-off-by: AKASHI Takahiro --- include/efi_loader.h | 3 +++ lib/efi_loader/efi_setup.c | 30 +

[PATCH v6 12/17] dfu: add dfu_write_by_alt()

2020-09-06 Thread AKASHI Takahiro
This function is a variant of dfu_write_by_name() and takes a DFU alt setting number for dfu configuration. It will be utilised to implement UEFI capsule management protocol for raw image in a later commit. Signed-off-by: AKASHI Takahiro --- drivers/dfu/dfu_alt.c | 47

[PATCH v6 08/17] efi_loader: capsule: add capsule_on_disk support

2020-09-06 Thread AKASHI Takahiro
mechanism. Please note that U-Boot itself has no notion of "boot device" and all the capsule files to be executed will be detected only if they are located in a specific directory, \EFI\UpdateCapsule, on a device that is identified as a boot device by "Boot" variables.

[PATCH v6 13/17] efi_loader: add firmware management protocol for raw image

2020-09-06 Thread AKASHI Takahiro
d location to be updated. Please read README.dfu. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 4 + include/efi_loader.h | 1 + lib/efi_loader/Kconfig| 16 +++ lib/efi_loader/Makefile | 2 +- lib/efi_loader/efi_capsule.c | 8 ++ lib/

[PATCH v6 11/17] efi_loader: add firmware management protocol for FIT image

2020-09-06 Thread AKASHI Takahiro
device and location to be updated. Please read README.dfu. Fit image is a common file format for firmware update on U-Boot, and this protocol works neatly just as a wrapper for one. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 4 + include/efi_loader.h |

[PATCH v6 14/17] cmd: add "efidebug capsule" command

2020-09-06 Thread AKASHI Takahiro
"efidebug capsule" is more or less a debugging utility. efidebug capsule update: invoke UpdateCapsule against data on memory efidebug capsule show: show a capsule header efidebug capsule result: dump a capsule result variable Signed-off-by: AKASHI Takahiro --- cmd/efideb

[PATCH v6 15/17] tools: add mkeficapsule command for UEFI capsule update

2020-09-06 Thread AKASHI Takahiro
This is a utility mainly for test purpose. mkeficapsule -f: create a test capsule file for FIT image firmware Having said that, you will be able to customize the code to fit your specific requirements for your platform. Signed-off-by: AKASHI Takahiro --- tools/Makefile | 2 + tools

[PATCH v6 17/17] test/py: efi_capsule: test for raw image capsule

2020-09-06 Thread AKASHI Takahiro
un on Travis CI, at least, for now. Signed-off-by: AKASHI Takahiro --- test/py/tests/test_efi_capsule/conftest.py| 3 + .../test_efi_capsule/test_capsule_firmware.py | 63 +++ 2 files changed, 66 insertions(+) diff --git a/test/py/tests/test_efi_capsule/conftest.py b/te

[PATCH v6 16/17] test/py: efi_capsule: test for FIT image capsule

2020-09-06 Thread AKASHI Takahiro
un on Travis CI, at least, for now. Signed-off-by: AKASHI Takahiro --- test/py/tests/test_efi_capsule/conftest.py| 69 +++ test/py/tests/test_efi_capsule/defs.py| 12 ++ .../test_efi_capsule/test_capsule_firmware.py | 178 ++ .../tests/test_efi_ca

Re: [BUG] rsa: crash in br_i32_decode() called from rsa_gen_key_prop()

2020-09-07 Thread AKASHI Takahiro
On Mon, Sep 07, 2020 at 05:58:14PM +0200, Heinrich Schuchardt wrote: > Hello Takahiro, > > on the 32bit Wandboard (with i.mx6 CPU) running the lib_asn1_pkcs7 unit > test results in a crash due to an unaligned access occurring when > br_i32_decode() is called by rsa_gen_key_prop(). Some guy has se

Re: [PATCH 1/1] lib: rsa: fix data abort in br_i32_decode()

2020-09-09 Thread AKASHI Takahiro
On Tue, Sep 08, 2020 at 05:56:06PM -0600, Simon Glass wrote: > HI Heinrich, > > On Tue, 8 Sep 2020 at 04:29, Heinrich Schuchardt wrote: > > > > After removing leading zeros the RSA modulus may be unaligned. On > > architectures like ARM 32bit unaligned access may lead to a data abort, > > e.g. wh

Re: [PATCH v6 01/17] dfu: rename dfu_tftp_write() to dfu_write_by_name()

2020-09-09 Thread AKASHI Takahiro
On Wed, Sep 09, 2020 at 02:30:53PM +0200, Heinrich Schuchardt wrote: > On 07.09.20 07:34, AKASHI Takahiro wrote: > > This function is essentially independent from tftp, and will also be > > utilised in implementing UEFI capsule update in a later commit. > > So just give i

Re: [PATCH v6 00/17] efi_loader: add capsule update support

2020-09-09 Thread AKASHI Takahiro
On Wed, Sep 09, 2020 at 04:48:30PM +0200, Heinrich Schuchardt wrote: > On 07.09.20 07:34, AKASHI Takahiro wrote: > > Summary > > === > > 'UpdateCapsule' is one of runtime services defined in UEFI specification > > and its aim is to allow a caller (OS

Re: [PATCH v6 00/17] efi_loader: add capsule update support

2020-09-09 Thread AKASHI Takahiro
On Wed, Sep 09, 2020 at 12:56:28PM -0400, Tom Rini wrote: > On Wed, Sep 09, 2020 at 04:48:30PM +0200, Heinrich Schuchardt wrote: > > On 07.09.20 07:34, AKASHI Takahiro wrote: > [snip] > > > required and partly because there is a problem with virt-make-fs. > > > &g

Re: [PATCH v6 01/17] dfu: rename dfu_tftp_write() to dfu_write_by_name()

2020-09-10 Thread AKASHI Takahiro
On Wed, Sep 09, 2020 at 10:26:34PM -0400, Tom Rini wrote: > On Thu, Sep 10, 2020 at 10:54:18AM +0900, AKASHI Takahiro wrote: > > On Wed, Sep 09, 2020 at 02:30:53PM +0200, Heinrich Schuchardt wrote: > > > On 07.09.20 07:34, AKASHI Takahiro wrote: > > > > This funct

Re: [PATCH v6 00/17] efi_loader: add capsule update support

2020-09-10 Thread AKASHI Takahiro
On Wed, Sep 09, 2020 at 10:58:53PM -0400, Tom Rini wrote: > On Thu, Sep 10, 2020 at 11:52:37AM +0900, AKASHI Takahiro wrote: > > On Wed, Sep 09, 2020 at 12:56:28PM -0400, Tom Rini wrote: > > > On Wed, Sep 09, 2020 at 04:48:30PM +0200, Heinrich Schuchardt wrote: > > >

Re: [PATCH v6 00/17] efi_loader: add capsule update support

2020-09-10 Thread AKASHI Takahiro
Tom, On Thu, Sep 10, 2020 at 09:02:59PM -0400, Tom Rini wrote: > On Fri, Sep 11, 2020 at 09:52:10AM +0900, AKASHI Takahiro wrote: > > On Wed, Sep 09, 2020 at 10:58:53PM -0400, Tom Rini wrote: > > > On Thu, Sep 10, 2020 at 11:52:37AM +0900, AKASHI Takahiro wrote: > > > &

Re: [PATCH 2/6] efi_loader: Add device path related functions for initrd via Boot####

2021-03-11 Thread AKASHI Takahiro
Ilias, I may have missed your past discussions, but any way, On Thu, Mar 11, 2021 at 01:36:04PM +0200, Ilias Apalodimas wrote: > Hi Heinrich > > [...] > > > >>> + * @load_option: device paths to search > > >>> + * @size: size of the discovered device path > > >>> + * @guid: guid to

Re: [PATCH 2/6] efi_loader: Add device path related functions for initrd via Boot####

2021-03-11 Thread AKASHI Takahiro
On Fri, Mar 12, 2021 at 06:10:29AM +0200, Ilias Apalodimas wrote: > Akashi-san, > > On Fri, Mar 12, 2021 at 11:50:32AM +0900, AKASHI Takahiro wrote: > > Ilias, > > > > I may have missed your past discussions, but any way, > > It's on the boot-architectur

Re: [PATCH 5/6] efidebug: add multiple device path instances on Boot####

2021-03-11 Thread AKASHI Takahiro
Ilias, Sorry, but I will have to repeat my question for better understandings. On Sat, Mar 06, 2021 at 12:23:01AM +0200, Ilias Apalodimas wrote: > The UEFI spec allow a packed array of UEFI device paths in the > FilePathList[] of an EFI_LOAD_OPTION. The first file path must > describe the loaded

Re: [PATCH 2/6] efi_loader: Add device path related functions for initrd via Boot####

2021-03-11 Thread AKASHI Takahiro
On Fri, Mar 12, 2021 at 06:42:14AM +0200, Ilias Apalodimas wrote: > On Fri, Mar 12, 2021 at 01:32:50PM +0900, AKASHI Takahiro wrote: > [...] > > > > > > My understanding is that we have: > > > > > > > > > > > > kernel

Re: [PATCH 5/6] efidebug: add multiple device path instances on Boot####

2021-03-11 Thread AKASHI Takahiro
On Fri, Mar 12, 2021 at 06:55:57AM +0200, Ilias Apalodimas wrote: > Akashi-san > > > > > [...] > > > +/** > > > + * add_initrd_instance() - Append a device path to load_options pointing > > > to an > > > + * inirtd > > > + if (!initrd_dp) { > > > + printf("Canno

Re: [PATCH 5/6] efidebug: add multiple device path instances on Boot####

2021-03-11 Thread AKASHI Takahiro
On Fri, Mar 12, 2021 at 07:37:55AM +0200, Ilias Apalodimas wrote: > Akashi-san, > > On Fri, Mar 12, 2021 at 02:23:13PM +0900, AKASHI Takahiro wrote: > > On Fri, Mar 12, 2021 at 06:55:57AM +0200, Ilias Apalodimas wrote: &

Re: [PATCH 1/1] test: stabilize test_efi_secboot

2020-05-06 Thread AKASHI Takahiro
Heinrich, On Mon, May 04, 2020 at 12:33:26PM +0200, Heinrich Schuchardt wrote: > When setting up the console via function efi_console_register() we call > query_console_serial(). This functions sends an escape sequence to the > terminal to query the display size. The response is another escape > s

Re: [PATCH 08/10] cmd: add "efidebug capsule" command

2020-05-06 Thread AKASHI Takahiro
On Thu, Apr 30, 2020 at 06:08:11PM +0530, Sughosh Ganu wrote: > On Mon, 27 Apr 2020 at 15:19, AKASHI Takahiro > wrote: > > > "efidebug capsule" is more or less a debugging utility. > > efidebug capsule update: invoke UpdateCapsule against data on memory >

Re: [PATCH 8/8] qemu: arm64: Add documentation for capsule update

2020-05-06 Thread Akashi Takahiro
On Fri, May 01, 2020 at 11:17:27AM +0530, Sughosh Ganu wrote: > On Fri, 1 May 2020 at 00:57, Tom Rini wrote: > > > On Fri, May 01, 2020 at 12:38:45AM +0530, Sughosh Ganu wrote: > > > On Fri, 1 May 2020 at 00:07, Heinrich Schuchardt > > wrote: > > > > > > > On 4/30/20 7:36 PM, Sughosh Ganu wrote:

Re: [PATCH 3/8] qemu: arm64: Add support for efi firmware management protocol routines

2020-05-06 Thread Akashi Takahiro
On Fri, May 01, 2020 at 11:33:42AM +0200, Heinrich Schuchardt wrote: > On 4/30/20 9:13 PM, Sughosh Ganu wrote: > > > > On Fri, 1 May 2020 at 00:09, Heinrich Schuchardt > > wrote: > > > > On 4/30/20 7:36 PM, Sughosh Ganu wrote: > > > Add support for the get_image_

Re: [PATCH 04/10] efi_loader: capsule: add capsule_on_disk support

2020-05-06 Thread AKASHI Takahiro
On Thu, Apr 30, 2020 at 09:51:51PM +0200, Heinrich Schuchardt wrote: > On 4/30/20 2:52 PM, Sughosh Ganu wrote: > > > > On Tue, 28 Apr 2020 at 05:58, AKASHI Takahiro > > mailto:takahiro.aka...@linaro.org>> wrote: > > > > Heinrich, > > > >

Re: [PATCH 1/1] efi_loader: fix 'efidebug bootorder'

2020-05-06 Thread AKASHI Takahiro
On Wed, Apr 29, 2020 at 09:23:01PM +0200, Heinrich Schuchardt wrote: > * don't copy GUIDs for no reason > * shorten print format strings by using variable names > * don't use the run-time table to access exported functions I don't much care about those changes, but my initial intent was that any e

Re: efi_loader: efi_variable_parse_signature() returns NULL on error

2020-05-07 Thread AKASHI Takahiro
On Thu, May 07, 2020 at 02:13:18AM +0200, Patrick Wildt wrote: > efi_variable_parse_signature() returns NULL on error, so IS_NULL() > is an incorrect check. The goto err leads to pkcs7_free_message(), > which works fine on a NULL ptr. > > Signed-off-by: Patrick Wildt Revi

Re: efi_loader: efi_variable_parse_signature() returns NULL on error

2020-05-07 Thread AKASHI Takahiro
On Thu, May 07, 2020 at 02:13:18AM +0200, Patrick Wildt wrote: > efi_variable_parse_signature() returns NULL on error, so IS_NULL() > is an incorrect check. The goto err leads to pkcs7_free_message(), > which works fine on a NULL ptr. > > Signed-off-by: Patrick Wildt Revi

Re: [PATCH 5/8] efi_loader: Make the pkcs7 header parsing function an extern

2020-05-07 Thread Akashi Takahiro
On Thu, Apr 30, 2020 at 11:06:27PM +0530, Sughosh Ganu wrote: > The pkcs7 header parsing functionality is pretty generic, and can be > used by other features like capsule authentication. Make the function > as an extern, also changing it's name to efi_parse_pkcs7_header. The patch itself is fine t

Re: [PATCH 6/8] efi: capsule: Add support for uefi capsule authentication

2020-05-07 Thread Akashi Takahiro
Sughosh, On Thu, Apr 30, 2020 at 11:06:28PM +0530, Sughosh Ganu wrote: > Add support for authenticating uefi capsules. Most of the signature > verification functionality is shared with the uefi secure boot > feature. > > The root certificate containing the public key used for the signature > veri

Re: [PATCH 1/1] test: stabilize test_efi_secboot

2020-05-07 Thread AKASHI Takahiro
On Thu, May 07, 2020 at 11:14:17PM +0200, Heinrich Schuchardt wrote: > On 5/7/20 2:36 AM, AKASHI Takahiro wrote: > > Heinrich, > > > > On Mon, May 04, 2020 at 12:33:26PM +0200, Heinrich Schuchardt wrote: > >> When setting up the console via function

Re: [PATCH 3/8] qemu: arm64: Add support for efi firmware management protocol routines

2020-05-07 Thread Akashi Takahiro
On Thu, May 07, 2020 at 10:47:47PM +0200, Heinrich Schuchardt wrote: > On 5/7/20 4:33 AM, Akashi Takahiro wrote: > > On Fri, May 01, 2020 at 11:33:42AM +0200, Heinrich Schuchardt wrote: > >> On 4/30/20 9:13 PM, Sughosh Ganu wrote: > >>> > >>> On Fri

Re: efi_loader: pkcs7_parse_message() returns error pointer

2020-05-07 Thread AKASHI Takahiro
Heinrich, On Thu, May 07, 2020 at 04:47:22PM +0200, Heinrich Schuchardt wrote: > On 07.05.20 02:17, Patrick Wildt wrote: > > Since pkcs7_parse_message() returns an error pointer, we must not > > check for NULL. We have to explicitly set msg to NULL in the error > > case, otherwise the call to pkc

Re: [PATCH 6/8] efi: capsule: Add support for uefi capsule authentication

2020-05-07 Thread Akashi Takahiro
On Thu, May 07, 2020 at 05:20:35PM +0530, Sughosh Ganu wrote: > On Thu, 7 May 2020 at 13:49, Akashi Takahiro > wrote: > > > Sughosh, > > > > On Thu, Apr 30, 2020 at 11:06:28PM +0530, Sughosh Ganu wrote: > > > Add support for authenticating uefi capsules. Most

Re: [PATCH 5/8] efi_loader: Make the pkcs7 header parsing function an extern

2020-05-07 Thread Akashi Takahiro
On Thu, May 07, 2020 at 04:48:30PM +0530, Sughosh Ganu wrote: > On Thu, 7 May 2020 at 13:04, Akashi Takahiro > wrote: > > > On Thu, Apr 30, 2020 at 11:06:27PM +0530, Sughosh Ganu wrote: > > > The pkcs7 header parsing functionality is pretty generic, and can be > >

[PATCH] cmd: efidebug: fix a wrong handling of arguments

2020-05-07 Thread AKASHI Takahiro
Coverity detected a dead code, but actually there is a bug in a check against a number of arguments. So simply fix it. Signed-off-by: AKASHI Takahiro Reported-by: Coverity (CID 300330) --- cmd/efidebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/efidebug.c b/cmd

[PATCH] efi_loader: variable: fix an reachable statement

2020-05-07 Thread AKASHI Takahiro
The code should jump into error recovery instead of just returning an error. Signed-off-by: AKASHI Takahiro Reported-by: Coverity (CID 300332) --- lib/efi_loader/efi_variable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader

[PATCH] cmd: efidebug: add a comment against Coverity check (300329)

2020-05-07 Thread AKASHI Takahiro
The check here, "Null pointer dereferences," is a false positive. So leave a comment. Signed-off-by: AKASHI Takahiro Reported-by: Coverity (CID 300329) --- cmd/efidebug.c | 5 + 1 file changed, 5 insertions(+) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 9769aeeac58b..70

[PATCH] cmd: env: fix unreachable statements

2020-05-07 Thread AKASHI Takahiro
C's switch statement takes an integer value for switching. As efi_status_t is defined as unsigned long and each error code has the top bit set, all "cases" cannot be reachable. Signed-off-by: AKASHI Takahiro Reported-by: Coverity (CID 300335) --- cmd/nvedit_efi.c | 20 ++--

[PATCH] efi_loader: variable: check a return value of uuid__str_to_bin()

2020-05-07 Thread AKASHI Takahiro
The only error case is that a given UUID is in wrong format. So just return EFI_INVALID_PARAMETER here. Signed-off-by: AKASHI Takahiro Reported-by: Coverity (CID 300333) --- lib/efi_loader/efi_variable.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader

[PATCH] efi_loader: image_loader: fix a Coverity check against array access

2020-05-07 Thread AKASHI Takahiro
m. Signed-off-by: AKASHI Takahiro Reported-by: Coverity (CID 300339) --- lib/efi_loader/efi_image_loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index 2f270e5497aa..894103c6e4dd 100644 ---

Re: efi_loader: tighten PE verification code?

2020-05-10 Thread AKASHI Takahiro
Patrick, On Fri, May 08, 2020 at 08:56:37PM +0200, Patrick Wildt wrote: > Hi, > > even though this mail has a diff, it's not supposed to be a patch. I > have started adjusting my fuzzer to the upstreamed EFI Secure Boot code > and I hit a few issues right away. Two of those I have already sent

Re: [PATCH 6/8] efi: capsule: Add support for uefi capsule authentication

2020-05-10 Thread Akashi Takahiro
On Sun, May 10, 2020 at 04:56:21PM +0530, Sughosh Ganu wrote: > On Fri, 8 May 2020 at 06:12, Akashi Takahiro > wrote: > > > On Thu, May 07, 2020 at 05:20:35PM +0530, Sughosh Ganu wrote: > > > On Thu, 7 May 2020 at 13:49, Akashi Takahiro > > > > > wrote: &g

Re: [PATCH 1/8] semihosting: Change semihosting file operation functions into global symbols

2020-05-10 Thread Akashi Takahiro
On Thu, Apr 30, 2020 at 11:06:23PM +0530, Sughosh Ganu wrote: > Change the semihosting file operation functions into external symbols > so that they can be called from outside the file. These functions > would be required to be called for implementing firmware update > functionality for the qemu ar

Re: [PATCH 1/1] test: stabilize test_efi_secboot

2020-05-10 Thread AKASHI Takahiro
Heinrich, On Fri, May 08, 2020 at 08:10:28AM +0900, AKASHI Takahiro wrote: > On Thu, May 07, 2020 at 11:14:17PM +0200, Heinrich Schuchardt wrote: > > On 5/7/20 2:36 AM, AKASHI Takahiro wrote: > > > Heinrich, > > > > > > On Mon, May 04, 2020 at 12:33:2

[RFC 00/14] efi_loader: add capsule update support

2020-03-16 Thread AKASHI Takahiro
Table) * enabling capsule API at runtime * json capsule * recovery from update failure Changes === Initial release as RFC (March 17, 2020) AKASHI Takahiro (14): efi_loader: define OsIndicationsSupported flags efi_loader: define System Resource Table macros efi_loader: export a coupl

<    1   2   3   4   5   6   7   8   9   10   >