From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00B5BC432BE for ; Mon, 30 Aug 2021 16:01:59 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 182AF60F5B for ; Mon, 30 Aug 2021 16:01:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 182AF60F5B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8C51882BDC; Mon, 30 Aug 2021 18:01:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="YJrksF6L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 293A08338D; Mon, 30 Aug 2021 18:01:54 +0200 (CEST) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E90AA82BDC for ; Mon, 30 Aug 2021 18:01:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2b.google.com with SMTP id gf5so8555263qvb.9 for ; Mon, 30 Aug 2021 09:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AFIuEavl62W1un52VFc7D92c/CSWUS5vyWr34SzYyGs=; b=YJrksF6LXzJLo7R5m18stGiEid1yoDwJdxG+G4gM4gQ6T+VXnWSSrS+bOaeRdlWA+z CABMneuIR3X5nyXKQfIl/sLSO++akPKTyROREDCm4B2jDT8ye5l6quxcHPyDBXZrpz2w 0vdVGteIvO3s1bc2dNSu3yuu2H9akj99aIN/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AFIuEavl62W1un52VFc7D92c/CSWUS5vyWr34SzYyGs=; b=Upm9TxEkHabpUIUSGjQNScvCX6EYdqJr8FfWorzQdBDyC/6q/vLKi5Qd63UHyzwRNV lSCCYSOZrei/8WZoGrqGpXmKWbAMIvpDAGf6k6P9644ty68Ai8XASH/irK0zGg9Qy5A4 4/katm/zg0pOjvfRR79CUNh0qo3x1GwskaC5MLX+JP9AJLEA8SwjYm4Askc7qFoch2dZ siICIp5QMlm0HWfFd/H9QHVsf1dInd6xtDvA+ktlxFKeQJIgVb5QHgz58fN+7nrz5t/X EG7qMlvjwArxWsy1DcOfzczBBIszvvc7kYZp+OOGyn2C9rx8zpYOr+ChmKpURDyShDrt Dyhg== X-Gm-Message-State: AOAM531PqZ3cO+svJNi669hvx9eQB9LSOvkhgwvIjQv8lQ7mWTPy6L1k 47p7TbFfoOWOXDjQDc7uEaxYLQ== X-Google-Smtp-Source: ABdhPJxAbJdGaSkS+ufTNz8g3g32tU9jS9kN2XSoDZN0BQrjGpJWapO4agVcGMU6Idgb4Fnpmm0EEw== X-Received: by 2002:a0c:f3ce:: with SMTP id f14mr11241847qvm.33.1630339308753; Mon, 30 Aug 2021 09:01:48 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-8d75-4e9a-efec-7167.res6.spectrum.com. [2603:6081:7b01:cbda:8d75:4e9a:efec:7167]) by smtp.gmail.com with ESMTPSA id d20sm8633478qtr.80.2021.08.30.09.01.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Aug 2021 09:01:48 -0700 (PDT) Date: Mon, 30 Aug 2021 12:01:46 -0400 From: Tom Rini To: Alexandru Gagniuc Cc: u-boot@lists.denx.de, sjg@chromium.org Subject: Re: [PATCH 4/5] image: Drop if/elseif hash selection in calculate_hash() Message-ID: <20210830160146.GA14609@bill-the-cat> References: <20210824005320.3647668-1-mr.nuke.me@gmail.com> <20210824005320.3647668-5-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: <20210824005320.3647668-5-mr.nuke.me@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 23, 2021 at 07:53:19PM -0500, Alexandru Gagniuc wrote: > calculate_hash() would try to select the appropriate hashing function > by a if/elseif contruct. But that is exactly why hash_lookup_algo() > exists, so use it instead. >=20 > This does mean that we now have to 'select HASH' to make sure we get > the hash_lookup_algo() symbol. However, the change makes sense because > even basic FITs will have to deal with "hash" nodes. >=20 > My only concern is that the 'select SPL_HASH' might cause some > platform to grow above its SPL size allowance >=20 > Signed-off-by: Alexandru Gagniuc Two problems. The easy to fix problem is that we need: commit 7dbac59f6655e928d11708948f34e779b03bb3d2 Author: Alexandru Gagniuc Date: Mon Aug 23 19:53:19 2021 -0500 image: Drop if/elseif hash selection in calculate_hash() =20 calculate_hash() would try to select the appropriate hashing function by a if/elseif contruct. But that is exactly why hash_lookup_algo() exists, so use it instead. =20 This does mean that we now have to 'select HASH' to make sure we get the hash_lookup_algo() symbol. However, the change makes sense because even basic FITs will have to deal with "hash" nodes. =20 My only concern is that the 'select SPL_HASH' might cause some platform to grow above its SPL size allowance =20 Signed-off-by: Alexandru Gagniuc [trini: Add SPL_CRYPTO to FSL_CAAM if ARM && SPL] Signed-off-by: Tom Rini diff --git a/drivers/crypto/fsl/Kconfig b/drivers/crypto/fsl/Kconfig index 1f5dfb94bb81..f91753aa0f3d 100644 --- a/drivers/crypto/fsl/Kconfig +++ b/drivers/crypto/fsl/Kconfig @@ -1,6 +1,7 @@ config FSL_CAAM bool "Freescale Crypto Driver Support" select SHA_HW_ACCEL + select SPL_CRYPTO if (ARM && SPL) imply CMD_HASH help Enables the Freescale's Cryptographic Accelerator and Assurance to fix a handful of platforms. The harder to fix problem is that changing how the algorithm is selected seems to break mkimage on for example xilinx_zynqmp_virt. Please fix and resubmit, and run it all past CI as well. Thanks! --=20 Tom --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEtAOMACgkQFHw5/5Y0 tywzXwwAiZ7rqPuF6TmxEvpaXJIOtwemnSJAgdl/+EvONA75Gy5uoYXFWUem/V5e n+3c2VFdQnujeRdGmOfI9ofdNVvWCnUotEigg4TAHSJXYWgiydsTr6Og9EFxF+Li A45Ppxg/y85wXfWg/n2enRbEp378xChUveWQQDj0xZjZGZMggxf/XBj9gGaR/XvY j5X9hL33qQTYDGYNwpZuW568Qg8c1w/I/NJ5TxxKoo9elwXKHM91lg1Nlmra2rPb xdLZDYHKLpkuMYYaas+P++qZyCH8amU49ssJKcXccBdvaUE/mTUkQ2rhle5VCfF8 YbrITares9q3JkVOI3azMAL8g0hRr7mkS5qzEF4y4eN/LzmdbzN67lu7qmYZQx9N o/cstLJwOa1VHsnTr9XiIT/3HYXsGYJBGey+HcIk/wDVPH6JAs9w7vGFF9gq9HPA tn9HkFbshTi4V+IefxfRx8YfghzndIiiY6xLg0xagtCpDZzjPK/wbQ095m8UiKWB lio4eNVr =wDDs -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--