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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 662AAC636CC for ; Wed, 8 Feb 2023 00:10:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 718C585D28; Wed, 8 Feb 2023 01:10:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (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="cBqg0gRv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B033385CF5; Wed, 8 Feb 2023 01:10:17 +0100 (CET) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 A770885CF5 for ; Wed, 8 Feb 2023 01:10:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82f.google.com with SMTP id q13so733064qtx.2 for ; Tue, 07 Feb 2023 16:10:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BUgxSnXmhCHEL+pTu2W1NkCt6kKoF5Mfm8lAJ0Nxn3w=; b=cBqg0gRvtbsc6vFwzyh1NlqKfb3/al9pu8IJeZbnGvNjlgX19zzbac+jmmciaibuhB xJ6trzObpLk5kXeDlQ5a0E2Q3LT7KAgvqZrDSsfCa56fyqJDzz8UtRlHrSPII+rfteM/ jLL6UwIbj+i2GNfcytcemdslI/H5b+ebp3NeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BUgxSnXmhCHEL+pTu2W1NkCt6kKoF5Mfm8lAJ0Nxn3w=; b=Si0RHHQ5fMi69G5Xv9Hs65ScuQPSw/Jqu8tnR8fk57vg1SHQe1AUlyIKIm1LnFoZZR eBPge2yPabZIt3g4sedeFEk5lKRc7wWjoAX8HGLbataYR8JvIh7iOUc9b9YL56l/Z/lK glNkwNIKDL527BwQMj8Ns9Zf487Ur9OOxMDLWle+CSXjBYfzlyNpZruhg0JXKzvW+LlG ktS3rrvBzjOjTs7y83wtRZY8cZlPt+rKSdfqeCa/OBAUhe/nw8+e3qLXkOqYETgnbpPu doe5MNzgmmv2KHPoyxsd2DxJHFPzyqkchr6ZZl61UsTmUs6sLmZpnFIpMZoJ3rXGDqv5 WWOg== X-Gm-Message-State: AO0yUKXpwmnjLiyLp5mEYHWhIsxf4NgFOJ9t8pfcPGpLLPU/DjBJa0LK A8y6uczGxOnPa+G4tx8NASwFug== X-Google-Smtp-Source: AK7set9c52z1JEqGsIKrAwwM+4juia8J7k7eS5bW3FuVkf4HFZ/sbVMQQOZ8PtpYfNmRO0FBPlwUUQ== X-Received: by 2002:ac8:6645:0:b0:3b9:bc8c:c1fb with SMTP id j5-20020ac86645000000b003b9bc8cc1fbmr21522689qtp.6.1675815012323; Tue, 07 Feb 2023 16:10:12 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-90cc-7e59-435b-3104.res6.spectrum.com. [2603:6081:7b00:6400:90cc:7e59:435b:3104]) by smtp.gmail.com with ESMTPSA id x10-20020a05620a12aa00b0071d57a0eb17sm10269157qki.136.2023.02.07.16.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 16:10:11 -0800 (PST) Date: Tue, 7 Feb 2023 19:10:09 -0500 From: Tom Rini To: Simon Glass Cc: Loic Poulain , kettenis@openbsd.org, michal.simek@xilinx.com, u-boot@lists.denx.de Subject: Re: [PATCH v2 4/5] lib: sha256: Add support for hardware specific sha256_process Message-ID: References: <1654107991-598-1-git-send-email-loic.poulain@linaro.org> <1654107991-598-5-git-send-email-loic.poulain@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PGNaRXg7NqSifXyc" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean --PGNaRXg7NqSifXyc Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 07, 2023 at 03:25:16PM -0700, Simon Glass wrote: > Hi Loic, >=20 > On Tue, 7 Feb 2023 at 14:47, Loic Poulain wrote: > > > > Hi Simon, > > > > On Tue, 7 Feb 2023 at 05:05, Simon Glass wrote: > > > > > > Hi Loic, > > > > > > On Mon, 6 Feb 2023 at 15:12, Loic Poulain w= rote: > > > > > > > > Hi Simon, > > > > > > > > Le lun. 6 f=E9vr. 2023 =E0 18:12, Simon Glass a = =E9crit : > > > >> > > > >> Hi Loic, > > > >> > > > >> On Wed, 1 Jun 2022 at 12:27, Loic Poulain wrote: > > > >> > > > > >> > Mark sha256_process as weak to allow hardware specific implement= ation. > > > >> > Add parameter for supporting multiple blocks processing. > > > >> > > > > >> > Signed-off-by: Loic Poulain > > > >> > --- > > > >> > lib/sha256.c | 26 +++++++++++++++++++------- > > > >> > 1 file changed, 19 insertions(+), 7 deletions(-) > > > >> > > > [...] > > > >> > +__weak void sha256_process(sha256_context *ctx, const unsigned = char *data, > > > >> > + unsigned int blocks) > > > >> > +{ > > > >> > + if (!blocks) > > > >> > + return; > > > >> > + > > > >> > + while (blocks--) { > > > >> > + sha256_process_one(ctx, data); > > > >> > + data +=3D 64; > > > >> > + } > > > >> > +} > > > >> > + > > > >> > void sha256_update(sha256_context *ctx, const uint8_t *input, u= int32_t length) > > > >> > { > > > >> > uint32_t left, fill; > > > >> > @@ -204,17 +218,15 @@ void sha256_update(sha256_context *ctx, co= nst uint8_t *input, uint32_t length) > > > >> > > > > >> > if (left && length >=3D fill) { > > > >> > memcpy((void *) (ctx->buffer + left), (void *) i= nput, fill); > > > >> > - sha256_process(ctx, ctx->buffer); > > > >> > + sha256_process(ctx, ctx->buffer, 1); > > > >> > length -=3D fill; > > > >> > input +=3D fill; > > > >> > left =3D 0; > > > >> > } > > > >> > > > > >> > - while (length >=3D 64) { > > > >> > - sha256_process(ctx, input); > > > >> > - length -=3D 64; > > > >> > - input +=3D 64; > > > >> > - } > > > >> > + sha256_process(ctx, input, length / 64); > > > >> > + input +=3D length / 64 * 64; > > > >> > + length =3D length % 64; > > > >> > > > > >> > if (length) > > > >> > memcpy((void *) (ctx->buffer + left), (void *) i= nput, length); > > > >> > -- > > > >> > 2.7.4 > > > >> > > > > >> > > > >> I just came across this patch as it broke minnowmax. > > > > > > > > > > > > Ok, is it a build time or runtime break? > > > > > > Build, but you need the binary blobs to see it :-( > > > >> > > > >> This should be using driver model, not weak functions. Please can = you > > > >> take a look? > > > > Just tested the minnowmax build (b69026c91f2e; minnowmax_defconfig; > > gcc-11.3.0), and I've not observed any issue (but I had to fake some > > of the binary blobs...). Could you share the build problem/error you >=20 > Unfortunately you need the blobs! >=20 > > encountered? As you mentioned it, Is the error specifically related to > > _weak function linking? Would like to have a simple and quick fix > > before trying to move on to a more proper DM based solution. >=20 > It is just because of the code size increase, I believe. I am planning > to dig into it a bit as Bin Meng asked for more info as to why I sent > a revert for his patch moving U-Boot. That honestly makes more sense, having stared at the commit in question. Perhaps Minnow needs LTO enabled. --=20 Tom --PGNaRXg7NqSifXyc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmPi6F4ACgkQFHw5/5Y0 tyy8VAv6AiRpjwO5G05HoTWq0GV3lyFfh7Av1tqdmiOhVtjEXt27hixgXaLRKXHD p1ji5sPnmKleA02brC6afq5X62demEFbthkmUBhHVsCyE3HeuD+wBL6WNGUwBsJk sbhUSFJyxmmHaKS8X8wqKZdxhoMKElMZpeJ5E5zmPXbQnCPywlWij7lcH6ZtZw5r CnCCj5zoqclaorMdjasVz+fUo9u398VGw5gfwMj9TYfVOdMutLG/s1otfytKAayR tADfv7knmB0h+/1o8rb7CNUoMnCKouuAgxtc5ARx55fQsOJff1XglyLYe6hroe5R UPGWVkbUWfORvYWVHTx7lHiiMYzDPvRr5lGnmpFNmt6lGaM5w/SuuSOQ+WTmwa5L cpFYEithEev4EtcUqtYXz4WYpORqclnfiksXEhte2oUaLSy4SURXOHm18EK4QmCp qJgvZxUwx+4nTrG08iDXu5oUW+JonI7l+IRYbg8zAXlW8ZeJOD2Ypdd2fdNzU1HO 1B/FDpHR =i0CQ -----END PGP SIGNATURE----- --PGNaRXg7NqSifXyc--