Re: [PATCH] Revert "spl: Drop bd_info in the data section"

2021-04-09 Thread Alex G.
Hi Simon On 4/8/21 6:55 PM, Simon Glass wrote: Hi Alexandru, On Fri, 9 Apr 2021 at 04:56, Alexandru Gagniuc wrote: This reverts commit 38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75. struct global_data contains a pointer to the bd_info structure. This pointer was populated spl_set_bd() to a pre-a

Re: [PATCH] Revert "spl: Drop bd_info in the data section"

2021-04-12 Thread Alex G.
On 4/12/21 8:25 AM, Tom Rini wrote: On Fri, Apr 09, 2021 at 05:29:36PM -0700, Tim Harvey wrote: On Fri, Apr 9, 2021 at 1:53 PM Tom Rini wrote: On Fri, Apr 09, 2021 at 03:24:41PM -0500, Adam Ford wrote: On Fri, Apr 9, 2021 at 2:20 PM Alex G. wrote: Hi Simon On 4/8/21 6:55 PM, Simon

Re: [PATCH] Revert "spl: Drop bd_info in the data section"

2021-04-12 Thread Alex G.
On 4/12/21 9:40 AM, Tom Rini wrote: On Mon, Apr 12, 2021 at 08:51:11AM -0500, Alex G. wrote: On 4/12/21 8:25 AM, Tom Rini wrote: On Fri, Apr 09, 2021 at 05:29:36PM -0700, Tim Harvey wrote: On Fri, Apr 9, 2021 at 1:53 PM Tom Rini wrote: On Fri, Apr 09, 2021 at 03:24:41PM -0500, Adam

Getting rid of falcon mode

2021-04-12 Thread Alex G.
## Introduction Today we use "falcon mode" to mean "boot linux straight from SPL". This designation makes sense, since falcons "fly at high speed and change direction rapidly" according to Wikipedia. The way we implement falcon mode is to reserve two areas of storage: * kernel area/partitio

Re: Getting rid of falcon mode

2021-04-13 Thread Alex G.
Hi Maxime, On 4/13/21 3:56 AM, Maxime Ripard wrote: Hi, On Mon, Apr 12, 2021 at 04:32:49PM -0500, Alex G. wrote: ## Introduction Today we use "falcon mode" to mean "boot linux straight from SPL". This designation makes sense, since falcons "fly at high speed and

Re: [PATCH] Revert "spl: Drop bd_info in the data section"

2021-04-18 Thread Alex G.
On 4/16/21 6:16 PM, Adam Ford wrote: On Fri, Apr 16, 2021 at 3:41 PM Tim Harvey wrote: On Mon, Apr 12, 2021 at 11:44 AM Simon Glass wrote: Hi Tom, On Tue, 13 Apr 2021 at 06:38, Tom Rini wrote: On Tue, Apr 13, 2021 at 06:26:08AM +1200, Simon Glass wrote: Hi Tom, On Tue, 13 Apr 2021 at

Re: [PATCH v4 2/6] lib: ecdsa: Add skeleton to implement ecdsa verification in u-boot

2021-04-21 Thread Alex G.
On 4/21/21 2:15 AM, Simon Glass wrote: Hi Alexandru, On Fri, 16 Apr 2021 at 08:07, Alexandru Gagniuc wrote: Prepare the source tree for accepting implementations of the ECDSA algorithm. This patch deals with the boring aspects of Makefiles and Kconfig files. Signed-off-by: Alexandru Gagniuc

Re: [PATCH v4 2/6] lib: ecdsa: Add skeleton to implement ecdsa verification in u-boot

2021-04-26 Thread Alex G.
On 4/23/21 11:56 PM, Simon Glass wrote: Hi Tom, Alex, On Fri, 23 Apr 2021 at 12:47, Tom Rini wrote: On Fri, Apr 23, 2021 at 11:55:57AM +1200, Simon Glass wrote: Hi Alex, On Thu, 22 Apr 2021 at 07:30, Alex G. wrote: On 4/21/21 2:15 AM, Simon Glass wrote: Hi Alexandru, On Fri, 16 Apr

Re: [PATCH v4 2/6] lib: ecdsa: Add skeleton to implement ecdsa verification in u-boot

2021-05-05 Thread Alex G.
On 5/4/21 11:58 AM, Simon Glass wrote: Hi Alex, On Thu, 29 Apr 2021 at 10:10, Simon Glass wrote: Hi Alex, On Mon, 26 Apr 2021 at 07:21, Alex G. wrote: On 4/23/21 11:56 PM, Simon Glass wrote: Hi Tom, Alex, On Fri, 23 Apr 2021 at 12:47, Tom Rini wrote: On Fri, Apr 23, 2021 at 11

Re: [PATCH v4 2/6] lib: ecdsa: Add skeleton to implement ecdsa verification in u-boot

2021-05-05 Thread Alex G.
On 5/5/21 1:43 PM, Simon Glass wrote: Hi Alex, On Wed, 5 May 2021 at 11:49, Alex G. wrote: On 5/4/21 11:58 AM, Simon Glass wrote: Hi Alex, On Thu, 29 Apr 2021 at 10:10, Simon Glass wrote: Hi Alex, On Mon, 26 Apr 2021 at 07:21, Alex G. wrote: On 4/23/21 11:56 PM, Simon Glass

Re: [PATCH v4 2/5] psci: add features/reset2 support

2021-05-05 Thread Alex G.
On 4/20/21 9:21 AM, Tom Rini wrote: On Thu, Apr 01, 2021 at 02:01:53AM +0300, Igor Opaniuk wrote: From: Igor Opaniuk Adds support for: * PSCI_FEATURES, which was introduced in PSCI 1.0. This provides API that allows discovering whether a specific PSCI function is implemented and its features.

