[Patch v8 3/4] KEYS: trusted: Create trusted keys subsystem

2019-10-15 Thread Sumit Garg
Move existing code to trusted keys subsystem. Also, rename files with "tpm" as suffix which provides the underlying implementation. Suggested-by: Jarkko Sakkinen Signed-off-by: Sumit Garg Reviewed-by: Jarkko Sakkinen --- crypto/asymmetric_keys/asym_tpm.c| 2 +- include/

[Patch v8 2/4] KEYS: Use common tpm_buf for trusted and asymmetric keys

2019-10-15 Thread Sumit Garg
Switch to utilize common heap based tpm_buf code for TPM based trusted and asymmetric keys rather than using stack based tpm1_buf code. Also, remove tpm1_buf code. Suggested-by: Jarkko Sakkinen Signed-off-by: Sumit Garg Reviewed-by: Jarkko Sakkinen Reviewed-by: Jerry Snitselaar --- crypto/asy

[Patch v8 4/4] KEYS: trusted: Move TPM2 trusted keys code

2019-10-15 Thread Sumit Garg
Move TPM2 trusted keys code to trusted keys subsystem. The reason being it's better to consolidate all the trusted keys code to a single location so that it can be maintained sanely. Also, utilize existing tpm_send() exported API which wraps the internal tpm_transmit_cmd() API. Suggested-by: Jark

[Patch v8 1/4] tpm: Move tpm_buf code to include/linux/

2019-10-15 Thread Sumit Garg
Move tpm_buf code to common include/linux/tpm.h header so that it can be reused via other subsystems like trusted keys etc. Also rename trusted keys and asymmetric keys usage of TPM 1.x buffer implementation to tpm1_buf to avoid any compilation errors. Suggested-by: Jarkko Sakkinen Signed-off-by

[Patch v8 0/4] Create and consolidate trusted keys subsystem

2019-10-15 Thread Sumit Garg
This patch-set does restructuring of trusted keys code to create and consolidate trusted keys subsystem. Also, patch #2 replaces tpm1_buf code used in security/keys/trusted.c and crypto/asymmertic_keys/asym_tpm.c files to use the common tpm_buf code. Changes in v8: 1. Rebased to latest tpmdd/mast

Re: [PATCH] drivers,crypto/cavium: Fix barrier barrier usage after atomic_set()

