]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00215945-1: Rework scatterlist handling for bi-endian platforms
authorSteve Cornelius <steve.cornelius@freescale.com>
Thu, 5 Jul 2012 23:41:29 +0000 (16:41 -0700)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:12:26 +0000 (14:12 +0200)
commit78b430d6a1d398f20e3ea21f194bf8406a7b0afa
tree6535b02a832fff5fff74661c65839754faebba44
parenta2574e4d24137b2e8bbc3c3135dc0c4eb19ea8a4
ENGR00215945-1: Rework scatterlist handling for bi-endian platforms

Former versions of this (ARM) branch of this driver reworked the hardware-
readable scatter/gather list to operate as a set of 32-bit integers,
rather than a packed structure of smaller sizes, which cannot burst-read
correctly on a little-endian platform.

Integration of caamhash.c revealed subtle ways in which the ordering of
items written to a hardware s/g list could create bugs, such as the
"final" bit being written to an entry that would later be updated with
a size, inadvertently erasing the bit (e.g. such as sg_to_sec4_sg_last()
before sg_to_sec4_sg()).

Since fields must be ORed in to operate correctly using any order of
operations, changed allocations of the combination of extended descriptor
structs + hardware scatterlists to use kzalloc() instead of kmalloc(), so
as to ensure that residue data would not be ORed in with the correct data.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamhash.c
drivers/crypto/caam/sg_sw_sec4.h