Re: [PATCH] crypto: sa2ul: Fix DMA mapping API usage

2020-09-23 Thread Peter Ujfalusi
On 23/09/2020 9.02, Christoph Hellwig wrote: > On Mon, Sep 21, 2020 at 02:38:46PM +0300, Peter Ujfalusi wrote: >> Make sure that we call the dma_unmap_sg on the correct scatterlist on >> completion with the correct sg_nents. >> >> We also should be calling dma_sync_sg_for_device() on the tx buff

[PATCH v2] crypto: sa2ul: Fix DMA mapping API usage

2020-09-23 Thread Peter Ujfalusi
Make sure that we call the dma_unmap_sg on the correct scatterlist on completion with the correct sg_nents. Use sg_table to managed the DMA mapping and at the same time add the needed dma_sync calls for the sg_table. Signed-off-by: Peter Ujfalusi --- Hi, Changes since v1: - use sg_table to mana

Re: [PATCH] crypto: x86/aesni - implement accelerated CBCMAC, CMAC and XCBC shashes

2020-09-23 Thread Ben Greear
On 8/4/20 12:45 PM, Ben Greear wrote: On 8/4/20 6:08 AM, Ard Biesheuvel wrote: On Tue, 4 Aug 2020 at 15:01, Ben Greear wrote: On 8/4/20 5:55 AM, Ard Biesheuvel wrote: On Mon, 3 Aug 2020 at 21:11, Ben Greear wrote: Hello, This helps a bit...now download sw-crypt performance is about 150Mb

Re: [PATCH v3 00/10] crypto: caam - xts(aes) updates

2020-09-23 Thread Horia Geantă
On 9/22/2020 7:03 PM, Andrei Botila (OSS) wrote: > From: Andrei Botila > > This patch series fixes some problems in CAAM's implementation of xts(aes): > - CAAM until Era 9 can't process XTS with 16B IV > - CAAM can only process in hardware XTS key lengths of 16B and 32B > - These hardware limi