2019-10-15 Thread Herbert Xu
On Tue, Oct 15, 2019 at 09:16:57AM -0700, Davidlohr Bueso wrote: > Because it is not a Rmw operation, atomic_set() is not serialized, > and therefore the 'upgradable' smp_mb__after_atomic() call after > the atomic_set() is completely bogus (not to mention the comment > could also use some love, but

Re: [PATCH] crypto: hisilicon: Fix misuse of GENMASK macro

2019-10-15 Thread Xu Zaibo
Agree with you, thanks! Zaibo . On 2019/10/16 4:13, Rikard Falkeborn wrote: Arguments are supposed to be ordered high then low. Fixes: c8b4b477079d ("crypto: hisilicon - add HiSilicon HPRE accelerator") Signed-off-by: Rikard Falkeborn --- Spotted when trying to introduce compile time checkin

[PATCH] crypto: hisilicon: Fix misuse of GENMASK macro

2019-10-15 Thread Rikard Falkeborn
Arguments are supposed to be ordered high then low. Fixes: c8b4b477079d ("crypto: hisilicon - add HiSilicon HPRE accelerator") Signed-off-by: Rikard Falkeborn --- Spotted when trying to introduce compile time checking that the order of the arguments to GENMASK are correct [0]. I have only compile

Re: [PATCH 05/25] crypto: omap - switch to skcipher API

2019-10-15 Thread Tony Lindgren
* Ard Biesheuvel [191014 12:20]: > Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") > dated 20 august 2015 introduced the new skcipher API which is supposed to > replace both blkcipher and ablkcipher. While all consumers of the API have > been converted long ago, some pr

Re: [RFT PATCH 0/3] crypto: sparc - convert to skcipher API

2019-10-15 Thread Eric Biggers
On Tue, Oct 15, 2019 at 01:11:38AM -0700, Christoph Hellwig wrote: > On Fri, Oct 11, 2019 at 09:38:47PM -0700, Eric Biggers wrote: > > This series converts the glue code for the SPARC64 crypto opcodes > > implementations of AES, Camellia, DES, and 3DES modes from the > > deprecated "blkcipher" API

[PATCH] drivers,crypto/cavium: Fix barrier barrier usage after atomic_set()

2019-10-15 Thread Davidlohr Bueso
Because it is not a Rmw operation, atomic_set() is not serialized, and therefore the 'upgradable' smp_mb__after_atomic() call after the atomic_set() is completely bogus (not to mention the comment could also use some love, but that's a different matter). This patch replaces these with smp_mb(), wh

Re: [PATCH] hwrng: omap3-rom fix pointer warning for omap3_rom_rng_idle

2019-10-15 Thread Arnd Bergmann
On Tue, Oct 15, 2019 at 2:27 PM Ben Dooks wrote: > > The omap3_rom_rng_idle function takes a pointer, so give > it a pointer instead of a plain 0. This fixes the following > sparse warning: > > drivers/char/hw_random/omap3-rom-rng.c:115:28: warning: Using plain integer > as NULL pointer > > Signe

Re: [PATCH] hwrng: ka-sa - fix __iomem on registers

2019-10-15 Thread Arnd Bergmann
On Tue, Oct 15, 2019 at 2:36 PM Ben Dooks wrote: > > Add __ioemm attribute to reg_rng to fix the following > sparse warnings: > > drivers/char/hw_random/ks-sa-rng.c:102:9: warning: incorrect type in argument > 2 (different address spaces) > drivers/char/hw_random/ks-sa-rng.c:102:9:expected vo

[PATCH] hwrng: ka-sa - fix __iomem on registers

2019-10-15 Thread Ben Dooks
Add __ioemm attribute to reg_rng to fix the following sparse warnings: drivers/char/hw_random/ks-sa-rng.c:102:9: warning: incorrect type in argument 2 (different address spaces) drivers/char/hw_random/ks-sa-rng.c:102:9:expected void volatile [noderef] *addr drivers/char/hw_random/ks-sa-rng.

[PATCH] hwrng: omap3-rom fix pointer warning for omap3_rom_rng_idle

2019-10-15 Thread Ben Dooks
The omap3_rom_rng_idle function takes a pointer, so give it a pointer instead of a plain 0. This fixes the following sparse warning: drivers/char/hw_random/omap3-rom-rng.c:115:28: warning: Using plain integer as NULL pointer Signed-off-by: Ben Dooks --- Cc: Arnd Bergmann Cc: Greg Kroah-Hartman

Re: [RFT PATCH 2/3] crypto: s390/paes - convert to skcipher API

2019-10-15 Thread Harald Freudenberger
On 12.10.19 22:18, Eric Biggers wrote: > From: Eric Biggers > > Convert the glue code for the S390 CPACF protected key implementations > of AES-ECB, AES-CBC, AES-XTS, and AES-CTR from the deprecated > "blkcipher" API to the "skcipher" API. This is needed in order for the > blkcipher API to be rem

Re: [RFT PATCH 1/3] crypto: s390/aes - convert to skcipher API

2019-10-15 Thread Harald Freudenberger
On 12.10.19 22:18, Eric Biggers wrote: > From: Eric Biggers > > Convert the glue code for the S390 CPACF implementations of AES-ECB, > AES-CBC, AES-XTS, and AES-CTR from the deprecated "blkcipher" API to the > "skcipher" API. This is needed in order for the blkcipher API to be > removed. > > Note

[PATCH] crypto: amlogic: fix devm_platform_ioremap_resource.cocci warnings

2019-10-15 Thread Julia Lawall
From: kbuild test robot drivers/crypto/amlogic/amlogic-gxl-core.c:241:1-9: WARNING: Use devm_platform_ioremap_resource for mc -> base Use devm_platform_ioremap_resource helper which wraps platform_get_resource() and devm_ioremap_resource() together. Generated by: scripts/coccinelle/api/devm_

Re: [PATCH v2 0/3] crypto: powerpc - convert SPE AES algorithms to skcipher API

2019-10-15 Thread Ard Biesheuvel
On Tue, 15 Oct 2019 at 04:45, Eric Biggers wrote: > > This series converts the glue code for the PowerPC SPE implementations > of AES-ECB, AES-CBC, AES-CTR, and AES-XTS from the deprecated > "blkcipher" API to the "skcipher" API. This is needed in order for the > blkcipher API to be removed. > >

Re: [PATCH 08/25] crypto: atmel-aes - switch to skcipher API

2019-10-15 Thread Ard Biesheuvel
On Tue, 15 Oct 2019 at 12:17, wrote: > > Hi, Ard, > > Thanks for working on this. > > On 10/14/2019 03:18 PM, Ard Biesheuvel wrote: > > Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") > > dated 20 august 2015 introduced the new skcipher API which is supposed to > > repl

Re: [PATCH 08/25] crypto: atmel-aes - switch to skcipher API

2019-10-15 Thread Tudor.Ambarus
Hi, Ard, Thanks for working on this. On 10/14/2019 03:18 PM, Ard Biesheuvel wrote: > Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") > dated 20 august 2015 introduced the new skcipher API which is supposed to > replace both blkcipher and ablkcipher. While all consumers

Re: [RFT PATCH 3/3] crypto: s390/des - convert to skcipher API

2019-10-15 Thread Harald Freudenberger
On 12.10.19 22:18, Eric Biggers wrote: > From: Eric Biggers > > Convert the glue code for the S390 CPACF implementations of DES-ECB, > DES-CBC, DES-CTR, 3DES-ECB, 3DES-CBC, and 3DES-CTR from the deprecated > "blkcipher" API to the "skcipher" API. This is needed in order for the > blkcipher API to

Re: [PATCH v3 02/29] crypto: x86/chacha - depend on generic chacha library instead of crypto driver

2019-10-15 Thread Ard Biesheuvel
On Tue, 15 Oct 2019 at 12:00, Martin Willi wrote: > > Hi Ard, > > > Since turning the FPU on and off is cheap these days, simplify the > > SIMD routine by dropping the per-page yield, which makes for a > > cleaner switch to the library API as well. > > In my measurements that lazy FPU restore work

Re: [PATCH v3 02/29] crypto: x86/chacha - depend on generic chacha library instead of crypto driver

2019-10-15 Thread Martin Willi
Hi Ard, > Since turning the FPU on and off is cheap these days, simplify the > SIMD routine by dropping the per-page yield, which makes for a > cleaner switch to the library API as well. In my measurements that lazy FPU restore works as intended, and I could not identify any slowdown by this chan

Re: [Patch v7 0/4] Create and consolidate trusted keys subsystem

2019-10-15 Thread Sumit Garg
On Tue, 15 Oct 2019 at 01:46, Jarkko Sakkinen wrote: > > On Fri, Oct 11, 2019 at 02:05:17PM -0700, Jerry Snitselaar wrote: > > On Fri Oct 11 19, Jarkko Sakkinen wrote: > > > On Mon, Oct 07, 2019 at 10:55:31AM +0530, Sumit Garg wrote: > > > > This patch-set does restructuring of trusted keys code t

Re: [Patch v7 0/4] Create and consolidate trusted keys subsystem

2019-10-15 Thread Sumit Garg
On Tue, 15 Oct 2019 at 01:04, Jarkko Sakkinen wrote: > > On Fri, Oct 11, 2019 at 03:37:57PM +0300, Jarkko Sakkinen wrote: > > On Mon, Oct 07, 2019 at 10:55:31AM +0530, Sumit Garg wrote: > > > This patch-set does restructuring of trusted keys code to create and > > > consolidate trusted keys subsys

[PATCH] crypto: powerpc/spe-xts - implement support for ciphertext stealing

2019-10-15 Thread Ard Biesheuvel
Add the logic to deal with input sizes that are not a round multiple of the AES block size, as described by the XTS spec. This brings the SPE implementation in line with other kernel drivers that have been updated recently to take this into account. Cc: Eric Biggers Signed-off-by: Ard Biesheuvel

Re: [RFT PATCH 0/3] crypto: sparc - convert to skcipher API

2019-10-15 Thread Christoph Hellwig
On Fri, Oct 11, 2019 at 09:38:47PM -0700, Eric Biggers wrote: > This series converts the glue code for the SPARC64 crypto opcodes > implementations of AES, Camellia, DES, and 3DES modes from the > deprecated "blkcipher" API to the "skcipher" API. This is needed in > order for the blkcipher API to