Re: [RESEND PATCH v1] psci: rename psci_features function

2021-05-05 Thread Alex G.
On 5/5/21 3:54 PM, Igor Opaniuk wrote: From: Igor Opaniuk s/psci_features/psci_features_req/g for the case when both ARCH_SUPPORT_PSCI=y and ARM_PSCI_FW=y, that leads to these compilation issues: drivers/firmware/psci.c:69:12: error: conflicting types for 'psci_features' 69 | static int ps

Re: [PATCH 7/8] spl: fit: Replace #ifdef blocks with more readable constructs

2020-12-21 Thread Alex G.
On 12/18/20 8:29 PM, Simon Glass wrote: On Tue, 15 Dec 2020 at 17:10, Alexandru Gagniuc wrote: Use the IS_ENABLED() macro to control code flow, instead of the caveman approach of sprinkling #ifdefs. Code size is not affected, as the linker garbage-collects unused functions. However, readabi

Re: [PATCH 2/8] spl: fit: Factor out FIT parsing and use a context struct

2020-12-21 Thread Alex G.
On 12/18/20 8:28 PM, Simon Glass wrote: Hi Alexandru, On Tue, 15 Dec 2020 at 17:09, Alexandru Gagniuc wrote: The logical steps in spl_load_simple_fit() are difficult to follow. I think the long comments, ifdefs, and ungodly number of variables seriously affect the readability. In particular,

Re: [PATCH 2/8] spl: fit: Factor out FIT parsing and use a context struct

2020-12-21 Thread Alex G.
On 12/21/20 2:23 PM, Simon Glass wrote: Hi Alex, On Mon, 21 Dec 2020 at 12:28, Alex G. wrote: On 12/18/20 8:28 PM, Simon Glass wrote: Hi Alexandru, On Tue, 15 Dec 2020 at 17:09, Alexandru Gagniuc wrote: The logical steps in spl_load_simple_fit() are difficult to follow. I think the

Re: [PATCH 2/8] spl: fit: Factor out FIT parsing and use a context struct

2020-12-29 Thread Alex G.
On 12/28/20 9:33 PM, Simon Glass wrote: Hi Alex, On Mon, 21 Dec 2020 at 15:24, Alex G. wrote: On 12/21/20 2:23 PM, Simon Glass wrote: Hi Alex, On Mon, 21 Dec 2020 at 12:28, Alex G. wrote: On 12/18/20 8:28 PM, Simon Glass wrote: Hi Alexandru, On Tue, 15 Dec 2020 at 17:09

Re: [PATCH RFC v2 3/5] lib: Add support for ECDSA image signing

2021-01-07 Thread Alex G.
On 1/7/21 6:35 AM, Simon Glass wrote: Hi Alexandru, Hi Simon, (pun alert!) A lot of your comments have to do with comments. I use comments as a tool to add something of value to code. When the code is self-documenting, comments don't help much. See kernel coding style chapter 8. What comme

Re: [PATCH RFC v2 5/5] test/py: ecdsa: Add test for mkimage ECDSA signing

2021-01-07 Thread Alex G.
On 1/7/21 6:35 AM, Simon Glass wrote: Hi Alexandru, On Wed, 30 Dec 2020 at 14:00, Alexandru Gagniuc wrote: Add a test to make sure that the ECDSA signatures generated by mkimage can be verified successfully. pyCryptodomex was chosen as the crypto library because it integrates much better w

Re: [PATCH RFC v2 5/5] test/py: ecdsa: Add test for mkimage ECDSA signing

2021-01-07 Thread Alex G.
On 1/7/21 11:31 AM, Simon Glass wrote: Hi Alex, On Thu, 7 Jan 2021 at 09:44, Alex G. wrote: On 1/7/21 6:35 AM, Simon Glass wrote: Hi Alexandru, On Wed, 30 Dec 2020 at 14:00, Alexandru Gagniuc wrote: Add a test to make sure that the ECDSA signatures generated by mkimage can be verified

Re: [PATCH RFC v2 3/5] lib: Add support for ECDSA image signing

2021-01-07 Thread Alex G.
On 1/7/21 11:29 AM, Simon Glass wrote: Hi Alex, On Thu, 7 Jan 2021 at 09:27, Alex G. wrote: On 1/7/21 6:35 AM, Simon Glass wrote: Hi Alexandru, Hi Simon, (pun alert!) A lot of your comments have to do with comments. I use comments as a tool to add something of value to code. When the

Re: [PATCH RFC v2 3/5] lib: Add support for ECDSA image signing

2021-01-07 Thread Alex G.
On 1/7/21 11:25 AM, Tom Rini wrote: On Thu, Jan 07, 2021 at 10:27:50AM -0600, Alex G. wrote: On 1/7/21 6:35 AM, Simon Glass wrote: Hi Alexandru, Hi Simon, (pun alert!) A lot of your comments have to do with comments. I use comments as a tool to add something of value to code. When the

Re: [PATCH] lib: rsa: rsa-verify: don't look for keys in the FIT image

2021-01-12 Thread Alex G.
On 1/12/21 12:18 PM, Philippe Reynes wrote: Hi Philippe, In the function rsa_verify_hash, if the "main" key doesn't work, u-boot try others keys. But it searches those keys in the FIT image instead of the u-boot device tree. Signed-off-by: Philippe Reynes --- lib/rsa/rsa-verify.c | 4 ++--

Re: [PATCH v3 3/6] lib: Add support for ECDSA image signing

2021-01-14 Thread Alex G.
On 1/13/21 10:10 AM, Simon Glass wrote: On Thu, 7 Jan 2021 at 15:34, Alexandru Gagniuc wrote: mkimage supports rsa2048, and rsa4096 signatures. With newer silicon now supporting hardware-accelerated ECDSA, it makes sense to expand signing support to elliptic curves. Implement host-side ECD

