[U-Boot] [PATCH v3] crypto/fsl: fix BLOB encapsulation and decapsulation

Sumit Garg sumit.garg at nxp.com
Mon Jan 8 04:12:56 UTC 2018


> -----Original Message-----
> From: Clemens Gruber [mailto:clemens.gruber at pqgruber.com]
> Sent: Monday, January 08, 2018 12:56 AM
> To: York Sun <york.sun at nxp.com>
> Cc: u-boot at lists.denx.de; Fabio Estevam <fabio.estevam at nxp.com>; Tom Rini
> <trini at konsulko.com>; Vini Pillai <vinitha.pillai at nxp.com>; Ruchika Gupta
> <ruchika.gupta at nxp.com>; Breno Matheus Lima <breno.lima at nxp.com>;
> Fabio Estevam <festevam at gmail.com>; Sumit Garg <sumit.garg at nxp.com>;
> Arun Pathak <arun.pathak at nxp.com>; Jaiprakash Singh
> <jaiprakash.singh at nxp.com>; Clemens Gruber
> <clemens.gruber at pqgruber.com>
> Subject: [PATCH v3] crypto/fsl: fix BLOB encapsulation and decapsulation
> 
> The blob_encap and blob_decap functions were not flushing the dcache
> before passing data to CAAM/DMA and not invalidating the dcache when
> getting data back.
> Therefore, blob encapsulation and decapsulation failed with errors like the
> following due to data cache incoherency:
> "40000006: DECO: desc idx 0: Invalid KEY command"
> 
> To ensure coherency, we require the key_mod, src and dst buffers to be
> aligned to the cache line size and flush/invalidate the memory regions.
> The same requirements apply to the job descriptor.
> 
> Tested on an i.MX6Q board.
> 
> Signed-off-by: Clemens Gruber <clemens.gruber at pqgruber.com>
> ---
> 
> Changes since v2:
> - Removed copying to aligned buffers and require addresses to be aligned
> - Added function comments and notes about the alignment requirements
> - Added parentheses around BLOB_SIZE macro parameter x
> - Adapted commit text
> 
> Changes since v1:
> - Moved BLOB_SIZE define to be available for all platforms (Fabio)
> 

Reviewed-by: Sumit Garg <sumit.garg at nxp.com>


More information about the U-Boot mailing list