<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/crypto/caam/caamhash.c, branch linux-5.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-06-20T06:18:33Z</updated>
<entry>
<title>crypto: caam - use len instead of nents for bulding HW S/G table</title>
<updated>2019-06-20T06:18:33Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-06-10T13:30:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=059d73eea6409873446a858dd64a5bec9bf68b70'/>
<id>urn:sha1:059d73eea6409873446a858dd64a5bec9bf68b70</id>
<content type='text'>
Currently, conversion of SW S/G table into HW S/G layout relies on
nents returned by sg_nents_for_len(sg, len).
However this leaves the possibility of HW S/G referencing more data
then needed: since buffer length in HW S/G entries is filled using
sg_dma_len(sg), the last entry in HW S/G table might have a length
that is bigger than needed for the crypto request.

This way of S/G table conversion is fine, unless after converting a table
more entries have to be appended to the HW S/G table.
In this case, crypto engine would access data from the S/G entry having
the incorrect length, instead of advancing in the S/G table.
This situation doesn't exist, but the upcoming implementation of
IV update for skcipher algorithms needs to add a S/G entry after
req-&gt;dst S/G (corresponding to output IV).

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - print debug messages at debug level</title>
<updated>2019-05-30T07:35:45Z</updated>
<author>
<name>Sascha Hauer</name>
</author>
<published>2019-05-23T08:50:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e005503199b9bf1b385949c05897fd6567b5af4'/>
<id>urn:sha1:6e005503199b9bf1b385949c05897fd6567b5af4</id>
<content type='text'>
The CAAM driver used to put its debug messages inside #ifdef DEBUG and
then prints the messages at KERN_ERR level. Replace this with proper
functions printing at KERN_DEBUG level. The #ifdef DEBUG gets
unnecessary when the right functions are used.

This replaces:

- print_hex_dump(KERN_ERR ...) inside #ifdef DEBUG with
  print_hex_dump_debug(...)
- dev_err() inside #ifdef DEBUG with dev_dbg()
- printk(KERN_ERR ...) inside #ifdef DEBUG with dev_dbg()

Some parts of the driver use these functions already, so it is only
consequent to use the debug function consistently.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - remove unused defines</title>
<updated>2019-05-30T07:30:30Z</updated>
<author>
<name>Sascha Hauer</name>
</author>
<published>2019-05-23T08:50:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32f75e67f3457479d79bc5c26b0eb4e2bc150cf0'/>
<id>urn:sha1:32f75e67f3457479d79bc5c26b0eb4e2bc150cf0</id>
<content type='text'>
The CAAM driver defines its own debug() macro, but it is unused. Remove
it.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Reviewed-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - convert top level drivers to libraries</title>
<updated>2019-05-23T06:01:03Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-05-03T14:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b46c90c8e002028dc622bf7bd8cf89efcaab274'/>
<id>urn:sha1:1b46c90c8e002028dc622bf7bd8cf89efcaab274</id>
<content type='text'>
Currently we allow top level code, i.e. that which sits between the
low level (HW-specific) drivers and crypto API, to be built as several
drivers: caamalg, caamhash, caam_pkc, caamrng, caamalg_qi.

There is no advantage in this, more it interferes with adding support
for deferred probing (there are no corresponding devices and thus
no bus).

Convert these drivers and call init() / exit() manually at the right
time.
Move algorithms initialization at JR probe / remove time:
-the first probed JR registers the crypto algs
-the last removed JR unregisters the crypto algs

