[EXT] Re: [PATCH v3] crypto/fsl: fsl_rsa: Fix dcache issue in the driver

Gaurav Jain gaurav.jain at nxp.com
Fri Jul 29 12:11:53 CEST 2022


Hello Stefano

> -----Original Message-----
> From: Stefano Babic <sbabic at denx.de>
> Sent: Tuesday, July 26, 2022 2:55 PM
> To: Gaurav Jain <gaurav.jain at nxp.com>; Stefano Babic <sbabic at denx.de>;
> Fabio Estevam <festevam at gmail.com>
> Cc: U-Boot-Denx <u-boot at lists.denx.de>; Peng Fan <peng.fan at nxp.com>; dl-
> uboot-imx <uboot-imx at nxp.com>; Horia Geanta <horia.geanta at nxp.com>;
> Varun Sethi <V.Sethi at nxp.com>; Ye Li <ye.li at nxp.com>
> 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 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
> > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch
> > work.ozlabs.org%2Fproject%2Fuboot%2Fpatch%2F20220616101009.809953-
> 1-ga
> >
> urav.jain%40nxp.com%2F&data=05%7C01%7Cgaurav.jain%40nxp.com%7C
> b605
> >
> e737d37a4237e8ba08da6ee8bf00%7C686ea1d3bc2b4c6fa92cd99c5c301635%7
> C0%7C
> >
> 0%7C637944243170612332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> wMDAiLCJ
> >
> QIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&s
> data=
> >
> KUAaTlucw6GRG7W2QvlE0JMO%2FAJt0tmi7%2FM3ZcpZ6C0%3D&reserved
> =0
> >
> 
> 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...
I have sent a V4 which fixes the error for powerpc platforms.

Thanks
Gaurav Jain
> 
> Best regards,
> Stefano Babic
> 
> 
> > Regards
> > Gaurav Jain
> >
> >> -----Original Message-----
> >> From: Stefano Babic <sbabic at denx.de>
> >> Sent: Wednesday, June 29, 2022 12:51 PM
> >> To: Gaurav Jain <gaurav.jain at nxp.com>; Stefano Babic
> >> <sbabic at denx.de>; Fabio Estevam <festevam at gmail.com>
> >> Cc: U-Boot-Denx <u-boot at lists.denx.de>; Peng Fan <peng.fan at nxp.com>;
> >> dl- uboot-imx <uboot-imx at nxp.com>; Horia Geanta
> >> <horia.geanta at nxp.com>; Varun Sethi <V.Sethi at nxp.com>; Ye Li
> >> <ye.li at nxp.com>
> >> 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%2Fsou
> >>
> rce.d%2F&data=05%7C01%7Cgaurav.jain%40nxp.com%7Cb605e737d37a4
> 237e
> >>
> 8ba08da6ee8bf00%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637
> 94424
> >>
> 3170612332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoi
> V2luMz
> >>
> IiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uDXXo
> PFq2y
> >> L0RyoaEyrMCUFYCQ5M5CfwN6XQG6eM4DE%3D&reserved=0
> >> enx.de%2Fu-boot%2Fcustodians%2Fu-boot-imx%2F-
> >> %2Fjobs%2F457090&data=05%7C01%7Cgaurav.jain%40nxp.com%7C98
> 808
> >>
> 23b97ef4669f51108da599feffc%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0
> >> %7C0%7C637920840703403368%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
> C4
> >>
> 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 <sbabic at denx.de>
> >>>> Sent: Wednesday, June 15, 2022 6:20 PM
> >>>> To: Gaurav Jain <gaurav.jain at nxp.com>; Fabio Estevam
> >>>> <festevam at gmail.com>
> >>>> Cc: U-Boot-Denx <u-boot at lists.denx.de>; Peng Fan
> >>>> <peng.fan at nxp.com>;
> >>>> dl- uboot-imx <uboot-imx at nxp.com>; Horia Geanta
> >>>> <horia.geanta at nxp.com>; Varun Sethi <V.Sethi at nxp.com>; Ye Li
> >>>> <ye.li at nxp.com>
> >>>> 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 <festevam at gmail.com>
> >>>>>> Sent: Wednesday, June 15, 2022 6:11 PM
> >>>>>> To: Gaurav Jain <gaurav.jain at nxp.com>
> >>>>>> Cc: U-Boot-Denx <u-boot at lists.denx.de>; Stefano Babic
> >>>>>> <sbabic at denx.de>; Peng Fan <peng.fan at nxp.com>; dl-uboot-imx
> >>>>>> <uboot-imx at nxp.com>; Horia Geanta <horia.geanta at nxp.com>; Varun
> >>>>>> Sethi <V.Sethi at nxp.com>; Ye Li <ye.li at nxp.com>
> >>>>>> 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 <gaurav.jain at nxp.com>
> >> wrote:
> >>>>>>>
> >>>>>>> From: Ye Li <ye.li at nxp.com>
> >>>>>>>
> >>>>>>> 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 <ye.li at nxp.com>
> >>>>>>> Reviewed-by: Gaurav Jain <gaurav.jain at nxp.com>
> >>>>>>> Acked-by: Peng Fan <peng.fan at nxp.com>
> >>>>>>> ---
> >>>>>>
> >>>>>> 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 at 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 at denx.de
> =================================================================
> ====


More information about the U-Boot mailing list