Re: [PATCH 1/5] dm: crypto: Define UCLASS API for ECDSA signature verification

2021-01-14 Thread Alex G.
On 1/13/21 10:10 AM, Simon Glass wrote: Hi Alexandru, On Mon, 11 Jan 2021 at 08:41, Alexandru Gagniuc wrote: Define a UCLASS API for verifying ECDSA signatures. Unlike UCLASS_MOD_EXP, which focuses strictly on modular exponentiation, the ECDSA class focuses on verification. This is done so th

Re: [PATCH v3 1/8] spl: fit: Drop 'length' argument to board_spl_fit_post_load()

2021-01-18 Thread Alex G.
On 1/15/21 8:33 PM, Tom Rini wrote: On Wed, Dec 23, 2020 at 08:44:05AM -0600, Alexandru Gagniuc wrote: The size is derived from the FIT image itself. Any alignment requirements are machine-specific and known by the board code. Thus the total length can be derived from the FIT image and knowledg

Re: [PATCH] mmc: stm32_sdmmc2: Use mmc_of_parse() to read host capabilities

2020-09-10 Thread Alex G.
On 9/10/20 11:04 AM, Patrick DELAUNAY wrote: Hi Alexandru, Hi [snip] + cfg->f_max = 5200; + mmc_of_parse(dev, cfg); Result of mmc_of_parse is not tested ? I proposed: + ret = mmc_of_parse(dev, cfg); + if (ret) + return ret; You're right. I'll g

Re: [PATCH v2] spl: Add callback for preprocessing loaded FIT header before parsing

2021-03-10 Thread Alex G.
On 3/9/21 5:55 PM, Farhan Ali wrote: This change adds a callback for preprocessing the FIT header before it is parsed. There are 3 main reasons for this callback: (1) If a vulnerability is discovered in the FIT parsing/loading code, or libfdt, this callback allows users to scan the FIT header fo

Re: [PATCH v2] spl: Add callback for preprocessing loaded FIT header before parsing

2021-03-10 Thread Alex G
On 3/10/21 2:49 PM, Farhan Ali wrote: On Wed, Mar 10, 2021 at 11:38 AM Alex G. This patch describes "how" you're trying to achieve it, but "what" you want to achieve. I'll get later into why I think the "how" is fundamentally flawed. The &#x

"SPL image too big" not that helpful

2021-03-17 Thread Alex G.
I've recently hit that message in a yocto build. I can't figure out the exact root cause. On the one hand, I don't know how "big" SPL is. On the other hand, I can't objdump -h the SPL elf because one wasn't created. Alex

Re: [PATCH 4/7] spl: fit: Warn if FIT contains "fpga" property in config node

2021-03-19 Thread Alex G.
On 3/18/21 1:44 AM, Simon Glass wrote: Hi Alexandru, On Thu, 11 Mar 2021 at 07:04, Alexandru Gagniuc wrote: Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify syntax") requires that FPGA images be referenced through the "loadables" in the config node. This means that "fpga"

Re: "SPL image too big" not that helpful

2021-03-19 Thread Alex G.
On 3/19/21 9:27 AM, Tom Rini wrote: On Wed, Mar 17, 2021 at 06:42:55PM -0500, Alex G. wrote: I've recently hit that message in a yocto build. I can't figure out the exact root cause. On the one hand, I don't know how "big" SPL is. On the other hand, I can't objd

Re: [PATCH v2] spl: Add callback for preprocessing loaded FIT header before parsing

2021-03-22 Thread Alex G.
On 3/22/21 9:27 AM, Philippe REYNES wrote: Hi all, Le 11/03/2021 à 00:10, Alex G a écrit : [snip] I reach the same issue, my customers are also worried with the actual signature check scheme on u-boot. The fit data/node are parsed before being checked : data should be used only after

Re: [PATCH 5/7] spl: fit: Support loading FPGA images from list of "loadables"

2021-03-29 Thread Alex G.
On 3/29/21 2:43 AM, Simon Glass wrote: Hi Alexandru, On Thu, 11 Mar 2021 at 07:04, Alexandru Gagniuc wrote: Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify syntax") and delegated FPGA images to be added via the list of "loadables" in lieu of the "fpga" property. Now actually

Re: [PATCH 3/6] spl: LOAD_FIT_FULL: Relocate FDT for u-boot payloads