Note: caam_qi_init() is called before JR platform devices creation
(of_populate_bus()), such that QI interface is initialized when
the caam/qi algorithms are registered in the JR driver (by calling
caam_qi_algapi_init().

While here, fix the Kconfig entries under CRYPTO_DEV_FSL_CAAM_JR
to be aligned.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - fix S/G table passing page boundary</title>
<updated>2019-05-23T06:01:03Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-05-03T14:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5e5c13398f353bb7ebbe913a7bb0c2a77b2ae10'/>
<id>urn:sha1:a5e5c13398f353bb7ebbe913a7bb0c2a77b2ae10</id>
<content type='text'>
According to CAAM RM:
-crypto engine reads 4 S/G entries (64 bytes) at a time,
even if the S/G table has fewer entries
-it's the responsibility of the user / programmer to make sure
this HW behaviour has no side effect

The drivers do not take care of this currently, leading to IOMMU faults
when the S/G table ends close to a page boundary - since only one page
is DMA mapped, while CAAM's DMA engine accesses two pages.

Fix this by rounding up the number of allocated S/G table entries
to a multiple of 4.
Note that in case of two *contiguous* S/G tables, only the last table
might needs extra entries.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - fix copy of next buffer for xcbc and cmac</title>
<updated>2019-03-28T05:54:32Z</updated>
<author>
<name>Iuliana Prodan</name>
</author>
<published>2019-03-22T12:12:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b4e9e931e9bb2f5b302ce66640832f5a3e57e8c4'/>
<id>urn:sha1:b4e9e931e9bb2f5b302ce66640832f5a3e57e8c4</id>
<content type='text'>
Fix a side effect of adding xcbc support, when the next_buffer is not
copied.
The issue occurs, when there is stored from previous state a blocksize
buffer and received, a less than blocksize, from user. In this case, the
nents for req-&gt;src is 0, and the next_buffer is not copied.
An example is:
{
	.tap	= { 17, 15, 8 },
	.psize	= 40,
	.np	= 3,
	.ksize	= 16,
}

Fixes: 12b8567f6fa4 ("crypto: caam - add support for xcbc(aes)")
Signed-off-by: Iuliana Prodan &lt;iuliana.prodan@nxp.com&gt;
Reviewed-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - add missing put_device() call</title>
<updated>2019-03-07T08:24:52Z</updated>
<author>
<name>Wen Yang</name>
</author>
<published>2019-03-01T17:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=00e87449430dc130b43d84bdee71ef94524d9c39'/>
<id>urn:sha1:00e87449430dc130b43d84bdee71ef94524d9c39</id>
<content type='text'>
The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

Fixes: 35af64038623 ("crypto: caam - Check for CAAM block presence before registering with crypto layer")
Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher and authenc algorithms")
Reviewed-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Wen Yang &lt;yellowriver2010@hotmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - generate hash keys in-place</title>
<updated>2019-02-28T06:17:58Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-02-19T14:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=307244452d3de657744712f1208ae89a75707cbc'/>
<id>urn:sha1:307244452d3de657744712f1208ae89a75707cbc</id>
<content type='text'>
When generating a split key or hashing the key, DMA mapping the key
buffers coming directly from user is incorrect, since they are
not guaranteed to be DMAable.

Update driver to first copy user-provided key in the output buffer
("key_out") and then use this buffer for in-place computation
(split key generation, respectively key hashing).

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - fix DMA mapping xcbc key twice</title>
<updated>2019-02-28T06:17:58Z</updated>
<author>
<name>Horia Geantă</name>
</author>
<published>2019-02-19T14:56:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e731ee5e2a5aa37b736c05ee2562e1169af866e'/>
<id>urn:sha1:8e731ee5e2a5aa37b736c05ee2562e1169af866e</id>
<content type='text'>
Fix a side effect of adding xcbc support, which leads to DMA mapping the
key twice.

Fixes: 12b8567f6fa4 ("crypto: caam - add support for xcbc(aes)")
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: caam - fix hash context DMA unmap size</title>
<updated>2019-02-28T06:17:58Z</updated>
<author>
<name>Franck LENORMAND</name>
</author>
<published>2019-02-19T14:56:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65055e2108847af5e577cc7ce6bde45ea136d29a'/>
<id>urn:sha1:65055e2108847af5e577cc7ce6bde45ea136d29a</id>
<content type='text'>
When driver started using state-&gt;caam_ctxt for storing both running hash
and final hash, it was not updated to handle different DMA unmap
lengths.

Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Fixes: c19650d6ea99 ("crypto: caam - fix DMA mapping of stack memory")
Signed-off-by: Franck LENORMAND &lt;franck.lenormand@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