Re: [PATCH v2 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-23 Thread Arnd Bergmann
On Sun, Sep 20, 2020 at 8:37 PM Corentin Labbe wrote: > > Ciphers produce invalid results on BE. > Key and IV need to be written in LE. > > Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System > crypto accelerator") > Cc: > Signed-off-by: Corentin Labbe > --- > drivers/crypt

Re: [PATCH v2 3/9] lib: zstd: Upgrade to latest upstream zstd version 1.4.6

2020-09-23 Thread kernel test robot
Hi Nick, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on kdave/for-next] [also build test WARNING on f2fs/dev-test linus/master v5.9-rc6 next-20200923] [cannot apply to cryptodev/master crypto/master] [If your patch is applied to the wrong git tree, kindly drop

Re: [PATCH v2 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-23 Thread LABBE Corentin
On Wed, Sep 23, 2020 at 04:00:32PM +0200, Arnd Bergmann wrote: > On Sun, Sep 20, 2020 at 8:37 PM Corentin Labbe wrote: > > > > Ciphers produce invalid results on BE. > > Key and IV need to be written in LE. > > > > Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System > > crypto

[PATCH 2/2] crypto: xor - use ktime for template benchmarking

2020-09-23 Thread Ard Biesheuvel
Currently, we use the jiffies counter as a time source, by staring at it until a HZ period elapses, and then staring at it again and perform as many XOR operations as we can at the same time until another HZ period elapses, so that we can calculate the throughput. This takes longer than necessary,

[PATCH 0/2] crypto: xor - defer and optimize boot time benchmark

2020-09-23 Thread Ard Biesheuvel
Doug reports [0] that the XOR boot time benchmark takes more time than necessary, and runs at a time when there is little room for other boot time tasks to run concurrently. Let's fix this by #1 deferring the benchmark, and #2 uses a faster implementation. [0] https://lore.kernel.org/linux-arm-k

[PATCH 1/2] crypto: xor - defer load time benchmark to a later time

2020-09-23 Thread Ard Biesheuvel
Currently, the XOR module performs its boot time benchmark at core initcall time when it is built-in, to ensure that the RAID code can make use of it when it is built-in as well. Let's defer this to a later stage during the boot, to avoid impacting the overall boot time of the system. Instead, jus

Re: [PATCH v2 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-23 Thread Arnd Bergmann
On Wed, Sep 23, 2020 at 8:08 PM LABBE Corentin wrote: > On Wed, Sep 23, 2020 at 04:00:32PM +0200, Arnd Bergmann wrote: > > On Sun, Sep 20, 2020 at 8:37 PM Corentin Labbe wrote: > > > diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c > > > b/drivers/crypto/allwinner/sun4i-ss/sun4i-

[PATCH v1] hw_random: npcm: modify readl to readb

2020-09-23 Thread Tomer Maimon
Modify the read size to the correct HW random registers size, 8bit. The incorrect read size caused and faulty HW random value. Signed-off-by: Tomer Maimon --- drivers/char/hw_random/npcm-rng.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/char/hw_rand

[PATCH v3 1/9] lib: zstd: Add zstd compatibility wrapper

2020-09-23 Thread Nick Terrell
From: Nick Terrell Adds zstd_compat.h which provides the necessary functions from the current zstd.h API. It is only active for zstd versions 1.4.6 and newer. That means it is disabled currently, but will become active when a later patch in this series updates the zstd library in the kernel to 1.

[PATCH v3 0/9] Update to zstd-1.4.6

2020-09-23 Thread Nick Terrell
From: Nick Terrell This patchset upgrades the zstd library to the latest upstream release. The current zstd version in the kernel is a modified version of upstream zstd-1.3.1. At the time it was integrated, zstd wasn't ready to be used in the kernel as-is. But, it is now possible to use upstream

[PATCH v3 2/9] lib: zstd: Add decompress_sources.h for decompress_unzstd

2020-09-23 Thread Nick Terrell
From: Nick Terrell Adds decompress_sources.h which includes every .c file necessary for zstd decompression. This is used in decompress_unzstd.c so the internal structure of the library isn't exposed. This allows us to upgrade the zstd library version without modifying any callers. Instead we jus

[PATCH v3 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-23 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- fs/btrfs/zstd.c | 48 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/fs/btr

[PATCH v3 4/9] crypto: zstd: Switch to zstd-1.4.6 API

2020-09-23 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- crypto/zstd.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/crypto/zstd.c b/crypto/zstd.c in

[PATCH v3 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-23 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is more efficient because it uses the single-pass API instead of the streaming API. The streaming API is not necessary because the whole input and output buffers are available. This saves memory because w

[PATCH v3 8/9] lib: unzstd: Switch to the zstd-1.4.6 API

2020-09-23 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- lib/decompress_unzstd.c | 40 ++-- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/lib/de

[PATCH v3 7/9] squashfs: zstd: Switch to the zstd-1.4.6 API

2020-09-23 Thread Nick Terrell
From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- fs/squashfs/zstd_wrapper.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/squashfs/zstd_wrapper.c b/fs/squas

[PATCH v3 9/9] lib: zstd: Remove zstd compatibility wrapper

2020-09-23 Thread Nick Terrell
From: Nick Terrell All callers have been transitioned to the new zstd-1.4.6 API. There are no more callers of the zstd compatibility wrapper, so delete it. Signed-off-by: Nick Terrell --- include/linux/zstd_compat.h | 116 1 file changed, 116 deletions(-)

Re: [PATCH 2/2] crypto: xor - use ktime for template benchmarking

2020-09-23 Thread Doug Anderson
Hi, On Wed, Sep 23, 2020 at 11:22 AM Ard Biesheuvel wrote: > > Currently, we use the jiffies counter as a time source, by staring at > it until a HZ period elapses, and then staring at it again and perform > as many XOR operations as we can at the same time until another HZ > period elapses, so t

Re: [PATCH 1/2] crypto: xor - defer load time benchmark to a later time

2020-09-23 Thread Doug Anderson
Hi, On Wed, Sep 23, 2020 at 11:22 AM Ard Biesheuvel wrote: > > Currently, the XOR module performs its boot time benchmark at core > initcall time when it is built-in, to ensure that the RAID code can > make use of it when it is built-in as well. > > Let's defer this to a later stage during the bo

Re: [PATCH v3 3/9] lib: zstd: Upgrade to latest upstream zstd version 1.4.6

2020-09-23 Thread kernel test robot
Hi Nick, Thank you for the patch! Yet something to improve: [auto build test ERROR on kdave/for-next] [also build test ERROR on f2fs/dev-test linus/master v5.9-rc6 next-20200923] [cannot apply to cryptodev/master crypto/master] [If your patch is applied to the wrong git tree, kindly drop us a

Re: [PATCH v3 3/9] lib: zstd: Upgrade to latest upstream zstd version 1.4.6

2020-09-23 Thread Nick Terrell
On Wed, Sep 23, 2020 at 7:28 PM kernel test robot wrote: > > Hi Nick, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on kdave/for-next] > [also build test ERROR on f2fs/dev-test linus/master v5.9-rc6 next-20200923] > [cannot apply to

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-09-23 Thread Herbert Xu
On Mon, Sep 14, 2020 at 12:40:58PM +0200, Corentin Labbe wrote: > > I got this on next-20200910/multi_v7_defconfig BigEndian > [ 12.137856] alg: hash: skipping comparison tests for md5-sun4i-ss because > md5-generic is unavailable > md5-sun4i-ss md5 reqs=763 > [ 98.286632] alg: ahash: md5 test

Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-23 Thread Herbert Xu
On Fri, Sep 18, 2020 at 08:21:44AM +, Van Leeuwen, Pascal wrote: > > > Can this alignment exceed ARCH_DMA_MINALIGN? If not then the > > macro CRYPTO_MINALIGN should cover it. > > I don't know. I'm not familiar with that macro and I have not been able to > dig up any > clear description on what

[PATCH] crypto: x86/poly1305 - Remove assignments with no effect

2020-09-23 Thread Herbert Xu
On Mon, Sep 21, 2020 at 04:56:52PM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: eb5f95f1593f7c22dac681b19e815828e2af3efd > commit: d7d7b853566254648df59f7ea27ea05952a6cfa8 crypto: x86/poly1305 - wire > up faster im

Re: [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro

2020-09-23 Thread Giovanni Cabiddu
On Wed, Sep 16, 2020 at 03:50:17AM +0100, Liu Shixin wrote: > Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Liu Shixin Acked-by: Giovanni Cabiddu > --- > drivers/crypto/qat/qat_common/adf_cfg.c | 19 + > .../qat/qat_common/adf_transport_debug.c | 4

Re: [PATCH -next] crypto: qat - remove unnecessary mutex_init()

2020-09-23 Thread Giovanni Cabiddu
On Wed, Sep 16, 2020 at 07:21:21AM +0100, Qinglang Miao wrote: > The mutex adf_ctl_lock is initialized statically. It is > unnecessary to initialize by mutex_init(). > > Signed-off-by: Qinglang Miao Acked-by: Giovanni Cabiddu > --- > drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 -- > 1 fil