2021-03-29 Thread Alex G.
On 3/29/21 2:43 AM, Simon Glass wrote: Hi Alexandru, diff --git a/common/spl/spl.c b/common/spl/spl.c index 8f6c8dba6f..e63f05bb33 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -201,6 +201,7 @@ static int spl_load_fit_image(struct spl_image_info *spl_image, { bootm_header

Re: [PATCH 4/6] spl: LOAD_FIT_FULL: Support 'kernel' and 'firmware' properties

2021-03-29 Thread Alex G.
On 3/29/21 2:43 AM, Simon Glass wrote: HI Alexandru, On Fri, 12 Mar 2021 at 10:32, Alexandru Gagniuc wrote: The 'firmware' property of a config node takes precedence over the 'kernel' property. 'standalone' is deprecated. However, give users a couple of releases where 'standalone' still wo

Re: [PATCH] efi_loader: convert void* to u8* on the tcg eventlog buffer

2021-03-29 Thread Alex G.
Hi Ilias, On 3/29/21 8:59 AM, Ilias Apalodimas wrote: Although ptr arithmetics are allowed with extensions in gcc, they are not allowed by the C spec. So switch the 'void *' containing our eventlog buffer into 'u8 *' NAK. This patch is in my opinion wrong. In C, void * can point to anything.

Re: [PATCH v2 6/6] test: dm: Add test for ECDSA UCLASS support

2021-03-29 Thread Alex G.
+ Tim On 3/29/21 2:43 AM, Simon Glass wrote: Hi Alexandru, On Tue, 16 Mar 2021 at 13:24, Alexandru Gagniuc wrote: This test verifies that ECDSA_UCLASS is implemented, and that ecdsa_verify() works as expected. The definition of "expected" is "does not find a device, and returns -ENODEV". Th

Re: [PATCH v2 1/6] dm: crypto: Define UCLASS API for ECDSA signature verification

2021-03-29 Thread Alex G.
On 3/29/21 2:43 AM, Simon Glass wrote: Hi Alexandru, On Tue, 16 Mar 2021 at 13:24, Alexandru Gagniuc wrote: Define a UCLASS API for verifying ECDSA signatures. Unlike UCLASS_MOD_EXP, which focuses strictly on modular exponentiation, the ECDSA class focuses on verification. This is done so

Re: [RFC][PATCH 1/2] cmd: bootm: add a stage pre-load

2021-03-30 Thread Alex G.
Hi Phillipe, On 3/30/21 11:26 AM, Philippe Reynes wrote: This commit adds a stage pre-load that could check or modify the image provided to the bootm command. For the moment, only a header with a signature is supported. This header has this format: - magic : 4 bytes - image size : 4 bytes - sig

Re: [PATCH 2/6] spl: LOAD_FIT_FULL: Do not hard-code os to IH_OS_U_BOOT

2021-03-30 Thread Alex G.
On 3/29/21 2:43 AM, Simon Glass wrote: On Fri, 12 Mar 2021 at 10:32, Alexandru Gagniuc wrote: The information on the OS should be contained in the FIT, as the self-explanatory "os" property of a node under /images. Hard-coding this to U_BOOT might send us down the wrong path later in the bo

Re: [PATCH v2] efi_loader: Change ptr arithmetics tcg eventlog buffer

2021-03-30 Thread Alex G.
Hi Ilias, On 3/29/21 4:42 PM, Ilias Apalodimas wrote: Although ptr arithmetics are allowed with extensions in gcc, they are not allowed by the C spec. So switch to (void *)(uintptr_t) instead Signed-off-by: Ilias Apalodimas Reviewed-by: Alexandru Gagniuc --- changes since v1: Switch over

Re: [EXTERNAL] Re: [PATCH v2 6/6] test: dm: Add test for ECDSA UCLASS support

2021-04-07 Thread Alex G.
On 4/7/21 12:29 PM, Tim Romanski wrote: Question for Alex, I see your repo has a few branches related to ECDSA (patch-ecdsa-v[1-5], patch-mkimage-keyfile-v{1,2}). You sent me a link to 'patch-ecdsa-v1' in a previous email, is that the one that's being upstreamed? Should I be working off a diff

Re: [EXTERNAL] Re: [PATCH v2 6/6] test: dm: Add test for ECDSA UCLASS support

2021-04-08 Thread Alex G.
All the best, Tim On 2021-04-07 4:03 p.m., Alex G. wrote: On 4/7/21 12:29 PM, Tim Romanski wrote: Question for Alex, I see your repo has a few branches related to ECDSA (patch-ecdsa-v[1-5], patch-mkimage-keyfile-v{1,2}). You sent me a link to 'patch-ecdsa-v1' in a previous e

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-11 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: In preparation for enabling CONFIG_IS_ENABLED() on the host build, add some options to enable the various FIT options expected in these tools. This will ensure that the code builds correctly when CONFIG_HOST_xxx is distinct from CONFIG_xxx. Signed-off-by: Si

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-11 Thread Alex G.
On 5/11/21 5:34 PM, Tom Rini wrote: On Tue, May 11, 2021 at 02:57:03PM -0500, Alex G. wrote: On 5/6/21 9:24 AM, Simon Glass wrote: In preparation for enabling CONFIG_IS_ENABLED() on the host build, add some options to enable the various FIT options expected in these tools. This will ensure

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-12 Thread Alex G.
On 5/12/21 9:51 AM, Simon Glass wrote: Hi Alex, On Tue, 11 May 2021 at 13:57, Alex G. wrote: On 5/6/21 9:24 AM, Simon Glass wrote: [snip] + +config HOST_FIT_PRINT + def_bool y + help + Print the content of the FIT verbosely in the host build This option also doesn&#

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-12 Thread Alex G.
On 5/12/21 10:54 AM, Simon Glass wrote: Hi Alex, On Wed, 12 May 2021 at 09:48, Alex G. wrote: On 5/12/21 9:51 AM, Simon Glass wrote: Hi Alex, On Tue, 11 May 2021 at 13:57, Alex G. wrote: On 5/6/21 9:24 AM, Simon Glass wrote: [snip] + +config HOST_FIT_PRINT + def_bool y

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-12 Thread Alex G.
On 5/12/21 10:52 AM, Simon Glass wrote: Hi, On Tue, 11 May 2021 at 19:10, Tom Rini wrote: On Tue, May 11, 2021 at 07:50:38PM -0500, Alex G. wrote: On 5/11/21 5:34 PM, Tom Rini wrote: On Tue, May 11, 2021 at 02:57:03PM -0500, Alex G. wrote: On 5/6/21 9:24 AM, Simon Glass wrote: In

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-13 Thread Alex G.
On 5/12/21 12:30 PM, Simon Glass wrote: Hi Alex, On Wed, 12 May 2021 at 10:18, Alex G. wrote: On 5/12/21 10:54 AM, Simon Glass wrote: Hi Alex, On Wed, 12 May 2021 at 09:48, Alex G. wrote: On 5/12/21 9:51 AM, Simon Glass wrote: Hi Alex, On Tue, 11 May 2021 at 13:57, Alex G

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-14 Thread Alex G.
On 5/13/21 6:56 PM, Simon Glass wrote: Hi Alex, On Thu, 13 May 2021 at 10:21, Alex G. wrote: On 5/12/21 12:30 PM, Simon Glass wrote: Hi Alex, On Wed, 12 May 2021 at 10:18, Alex G. wrote: On 5/12/21 10:54 AM, Simon Glass wrote: Hi Alex, On Wed, 12 May 2021 at 09:48, Alex G

Re: [PATCH v2 18/50] image: Shorten FIT_ENABLE_SHAxxx_SUPPORT

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: The ENABLE part of this name is redundant, since all boolean Kconfig options serve to enable something. The SUPPORT part is also redundant since Kconfigs can be assumed to enable support for something. Together they just serve to make these options overly

Re: [PATCH v2 19/50] image: Rename SPL_SHAxxx_SUPPORT to SPL_FIT_SHAxxx

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: These option are named inconsistently with other SPL options, thus making them incompatible with the CONFIG_IS_ENABLED() macro. Rename them. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc --- (no changes since v1) common/spl/Kconfig |

Re: [PATCH v2 21/50] hash: Drop some #ifdefs in hash.c

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: We can use the __maybe_unused attribute to avoid some of the #ifdefs in this file. Update the functions accordingly. What is __maybe_unused? Does u-boot support booting quantum computers? Note: The actual hashing interface is still a mess, with four s

Re: [PATCH v2 37/50] image: Drop IMAGE_ENABLE_SIGN/VERIFY defines

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: Add host Kconfigs for FIT_SIGN and RSA_VERIFY. With these we can use CONFIG_IS_ENABLED() directly in the host build, so drop the unnecessary indirections IMAGE_ENABLE_SIGN and HOST_RSA_VERIFY. Also drop FIT_IMAGE_ENABLE_VERIFY which is not actually used.

Re: [PATCH v2 37/50] image: Drop IMAGE_ENABLE_SIGN/VERIFY defines

2021-05-14 Thread Alex G.
On 5/14/21 3:44 PM, Simon Glass wrote: Hi Alex, On Fri, 14 May 2021 at 14:38, Alex G. wrote: On 5/6/21 9:24 AM, Simon Glass wrote: Add host Kconfigs for FIT_SIGN and RSA_VERIFY. With these we can use CONFIG_IS_ENABLED() directly in the host build, so drop the unnecessary indirections

Re: [PATCH v2 27/50] Kconfig: Rename SPL_CRC32_SUPPORT to SPL_CRC32

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: Drop the _SUPPORT suffix so we can use CONFIG_IS_ENABLED() with this option. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc --- (no changes since v1) common/spl/Kconfig| 4 ++-- configs/axm_defconfig

Re: [PATCH v2 29/50] Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: Drop the _SUPPORT suffix so we can use CONFIG_IS_ENABLED() with this option. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc --- (no changes since v1) common/spl/Kconfig | 2 +- include/image.h| 2 +- 2 files changed, 2 insertion

Re: [PATCH v2 38/50] image: Drop IMAGE_ENABLE_BEST_MATCH

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: This is not needed with Kconfig, since we can use IS_ENABLED() easily enough. Drop it. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc --- (no changes since v1) common/image-fit.c | 2 +- include/image.h| 5 - 2 files change

Re: [PATCH v2 41/50] image: Drop unnecessary #ifdefs from image.h

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: This file has a lot of conditional code and much of it is unnecessary. Clean this up to reduce the number of build combinations. Signed-off-by: Simon Glass --- [snip] @@ -523,12 +520,9 @@ enum fit_load_op { int boot_get_setup(bootm_headers_t *image

Re: [PATCH v2 42/50] image: Drop #ifdefs for fit_print_contents()

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: Use a simple return to drop the unwanted code. Signed-off-by: Simon Glass Reviewed-by: Alexandru Gagniuc --- (no changes since v1) common/image-fit.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/image-f

Re: [PATCH v2 47/50] image: Remove some #ifdefs from image-fit and image-fit-sig

2021-05-14 Thread Alex G.
On 5/6/21 9:24 AM, Simon Glass wrote: Drop the #ifdefs which are easy to remove without refactoring. Signed-off-by: Simon Glass --- (no changes since v1) common/Kconfig.boot| 10 ++ common/image-fit-sig.c | 8 ++-- common/image-fit.c | 7 --- 3 files changed,

Re: [PATCH RFC 01/10] common: Move host-only logic in image-sig.c to separate file

2021-05-17 Thread Alex G.
On 5/15/21 10:20 AM, Simon Glass wrote: Hi Alexandru, On Fri, 14 May 2021 at 13:46, Alexandru Gagniuc wrote: image-sig.c is used to map a hash or crypto algorithm name to a handler of that algorithm. There is some similarity between the host and target variants, with the differences worked ou

Re: [PATCH 09/18] common: Move host-only logic in image-sig.c to separate file

2021-05-17 Thread Alex G.
On 5/17/21 11:38 AM, Alexandru Gagniuc wrote: image-sig.c is used to map a hash or crypto algorithm name to a handler of that algorithm. There is some similarity between the host and target variants, with the differences worked out by #ifdefs. The purpose of this change is to remove those ifde

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-17 Thread Alex G.
On 5/12/21 12:14 PM, Tom Rini wrote: On Wed, May 12, 2021 at 11:19:52AM -0500, Alex G. wrote: On 5/12/21 10:52 AM, Simon Glass wrote: [snip] We have a NO_SDL build-time control. Perhaps have a NO_SSL one as well? It could be a config option instead of an environment variable. I think it

Re: [PATCH v2 16/50] image: Add Kconfig options for FIT in the host build

2021-05-19 Thread Alex G
On 5/17/21 8:23 PM, AKASHI Takahiro wrote: On Mon, May 17, 2021 at 05:29:44PM -0500, Alex G. wrote: On 5/12/21 12:14 PM, Tom Rini wrote: On Wed, May 12, 2021 at 11:19:52AM -0500, Alex G. wrote: On 5/12/21 10:52 AM, Simon Glass wrote: [snip] We have a NO_SDL build-time control

Re: [PATCH 06/18] image: Drop IMAGE_ENABLE_SHA1

2021-05-19 Thread Alex G
On 5/19/21 11:36 AM, Simon Glass wrote: Hi Alexandru, On Mon, 17 May 2021 at 10:38, Alexandru Gagniuc wrote: From: Simon Glass We already have a host Kconfig for SHA1. Use CONFIG_IS_ENABLED(SHA1) directly in the code shared with the host build, so we can drop the unnecessary indirection.

Re: [PATCH 06/18] image: Drop IMAGE_ENABLE_SHA1

2021-05-19 Thread Alex G.
On 5/19/21 4:55 PM, Simon Glass wrote: Hi Alex, On Wed, 19 May 2021 at 11:44, Alex G wrote: On 5/19/21 11:36 AM, Simon Glass wrote: Hi Alexandru, On Mon, 17 May 2021 at 10:38, Alexandru Gagniuc wrote: From: Simon Glass We already have a host Kconfig for SHA1. Use

Re: [PATCH 06/18] image: Drop IMAGE_ENABLE_SHA1

2021-05-20 Thread Alex G.
On 5/20/21 12:52 PM, Simon Glass wrote: Hi Alex, On Wed, 19 May 2021 at 20:41, Alex G. wrote: On 5/19/21 4:55 PM, Simon Glass wrote: Hi Alex, On Wed, 19 May 2021 at 11:44, Alex G wrote: On 5/19/21 11:36 AM, Simon Glass wrote: Hi Alexandru, On Mon, 17 May 2021 at 10:38

Re: [PATCH 06/18] image: Drop IMAGE_ENABLE_SHA1

2021-05-20 Thread Alex G.
On 5/20/21 6:17 PM, Simon Glass wrote: Hi Alex, On Thu, 20 May 2021 at 17:13, Alex G. wrote: On 5/20/21 12:52 PM, Simon Glass wrote: Hi Alex, On Wed, 19 May 2021 at 20:41, Alex G. wrote: On 5/19/21 4:55 PM, Simon Glass wrote: Hi Alex, On Wed, 19 May 2021 at 11:44, Alex G wrote

Re: [PATCH 06/18] image: Drop IMAGE_ENABLE_SHA1

2021-05-24 Thread Alex G.
On 5/21/21 2:39 PM, Simon Glass wrote: Hi Alex, On Thu, 20 May 2021 at 18:07, Alex G. wrote: On 5/20/21 6:17 PM, Simon Glass wrote: Hi Alex, On Thu, 20 May 2021 at 17:13, Alex G. wrote: On 5/20/21 12:52 PM, Simon Glass wrote: Hi Alex, On Wed, 19 May 2021 at 20:41, Alex G

Re: [PATCH RFC 1/2] Revert "lib: introduce HASH_CALCULATE option"

2021-05-26 Thread Alex G.
On 5/26/21 11:06 AM, Heinrich Schuchardt wrote: On 5/24/21 9:28 PM, Alexandru Gagniuc wrote: When we think of Kconfig, we usually think of features that we like to enable or not. Ideally, we wouldn't use Kconfig to fix a build issue, although sometimes it might make sense. With Kconfig it's h

Re: [PATCH v9 1/1] efi_loader: add PE/COFF image measurement

2021-05-26 Thread Alex G.
On 5/25/21 10:09 PM, Masahisa Kojima wrote: "TCG PC Client Platform Firmware Profile Specification" requires to measure every attempt to load and execute a OS Loader(a UEFI application) into PCR[4]. This commit adds the PE/COFF image measurement, extends PCR, and appends measurement into Event Lo

Re: [PATCH v3 3/5] arm: stm32mp: Implement support for TZC 400 controller

2021-05-31 Thread Alex G.
Hi Patrick, On 5/28/21 4:59 AM, Patrick DELAUNAY wrote: Hi, Any reason to prefer  uint16_t and uint32_t ? I use standard C types. u32, _u32, and __u32 are non-standard, and they have different meanings depending on how they're used. I avoid them for this reason. Alex See checkpatch warn

Re: [PATCH v3 4/5] stm32mp1: spl: Configure TrustZone controller for OP-TEE

2021-05-31 Thread Alex G.
On 5/28/21 5:22 AM, Patrick DELAUNAY wrote: Hi, On 4/15/21 6:48 PM, Alexandru Gagniuc wrote: [snip] +    fdt_start = ofnode_get_addr_size(node, "reg", size); warning here because size is 'fdt_size_t *' not 'u32*' arch/arm/mach-stm32mp/spl.c:122:48: warning: passing argument 3 of ‘ofnode_

Re: U-Boot "lib: Add support for ECDSA image signing" commit breaks socfpga_*_atf_defconfig compilation

2021-05-31 Thread Alex G.
On 4/24/21 2:43 AM, Lim, Elly Siew Chin wrote: Add this discussion to denx mailing list. [snip] I can think of two enhancement to fix this: (1) Add separate CONFIG to gate ECDSA algorithm. This enhancement benefits all use cases. I assume not all user need ECDSA algorithm when FIT_SIGNATU

Re: [PATCH] tools: Use a single target-independent config to enable OpenSSL

2021-06-16 Thread Alex G.
On 6/15/21 6:34 PM, AKASHI Takahiro wrote: A gentle ping. What is the current review status? Who will take care of this patch? Patchwork automatically delegates this to a maintainer [1], but anyone is welcome to comment and review. Alex [1] https://patchwork.ozlabs.org/project/uboot/patch/

Re: Boeing Engineer - Help Needed (URGENT)

2021-06-17 Thread Alex G.
Ni Nelson, On 6/17/21 2:21 PM, Su (US), Nelson Z wrote: Hi U-Boot devs, I am an engineer working for Boeing and I need assistance with getting a MicroChip VSC6803 API (https://github.com/microchip-ung/mesa) to work on their VSC7429 Ethernet Switch. From their API, we have a MFI image file bui

Re: [PATCH] tools: Use a single target-independent config to enable OpenSSL

2021-06-22 Thread Alex G.
On 6/22/21 8:31 AM, Simon Glass wrote: [snip] +config TOOLS_USE_LIBCRYPTO would HOST_LIBCRYPTO be better? I had considered a shorter kconfig such as the above. Does it mean (1) The build host has libcrypto available? (2) We use the libcrypto on the host? (3) There is a libcrypto

Re: [PATCH v4 0/5] stm32mp: Enable OP-TEE and TZC support in SPL

2021-07-06 Thread Alex G.
On 5/31/21 12:43 PM, Alexandru Gagniuc wrote: The purpose of this series is to allow booting an OP-TEE image from SPL, by corectly configuring the TrustZone (TZC) memory regions. Any chance we could have this hit the merge window? Alex

Re: [PATCH v4 0/5] stm32mp: Enable OP-TEE and TZC support in SPL

2021-07-06 Thread Alex G.
On 7/6/21 10:45 AM, Tom Rini wrote: On Tue, Jul 06, 2021 at 10:18:44AM -0500, Alex G. wrote: On 5/31/21 12:43 PM, Alexandru Gagniuc wrote: The purpose of this series is to allow booting an OP-TEE image from SPL, by corectly configuring the TrustZone (TZC) memory regions. Any chance we could

Re: [PATCH v4 0/6] Add support for ECDSA image signing (with test)

2021-01-28 Thread Alex G.
On 1/28/21 10:40 AM, Patrick DELAUNAY wrote: Hi Alexandru, Hi Patrick I found in doc/uImage.FIT/signature.txt the description     - key-name-hint: Name of key to use for signing. The keys will normally be in a single directory (parameter -k to mkimage). [snip] You are correct that the ECD

Re: [PATCH v2 26/40] test: Use a local variable for test state

2021-02-01 Thread Alex G.
Hi Simon, On 1/30/21 9:32 PM, Simon Glass wrote: [snip] +static struct unit_test_state *cur_test_state; + +struct unit_test_state *test_get_state(void) +{ + return cur_test_state; +} + +void test_set_state(struct unit_test_state *uts) +{ + cur_test_state = uts; +} + /** * dm_

Re: [PATCH 1/5] spl: mmc: Support OP-TEE payloads in Falcon mode

2021-02-04 Thread Alex G.
This series was re-sent in error. Please ignore. On 2/4/21 1:55 PM, Alexandru Gagniuc wrote: In general, Falcon mode means we're booting a linux kernel directly. With FIT images, however, an OP-TEE secure kernel can be booted before linux. Thus, if the next stage is an IH_OS_TEE, this isn't nece

Re: U-Boot ECDSA Implementation Question

2021-02-05 Thread Alex G.
Hi Tim, On 2/5/21 8:35 AM, Simon Glass wrote: I’m a current intern at Microsoft, and one of my priorities is to enable ECDSA for U-Boot image signing/verification. Simon mentioned someone is already working on ECC, it would be great to get synced up with related progress. For signing, I will

Re: [PATCH 3/5] arm: stm32mp: Implement support for TZC 400 controller

2021-02-08 Thread Alex G.
On 2/7/21 8:37 AM, Simon Glass wrote: Hi Alexandru, On Thu, 4 Feb 2021 at 12:56, Alexandru Gagniuc wrote: The purpose of this change is to allow configuring TrustZone (TZC) memory permissions. For example, OP-TEE expects TZC regions to be configured in a very particular way. The API presented

Re: [PATCH 0/5] Enable ECDSA FIT verification for stm32mp

2021-02-09 Thread Alex G.
Hi Patrick, On 2/9/21 9:08 AM, Patrick DELAUNAY wrote: [snip] For information, today the STMicroelectronics expected that the boot sequence for secure boot (with closed STM32MP1 devices) is the trusted boot chain. TF-A (BL2) => OP-TEE or  => U-Boot =>  OS     TF-A

Re: [PATCH 2/5] lib: ecdsa: Add skeleton to implement ecdsa verification in u-boot

2021-02-09 Thread Alex G.
Hi Patrick, On 2/9/21 9:11 AM, Patrick DELAUNAY wrote: Hi, On 1/11/21 4:41 PM, Alexandru Gagniuc wrote: Prepare the source tree for accepting implementations of the ECDSA algorithm. This patch deals with the boring aspects of Makefiles and Kconfig files. Signed-off-by: Alexandru Gagniuc ---  

Re: [PATCH 3/5] lib: ecdsa: Implement signature verification for crypto_algo API

2021-02-09 Thread Alex G.
On 2/9/21 9:56 AM, Patrick DELAUNAY wrote: Hi, [snip] diff --git a/lib/ecdsa/ecdsa-verify.c b/lib/ecdsa/ecdsa-verify.c index d2e6a40f4a..d84f6eb093 100644 --- a/lib/ecdsa/ecdsa-verify.c +++ b/lib/ecdsa/ecdsa-verify.c @@ -1,13 +1,128 @@   // SPDX-License-Identifier: GPL-2.0+   /* + * ECDSA s

Re: [PATCH v5 6/6] test/py: ecdsa: Add test for mkimage ECDSA signing

2021-02-10 Thread Alex G.
On 2/1/21 2:43 PM, Simon Glass wrote: Hi Alexandru, [snip] As mentioned earlier, this does need a test that checks the U-Boot code paths. This just seems to be checking the signing process. This likely involves implementing the verification (or a fake of it) in sandbox. If I am missing somet

Re: [PATCH] spl: Align device tree blob address at 8-byte boundary

2021-07-12 Thread Alex G.
On 7/12/21 10:15 AM, Tom Rini wrote: On Mon, Jul 12, 2021 at 01:36:14PM +0800, Bin Meng wrote: On Mon, Jul 12, 2021 at 1:21 PM Reuben Dowle wrote: I submitted an almost identical patch. See https://github.com/u-boot/u-boot/commit/eb39d8ba5f0d1468b01b89a2a464d18612d3ea76 This patch eventuall

Re: [PATCH] spl: Align device tree blob address at 8-byte boundary

2021-07-13 Thread Alex G
, 2021 at 04:35:38PM +0200, Marek Vasut wrote: On 7/13/21 3:47 PM, Tom Rini wrote: On Mon, Jul 12, 2021 at 11:01:24AM -0500, Alex G. wrote: On 7/12/21 10:15 AM, Tom Rini wrote: On Mon, Jul 12, 2021 at 01:36:14PM +0800, Bin Meng wrote: On Mon, Jul 12, 2021 at 1:21 PM Reuben Dowle wrote: I

Re: [PATCH] spl: Align device tree blob address at 8-byte boundary

2021-07-13 Thread Alex G
wrote: On 7/13/21 3:47 PM, Tom Rini wrote: On Mon, Jul 12, 2021 at 11:01:24AM -0500, Alex G. wrote: On 7/12/21 10:15 AM, Tom Rini wrote: On Mon, Jul 12, 2021 at 01:36:14PM +0800, Bin Meng wrote: On Mon, Jul 12, 2021 at 1:21 PM Reuben Dowle wrote: I submitted an almost identical patch. See

Re: [PATCH v4 1/5] spl: mmc: Support OP-TEE payloads in Falcon mode

2021-07-15 Thread Alex G.
On 7/15/21 1:27 PM, Patrick DELAUNAY wrote: Hi, [snip] When I merge this patch on master branch, I get the error: arm:  +   imx6dl_mamoj +spl/u-boot-spl.bin exceeds file size limit: +  limit:  0xefa0 bytes +  actual: 0xf41d bytes +  excess: 0x47d bytes +make[1]: *** [Makefile:1997: spl/u-

Re: [PATCH v5 0/5] stm32mp: Enable OP-TEE and TZC support in SPL

2021-07-25 Thread Alex G.
On 7/15/21 2:19 PM, Alexandru Gagniuc wrote: v4 branch was reported to have some issues with SPL becoming too big on some platforms (e.g. imx6dl_mamoj) This is fixed by dropping the call to genimg_get_os_name(). Ping for merge window. Alexandru Gagniuc (5): spl: mmc: Support OP-TEE payload

Re: [PATCH v3 19/19] tools: Use a single target-independent config to enable OpenSSL

2021-07-27 Thread Alex G.
On 7/27/21 4:59 AM, Heiko Thiery wrote: Hi all, Am Do., 15. Juli 2021 um 00:09 Uhr schrieb Alexandru Gagniuc : Host tool features, such as mkimage's ability to sign FIT images were enabled or disabled based on the target configuration. However, this misses the point of a target-agnostic hos

Re: [PATCH 1/1] lib/ecdsa: Fix LibreSSL before v2.7.0

2021-07-28 Thread Alex G.
On 7/28/21 1:10 PM, Artem Panfilov wrote: Fix LibreSSL compilation for versions before v2.7.0. Fix following compilation issue when CONFIG_TOOLS_LIBCRYPTO is enabled: tools/lib/ecdsa/ecdsa-libcrypto.o: In function `prepare_ctx': ecdsa-libcrypto.c:(.text+0x94): undefined reference to `OPENSSL_

Re: [PATCH 1/1] lib/ecdsa: Fix LibreSSL before v2.7.0

2021-07-28 Thread Alex G.
l compatibility. They all looks ugly. Another solution is to disable CONFIG_TOOLS_LIBCRYPTO by default that broke our builds. Do you need cryptographic features in mkimage? If not just disable TOOLS_LIBCRYPTO in your builds. Alex Best regards, Artem ср, 28 июл. 2021 г., 22:16 Alex G.

Re: [PATCH 1/1] lib/ecdsa: Fix LibreSSL before v2.7.0

2021-07-29 Thread Alex G.
Hi Artem On 7/29/21 9:52 AM, Artem Panfilov wrote: On 29.07.2021 15:59, Tom Rini wrote: Well yes, this is part of the question now, is there enough interest in the old version to bother with?  The other part of the question is what's being built now that wasn't being built before, and is that a

Re: [PATCH v5 6/6] test/py: ecdsa: Add test for mkimage ECDSA signing

2021-02-17 Thread Alex G.
On 2/17/21 5:03 PM, Tom Rini wrote: On Thu, Jan 28, 2021 at 09:52:48AM -0600, Alexandru Gagniuc wrote: Add a test to make sure that the ECDSA signatures generated by mkimage can be verified successfully. pyCryptodomex was chosen as the crypto library because it integrates much better with pytho

Frustrations of running testing

2021-02-19 Thread Alex G.
Hi, I keep being hit by two frustrating issues when trying to run tests. My expectation is that I can run a test at any time when working on something -- usually to check the correctness of that something. That's not the case today. The first one is an error message about mrproper:

  1   2   >