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 44347C433EF for ; Tue, 26 Jul 2022 09:32:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F37DA8410B; Tue, 26 Jul 2022 11:25:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1658827515; bh=J4MnjdoWJyZkUaEIiIKVS+IlAOTzzZyCtgvA/2eeKgM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KVNCaQJJ5jQEn0JCIdZeejtzspx9uXLxNPOveeeL4LZiQlFqLiOnX7XrHABihvPVr 6tU9RhXaLyKJrsnttIi38JUYSq/kKaLfwfIRm3CbtG6BIQI3gv02nSYUcceF2hTcnd j63tWc8ETngLK2fyYKgl3d+Jik/fPhRy18iAkG20lkr2/MQPIMtOu0jvIUkXB0UQr7 RCew9QCZin7573VJsw/LIXQME6q+TpD4eCRB1SNInPft2lPchpBFR5c3Jq0I6TNLpK mPKypHsA1Dh+hPBrcWjKD0GTNrfpShADZgKU+95NiUpwQfQgLWi4fbt8PscJm1O2t6 P74JVb0roGW4w== Received: from [IPV6:2001:a61:619c:6d01:49bf:1eb6:578e:67bc] (unknown [IPv6:2001:a61:619c:6d01:49bf:1eb6:578e:67bc]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbabic@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 54EDC84065; Tue, 26 Jul 2022 11:25:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1658827513; bh=J4MnjdoWJyZkUaEIiIKVS+IlAOTzzZyCtgvA/2eeKgM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hYuhR0PTwD6rtjEWsLJAd+5kjEPTFpimmtGcqpI04b1BTwCHjLxnrj0+sRHnW4lCq 2nigkvFjPVyw/Y2NBLqPzSQ1ThETY9icC8gV/Zo03EG6sNooGqkPgZCiiUbkQnz4Ew 2zig6Uo6Ga2i907LD1ygfY8sNgHYFwiL1lo/89Nhmk0skf+VXMFz5nUGUD9ILIXDHW D65VPyMHl7nLrNIINUtioqrVRAabhulAecKfjxzJ/mcxRKWnn9tDU38IpggJm/MjGV g2EgDoLgLc1QmVaYKJzbTC/A5q3EkMMLdQnWpLfEQntXTpNzIWdUuMZn5BoZHSgnrb 2gR4NkSHe/f3Q== Message-ID: Date: Tue, 26 Jul 2022 11:25:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [EXT] Re: [PATCH v3] crypto/fsl: fsl_rsa: Fix dcache issue in the driver Content-Language: de-DE To: Gaurav Jain , Stefano Babic , Fabio Estevam Cc: U-Boot-Denx , Peng Fan , dl-uboot-imx , Horia Geanta , Varun Sethi , Ye Li References: <20220615123447.4087910-1-gaurav.jain@nxp.com> <1cd6876b-769e-6e35-56ed-dcef8fe7e863@denx.de> <4d596ff8-ab44-60ea-a066-9184e1876f75@denx.de> From: Stefano Babic In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Hi Gaurav, On 29.06.22 10:35, Gaurav Jain wrote: > Hi Stefano > > this patch is fixing dcache issue in fsl_rsa.c > The thread changed name, I mean "crypto/fsl: fsl_hash: Fix crash in flush dcache" > Error reported is in drivers/crypto/fsl/fsl_hash.c > addr = (addr << 32) | sec_in32(&ctx->sg_tbl[i].addr_lo); > > reported error is fixed in [v3] crypto/fsl: fsl_hash: Fix crash in flush dcache > http://patchwork.ozlabs.org/project/uboot/patch/20220616101009.809953-1-gaurav.jain@nxp.com/ > Give an another attempt, it fails and it is quite clear why: +#ifdef CONFIG_CAAM_64BIT + addr = sec_in32(&ctx->sg_tbl[i].addr_hi); + addr = (addr << 32) | sec_in32(&ctx->sg_tbl[i].addr_lo); +#else Fine with ARM and ARM64. In Kconfig: config CAAM_64BIT bool default y if PHYS_64BIT && !ARCH_IMX8M && !ARCH_IMX8 help Select Crypto driver for 64 bits CAAM version That is ok until powerpc are built that sets PHYS_64BIT. Then build fails with: powerpc: + T4240RDB_SDCARD +drivers/crypto/fsl/fsl_hash.c: In function 'caam_hash_finish': +drivers/crypto/fsl/fsl_hash.c:151:30: error: left shift count >= width of type [-Werror=shift-count-overflow] + 151 | addr = (addr << 32) | sec_in32(&ctx->sg_tbl[i].addr_lo); + | ^~ +cc1: all warnings being treated as errors And well, compiler is right... Best regards, Stefano Babic > Regards > Gaurav Jain > >> -----Original Message----- >> From: Stefano Babic >> Sent: Wednesday, June 29, 2022 12:51 PM >> To: Gaurav Jain ; Stefano Babic ; >> Fabio Estevam >> Cc: U-Boot-Denx ; Peng Fan ; dl- >> uboot-imx ; Horia Geanta ; >> Varun Sethi ; Ye Li >> Subject: Re: [EXT] Re: [PATCH v3] crypto/fsl: fsl_rsa: Fix dcache issue in the >> driver >> >> Caution: EXT Email >> >> Hi Gaurav, >> >> On 29.06.22 09:06, Gaurav Jain wrote: >>> Hi Stefano >>> >>> This patch is put into state "changes requested". >>> But it is a different patch in fsl_rsa. >>> There is no change requested with this patch. >>> >> >> Something went wrong - I have applied this patch to push to 2022.07, but in CI I >> get the same errors I found before, that is PowerPC build was >> broken: >> >> >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource.d >> enx.de%2Fu-boot%2Fcustodians%2Fu-boot-imx%2F- >> %2Fjobs%2F457090&data=05%7C01%7Cgaurav.jain%40nxp.com%7C98808 >> 23b97ef4669f51108da599feffc%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0 >> %7C0%7C637920840703403368%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4 >> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C >> %7C%7C&sdata=FGDL9eBnjyUDc423myN4jVoK7QD9VZiitvZao6mz04s%3D >> &reserved=0 >> >> I hadn't time to check this, and I suppose that issue is not yet fixed and I drop the >> patch from MR (Layerscape is broken, too), that is V3 has not fixed CI as in V2. >> Or is there anothe rpatch I had to pick up ? >> >> Best regards, >> Stefano >> >> >> >>> Regards >>> Gaurav Jain >>> >>>> -----Original Message----- >>>> From: Stefano Babic >>>> Sent: Wednesday, June 15, 2022 6:20 PM >>>> To: Gaurav Jain ; Fabio Estevam >>>> >>>> Cc: U-Boot-Denx ; Peng Fan ; >>>> dl- uboot-imx ; Horia Geanta >>>> ; Varun Sethi ; Ye Li >>>> >>>> Subject: Re: [EXT] Re: [PATCH v3] crypto/fsl: fsl_rsa: Fix dcache >>>> issue in the driver >>>> >>>> Caution: EXT Email >>>> >>>> On 15.06.22 14:45, Gaurav Jain wrote: >>>>> Hi Fabio >>>>> >>>>>> -----Original Message----- >>>>>> From: Fabio Estevam >>>>>> Sent: Wednesday, June 15, 2022 6:11 PM >>>>>> To: Gaurav Jain >>>>>> Cc: U-Boot-Denx ; Stefano Babic >>>>>> ; Peng Fan ; dl-uboot-imx >>>>>> ; Horia Geanta ; Varun >>>>>> Sethi ; Ye Li >>>>>> Subject: [EXT] Re: [PATCH v3] crypto/fsl: fsl_rsa: Fix dcache issue >>>>>> in the driver >>>>>> >>>>>> Caution: EXT Email >>>>>> >>>>>> Hi Gaurav, >>>>>> >>>>>> On Wed, Jun 15, 2022 at 9:35 AM Gaurav Jain >> wrote: >>>>>>> >>>>>>> From: Ye Li >>>>>>> >>>>>>> issue: >>>>>>> CAAM fails with key error when perform Modular Exponentiation >>>>>>> using PKHA Block in CAAM >>>>>>> >>>>>>> Fix: >>>>>>> add flush and invalidate dcache for keys, signature and output >>>>>>> decrypted data processed by CAAM. >>>>>>> >>>>>>> Fixes: 34276478f7 (DM: crypto/fsl - Add Freescale rsa DM driver) >>>>>>> Signed-off-by: Ye Li >>>>>>> Reviewed-by: Gaurav Jain >>>>>>> Acked-by: Peng Fan >>>>>>> --- >>>>>> >>>>>> Please always explain what changed in the current version of the patch. >>>>>> >>>>>> I assume you fixed the build error found in CI, correct? >>>>> >>>>> This is a different patch in fsl_rsa.c I will send a different patch >>>>> for the error reported by you. >>>> >>>> Ouch...I have misunderstood. Well, then I willwait for your patch.. >>>> >>>> Regards, >>>> Stefano >>>> >>>>> >>>>> Regards >>>>> Gaurav Jain >> >> >> -- >> ================================================================= >> ==== >> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk >> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany >> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de >> ================================================================= >> ==== -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de =====================================================================