Re: [PATCH v5 0/7] crypto: rc4 cleanup

2019-06-12 Thread Johannes Berg
On Wed, 2019-06-12 at 18:19 +0200, Ard Biesheuvel wrote: > This is a follow-up to, and supersedes [0], which moved some WEP code from > the cipher to the skcipher interface, in order to reduce the use of the bare > cipher interface in non-crypto subsystem code. > > Since using the skcipher interfa

Re: [PATCH v5 0/7] crypto: rc4 cleanup

2019-06-12 Thread Eric Biggers
On Wed, Jun 12, 2019 at 06:19:52PM +0200, Ard Biesheuvel wrote: > This is a follow-up to, and supersedes [0], which moved some WEP code from > the cipher to the skcipher interface, in order to reduce the use of the bare > cipher interface in non-crypto subsystem code. > > Since using the skcipher

Re: [RFC PATCH 00/20] AES cleanup

2019-06-12 Thread Ard Biesheuvel
On Wed, 12 Jun 2019 at 16:00, Ard Biesheuvel wrote: > > On Wed, 12 Jun 2019 at 15:58, Herbert Xu wrote: > > > > On Wed, Jun 12, 2019 at 02:48:18PM +0200, Ard Biesheuvel wrote: > > > > > > All the patches leading up to that are cleanups for the AES code, to > > > reduce > > > the dependency on th

Re: [PATCH v2 1/4] crypto: caam - do not initialise clocks on the i.MX8

2019-06-12 Thread Andrey Smirnov
On Wed, Jun 12, 2019 at 6:53 AM Leonard Crestez wrote: > > On 07.06.2019 23:03, Andrey Smirnov wrote: > > > There are no clocks that the CAAM driver needs to initialise on the > > i.MX8. > > The clk handling inside CAAM is very convoluted and this patch doesn't > help. All the driver actually does

[PATCH v5 6/7] ppp: mppe: switch to RC4 library interface

2019-06-12 Thread Ard Biesheuvel
The MPPE code uses the sync skcipher to invoke the ecb(arc4) skcipher, of which only a single generic C code implementation exists. This means that going through all the trouble of using scatterlists etc buys us very little, and we're better off just invoking the arc4 library directly. Note that t

[PATCH v5 7/7] fs: cifs: switch to RC4 library interface

2019-06-12 Thread Ard Biesheuvel
The CIFS code uses the sync skcipher API to invoke the ecb(arc4) skcipher, of which only a single generic C code implementation exists. This means that going through all the trouble of using scatterlists etc buys us very little, and we're better off just invoking the arc4 library directly. This al

[PATCH v5 4/7] net/lib80211: move TKIP handling to ARC4 library code

2019-06-12 Thread Ard Biesheuvel
The crypto API abstraction is not very useful for invoking ciphers directly, especially in the case of arc4, which only has a generic implementation in C. So let's invoke the library code directly. Signed-off-by: Ard Biesheuvel --- net/wireless/Kconfig | 1 + net/wireless/lib80211

[PATCH v5 2/7] net/mac80211: move WEP handling to ARC4 library interface

2019-06-12 Thread Ard Biesheuvel
The WEP code in the mac80211 subsystem currently uses the crypto API to access the arc4 (RC4) cipher, which is overly complicated, and doesn't really have an upside in this particular case, since ciphers are always synchronous and therefore always implemented in software. Given that we have no acce

[PATCH v5 3/7] net/lib80211: move WEP handling to ARC4 library code

2019-06-12 Thread Ard Biesheuvel
The crypto API abstraction is not very useful for invoking ciphers directly, especially in the case of arc4, which only has a generic implementation in C. So let's invoke the library code directly. Signed-off-by: Ard Biesheuvel --- net/wireless/Kconfig | 1 + net/wireless/lib80211_

[PATCH v5 5/7] crypto: arc4 - remove cipher implementation

2019-06-12 Thread Ard Biesheuvel
There are no remaining users of the cipher implementation, and there are no meaningful ways in which the arc4 cipher can be combined with templates other than ECB (and the way we do provide that combination is highly dubious to begin with). So let's drop the arc4 cipher altogether, and only keep t

[PATCH v5 1/7] crypto: arc4 - refactor arc4 core code into separate library

2019-06-12 Thread Ard Biesheuvel
Refactor the core rc4 handling so we can move most users to a library interface, permitting us to drop the cipher interface entirely in a future patch. This is part of an effort to simplify the crypto API and improve its robustness against incorrect use. Signed-off-by: Ard Biesheuvel --- MAINTAI

[PATCH v5 0/7] crypto: rc4 cleanup

2019-06-12 Thread Ard Biesheuvel
This is a follow-up to, and supersedes [0], which moved some WEP code from the cipher to the skcipher interface, in order to reduce the use of the bare cipher interface in non-crypto subsystem code. Since using the skcipher interface to invoke the generic C implementation of an algorithm that is k

Re: [PATCH v4 4/7] net/lib80211: move TKIP handling to ARC4 library code

2019-06-12 Thread Ard Biesheuvel
On Wed, 12 Jun 2019 at 17:42, Eric Biggers wrote: > > On Wed, Jun 12, 2019 at 01:09:35AM +0200, Ard Biesheuvel wrote: > > The crypto API abstraction is not very useful for invoking ciphers > > directly, especially in the case of arc4, which only has a generic > > implementation in C. So let's invo

Re: [PATCH v4 4/7] net/lib80211: move TKIP handling to ARC4 library code

2019-06-12 Thread Eric Biggers
On Wed, Jun 12, 2019 at 01:09:35AM +0200, Ard Biesheuvel wrote: > The crypto API abstraction is not very useful for invoking ciphers > directly, especially in the case of arc4, which only has a generic > implementation in C. So let's invoke the library code directly. > > Signed-off-by: Ard Biesheu

Re: [PATCH v3 5/7] crypto: arc4 - remove cipher implementation

2019-06-12 Thread Ard Biesheuvel
On Wed, 12 Jun 2019 at 17:33, Eric Biggers wrote: > > On Tue, Jun 11, 2019 at 10:39:39AM -0700, Eric Biggers wrote: > > > - > > > static struct skcipher_alg arc4_skcipher = { > > > > Similarly this could be renamed from arc4_skcipher to arc4_alg, now that the > > skcipher algorithm doesn't need t

Re: [PATCH v3 5/7] crypto: arc4 - remove cipher implementation

2019-06-12 Thread Eric Biggers
On Tue, Jun 11, 2019 at 10:39:39AM -0700, Eric Biggers wrote: > > - > > static struct skcipher_alg arc4_skcipher = { > > Similarly this could be renamed from arc4_skcipher to arc4_alg, now that the > skcipher algorithm doesn't need to be distinguished from the cipher algorithm. > > > .base.c

Re: [RFC PATCH 02/20] crypto: arm/aes - rename local routines to prevent future clashes

2019-06-12 Thread Ard Biesheuvel
On Wed, 12 Jun 2019 at 14:48, Ard Biesheuvel wrote: > > Rename some local AES encrypt/decrypt routines so they don't clash with > the names we are about to introduce for the routines exposes by the > generic AES library. > > Signed-off-by: Ard Biesheuvel I need to respin this patch - the subject

Re: [PATCH v3 0/4] s390/crypto: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Heiko Carstens
On Wed, Jun 12, 2019 at 03:33:02PM +0200, David Hildenbrand wrote: > s390x crypto is one of the rare modules that returns -EOPNOTSUPP instead of > -ENODEV in case HW support is not available. > > Convert to -ENODEV, so e.g., systemd's systemd-modules-load.service > ignores this error properly. >

[PATCH] wusb: switch to cbcmac transform

2019-06-12 Thread Ard Biesheuvel
The wusb code takes a very peculiar approach at implementing CBC-MAC, by using plain CBC into a scratch buffer, and taking the output IV as the MAC. We can clean up this code substantially by switching to the cbcmac shash, as exposed by the CCM template. To ensure that the module is loaded on dema

Re: [PATCH v2 0/4] Additional fixes on Talitos driver

2019-06-12 Thread Horia Geanta
On 6/12/2019 8:52 AM, Christophe Leroy wrote: > > > Le 11/06/2019 à 18:30, Horia Geanta a écrit : >> On 6/11/2019 6:40 PM, Christophe Leroy wrote: >>> >>> >>> Le 11/06/2019 à 17:37, Horia Geanta a écrit : On 6/11/2019 5:39 PM, Christophe Leroy wrote: > This series is the last set of fixe

Re: [RFC PATCH 00/20] AES cleanup

2019-06-12 Thread Ard Biesheuvel
On Wed, 12 Jun 2019 at 15:58, Herbert Xu wrote: > > On Wed, Jun 12, 2019 at 02:48:18PM +0200, Ard Biesheuvel wrote: > > > > All the patches leading up to that are cleanups for the AES code, to reduce > > the dependency on the generic table based AES code, or in some cases, > > hardcoded > > depen

Re: [PATCH] ARM: dts: imx7ulp: add crypto support

2019-06-12 Thread Herbert Xu
On Wed, Jun 12, 2019 at 09:26:02PM +0800, Shawn Guo wrote: > > Yes, it happens from time to time depending on maintainer's style. I'm > fine with the DT changes going through other subsystem tree, if the > subsystem maintainer wants to and is willing to take the risk of merge > conflict between his

Re: [RFC PATCH 00/20] AES cleanup

2019-06-12 Thread Herbert Xu
On Wed, Jun 12, 2019 at 02:48:18PM +0200, Ard Biesheuvel wrote: > > All the patches leading up to that are cleanups for the AES code, to reduce > the dependency on the generic table based AES code, or in some cases, > hardcoded > dependencies on the scalar arm64 asm code which suffers from the sam

Re: [PATCH v2 1/4] crypto: caam - do not initialise clocks on the i.MX8

2019-06-12 Thread Leonard Crestez
On 07.06.2019 23:03, Andrey Smirnov wrote: > There are no clocks that the CAAM driver needs to initialise on the > i.MX8. The clk handling inside CAAM is very convoluted and this patch doesn't help. All the driver actually does is "enable all required clocks", this shouldn't be complicated. I

Re: [PATCH v3 0/4] s390/crypto: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Cornelia Huck
On Wed, 12 Jun 2019 15:33:02 +0200 David Hildenbrand wrote: > s390x crypto is one of the rare modules that returns -EOPNOTSUPP instead of > -ENODEV in case HW support is not available. > > Convert to -ENODEV, so e.g., systemd's systemd-modules-load.service > ignores this error properly. > > v2

Re: [PATCH] crypto: talitos - fix max key size for sha384 and sha512

2019-06-12 Thread Horia Geanta
On 6/12/2019 8:49 AM, Christophe Leroy wrote: > Below commit came with a typo in the CONFIG_ symbol, leading > to a permanently reduced max key size regarless of the driver > capabilities. > > Reported-by: Horia Geantă > Fixes: b8fbdc2bc4e7 ("crypto: talitos - reduce max key size for SEC1") > Sig

[PATCH v3 4/4] s390/crypto: sha: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
Let's use the error value that is typically used if HW support is not available when trying to load a module - this is also what systemd's systemd-modules-load.service expects. Reviewed-by: Cornelia Huck Reviewed-by: Harald Freudenberger Signed-off-by: David Hildenbrand --- arch/s390/crypto/sh

[PATCH v3 3/4] s390/crypto: prng: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
Let's use the error value that is typically used if HW support is not available when trying to load a module - this is also what systemd's systemd-modules-load.service expects. Reviewed-by: Cornelia Huck Reviewed-by: Harald Freudenberger Signed-off-by: David Hildenbrand --- arch/s390/crypto/pr

[PATCH v3 0/4] s390/crypto: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
s390x crypto is one of the rare modules that returns -EOPNOTSUPP instead of -ENODEV in case HW support is not available. Convert to -ENODEV, so e.g., systemd's systemd-modules-load.service ignores this error properly. v2 -> v3: - "s390/pkey: Use -ENODEV instead of -EOPNOTSUPP" -- Also convert pke

[PATCH v3 2/4] s390/crypto: ghash: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
Let's use the error value that is typically used if HW support is not available when trying to load a module - this is also what systemd's systemd-modules-load.service expects. Reviewed-by: Cornelia Huck Reviewed-by: Harald Freudenberger Signed-off-by: David Hildenbrand --- arch/s390/crypto/gh

[PATCH v3 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
systemd-modules-load.service automatically tries to load the pkey module on systems that have MSA. Pkey also requires the MSA3 facility and a bunch of subfunctions. Failing with -EOPNOTSUPP makes "systemd-modules-load.service" fail on any system that does not have all needed subfunctions. For exam

Re: [PATCH] ARM: dts: imx7ulp: add crypto support

2019-06-12 Thread Shawn Guo
On Wed, Jun 12, 2019 at 01:15:46PM +, Horia Geanta wrote: > On 6/12/2019 4:06 PM, Shawn Guo wrote: > > On Wed, Jun 12, 2019 at 11:45:18AM +, Horia Geanta wrote: > >> On 6/12/2019 1:40 PM, Shawn Guo wrote: > >>> On Thu, Jun 06, 2019 at 11:02:55AM +0300, Horia Geantă wrote: > From: Iulia

Re: [PATCH] ARM: dts: imx7ulp: add crypto support

2019-06-12 Thread Horia Geanta
On 6/12/2019 4:06 PM, Shawn Guo wrote: > On Wed, Jun 12, 2019 at 11:45:18AM +, Horia Geanta wrote: >> On 6/12/2019 1:40 PM, Shawn Guo wrote: >>> On Thu, Jun 06, 2019 at 11:02:55AM +0300, Horia Geantă wrote: From: Iuliana Prodan Add crypto node in device tree for CAAM support. >>

Re: [PATCH] ARM: dts: imx7ulp: add crypto support

2019-06-12 Thread Shawn Guo
On Wed, Jun 12, 2019 at 11:45:18AM +, Horia Geanta wrote: > On 6/12/2019 1:40 PM, Shawn Guo wrote: > > On Thu, Jun 06, 2019 at 11:02:55AM +0300, Horia Geantă wrote: > >> From: Iuliana Prodan > >> > >> Add crypto node in device tree for CAAM support. > >> > >> Noteworthy is that on 7ulp the int

[RFC PATCH 18/20] crypto: arm/aes-ce - provide a synchronous version of ctr(aes)

2019-06-12 Thread Ard Biesheuvel
AES in CTR mode is used by modes such as GCM and CCM, which are often used in contexts where only synchronous ciphers are permitted. So provide a synchronous version of ctr(aes) based on the existing code. This requires a non-SIMD fallback to deal with invocations occurring from a context where SIM

[RFC PATCH 19/20] crypto: arm/aes-neonbs - provide a synchronous version of ctr(aes)

2019-06-12 Thread Ard Biesheuvel
AES in CTR mode is used by modes such as GCM and CCM, which are often used in contexts where only synchronous ciphers are permitted. So provide a synchronous version of ctr(aes) based on the existing code. This requires a non-SIMD fallback to deal with invocations occurring from a context where SIM

[RFC PATCH 17/20] crypto: aes - move ctr(aes) non-SIMD fallback to AES library

2019-06-12 Thread Ard Biesheuvel
In preparation of duplicating the sync ctr(aes) functionality to modules under arch/arm, move the helper function from a inline .h file to the AES library, which is already depended upon by the drivers that use this fallback. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/aes-ctr-fallback.h

[RFC PATCH 20/20] crypto: arm/ghash - provide a synchronous version

2019-06-12 Thread Ard Biesheuvel
GHASH is used by the GCM mode, which is often used in contexts where only synchronous ciphers are permitted. So provide a synchronous version of GHASH based on the existing code. This requires a non-SIMD fallback to deal with invocations occurring from a context where SIMD instructions may not be u

[RFC PATCH 02/20] crypto: arm/aes - rename local routines to prevent future clashes

2019-06-12 Thread Ard Biesheuvel
Rename some local AES encrypt/decrypt routines so they don't clash with the names we are about to introduce for the routines exposes by the generic AES library. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/aes-cipher-glue.c | 8 arch/arm64/crypto/aes-cipher-glue.c | 8 c

[RFC PATCH 03/20] crypto: aes/fixed-time - align key schedule with other implementations

2019-06-12 Thread Ard Biesheuvel
The fixed time AES code mangles the key schedule so that xoring the first round key with values at fixed offsets across the Sbox produces the correct value. This primes the D-cache with the entire Sbox before any data dependent lookups are done, making it more difficult to infer key bits from timin

[RFC PATCH 00/20] AES cleanup

2019-06-12 Thread Ard Biesheuvel
This started out as an attempt to provide synchronous SIMD based GCM on 32-bit ARM, but along the way, I ended up changing and cleaning up so many things that it is more of a general AES cleanup now rather than anything else. This is posted as an RFC since using the mostly-fixed-time C code as lib

[RFC PATCH 01/20] crypto: arm/aes-ce - cosmetic/whitespace cleanup

2019-06-12 Thread Ard Biesheuvel
Rearrange the aes_algs[] array for legibility. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/aes-ce-glue.c | 116 ++-- 1 file changed, 56 insertions(+), 60 deletions(-) diff --git a/arch/arm/crypto/aes-ce-glue.c b/arch/arm/crypto/aes-ce-glue.c index 5affb8482379..04ba6690367

[RFC PATCH 07/20] crypto: padlock/aes - switch to library version of key expansion routine

2019-06-12 Thread Ard Biesheuvel
Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- drivers/crypto/Kconfig | 2 +- drivers/crypto/padl

[RFC PATCH 10/20] crypto: arm64/ghash - switch to AES library

2019-06-12 Thread Ard Biesheuvel
The GHASH code uses the generic AES key expansion routines, and calls directly into the scalar table based AES cipher for arm64 from the fallback path, and since this implementation is known to be non-time invariant, doing so from a time invariant SIMD cipher is a bit nasty. So let's switch to the

[RFC PATCH 11/20] crypto: arm/aes-neonbs - switch to library version of key expansion routine

2019-06-12 Thread Ard Biesheuvel
Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 2 +- arch/arm/crypt

[RFC PATCH 05/20] crypto: x86/aes-ni - switch to generic for fallback and key routines

2019-06-12 Thread Ard Biesheuvel
The AES-NI code contains fallbacks for invocations that occur from a context where the SIMD unit is unavailable, which really only occurs when running in softirq context that was entered from a hard IRQ that was taken while running kernel code that was already using the FPU. That means performance

[RFC PATCH 15/20] crypto: generic/aes - drop key expansion routine in favor of library version

2019-06-12 Thread Ard Biesheuvel
Drop aes-generic's version of crypto_aes_expand_key(), and switch to key expansion routine provided by the AES library. AES key expansion is not performance critical, and it is better to have a single version shared by all AES implementations. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[RFC PATCH 06/20] crypto: x86/aes - drop scalar assembler implementations

2019-06-12 Thread Ard Biesheuvel
The AES assembler code for x86 isn't actually faster than code generated by the compiler from aes_generic.c, and considering the disproportionate maintenance burden of assembler code on x86, it is better just to drop it entirely. Modern x86 systems will use AES-NI anyway, and given that the modules

[RFC PATCH 16/20] crypto: arm64/aes-ce-cipher - use AES library as fallback

2019-06-12 Thread Ard Biesheuvel
Instead of calling into the table based scalar AES code in situations where the SIMD unit may not be used, use the generic AES code, which is more appropriate since it is less likely to be susceptible to timing attacks. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig | 2 +-

[RFC PATCH 13/20] crypto: arm64/aes-neonbs - switch to library version of key expansion routine

2019-06-12 Thread Ard Biesheuvel
Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig | 1 + arch/arm64/cr

[RFC PATCH 14/20] crypto: arm64/aes-ce - switch to library version of key expansion routine

2019-06-12 Thread Ard Biesheuvel
Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig| 2 +- arch/arm64/crypto/

[RFC PATCH 12/20] crypto: arm64/aes-ccm - switch to AES library

2019-06-12 Thread Ard Biesheuvel
The CCM code calls directly into the scalar table based AES cipher for arm64 from the fallback path, and since this implementation is known to be non-time invariant, doing so from a time invariant SIMD cipher is a bit nasty. So let's switch to the AES library - this makes the code more robust, and

[RFC PATCH 04/20] crypto: aes - create AES library based on the fixed time AES code

2019-06-12 Thread Ard Biesheuvel
Turn the existing small footprint and mostly time invariant C code and turn it into a AES library that can be used for non-performance critical, casual use of AES, and as a fallback for, e.g., SIMD code that needs a secondary path that can be taken in contexts where the SIMD unit is off limits (e.g

[RFC PATCH 08/20] crypto: cesa/aes - switch to library version of key expansion routine

2019-06-12 Thread Ard Biesheuvel
Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- drivers/crypto/Kconfig | 2 +- drivers/crypto/m

[RFC PATCH 09/20] crypto: safexcel/aes - switch to library version of key expansion routine

2019-06-12 Thread Ard Biesheuvel
Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- drivers/crypto/Kconfig | 2 +- d

Re: [PATCH] ARM: dts: imx7ulp: add crypto support

2019-06-12 Thread Horia Geanta
On 6/12/2019 1:40 PM, Shawn Guo wrote: > On Thu, Jun 06, 2019 at 11:02:55AM +0300, Horia Geantă wrote: >> From: Iuliana Prodan >> >> Add crypto node in device tree for CAAM support. >> >> Noteworthy is that on 7ulp the interrupt line is shared >> between the two job rings. >> >> Signed-off-by: Iul

Re: ctr(aes) broken in CAAM driver

2019-06-12 Thread Sascha Hauer
On Wed, Jun 12, 2019 at 10:33:56AM +, Horia Geanta wrote: > On 6/12/2019 12:40 PM, Sascha Hauer wrote: > > Hi Horia, > > > > On Wed, May 15, 2019 at 01:35:16PM +, Horia Geanta wrote: > >> For talitos, the problem is the lack of IV update. > >> > >> For caam, the problem is incorrect IV upd

Re: [PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
On 12.06.19 13:07, Harald Freudenberger wrote: > On 12.06.19 12:41, David Hildenbrand wrote: >> On 12.06.19 12:39, Harald Freudenberger wrote: >>> On 12.06.19 12:22, David Hildenbrand wrote: systemd-modules-load.service automatically tries to load the pkey module on systems that have MSA.

Re: [PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Harald Freudenberger
On 12.06.19 12:41, David Hildenbrand wrote: > On 12.06.19 12:39, Harald Freudenberger wrote: >> On 12.06.19 12:22, David Hildenbrand wrote: >>> systemd-modules-load.service automatically tries to load the pkey module >>> on systems that have MSA. >>> >>> Pkey also requires the MSA3 facility and a b

Re: [PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
On 12.06.19 12:39, Harald Freudenberger wrote: > On 12.06.19 12:22, David Hildenbrand wrote: >> systemd-modules-load.service automatically tries to load the pkey module >> on systems that have MSA. >> >> Pkey also requires the MSA3 facility and a bunch of subfunctions. >> Failing with -EOPNOTSUPP m

Re: [PATCH] ARM: dts: imx7ulp: add crypto support

2019-06-12 Thread Shawn Guo
On Thu, Jun 06, 2019 at 11:02:55AM +0300, Horia Geantă wrote: > From: Iuliana Prodan > > Add crypto node in device tree for CAAM support. > > Noteworthy is that on 7ulp the interrupt line is shared > between the two job rings. > > Signed-off-by: Iuliana Prodan > Signed-off-by: Franck LENORMAND

Re: [PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Harald Freudenberger
On 12.06.19 12:22, David Hildenbrand wrote: > systemd-modules-load.service automatically tries to load the pkey module > on systems that have MSA. > > Pkey also requires the MSA3 facility and a bunch of subfunctions. > Failing with -EOPNOTSUPP makes "systemd-modules-load.service" fail on > any syst

Re: [PATCH v2 4/4] s390/crypto: sha: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Cornelia Huck
On Wed, 12 Jun 2019 12:22:48 +0200 David Hildenbrand wrote: > Let's use the error value that is typically used if HW support is not > available when trying to load a module - this is also what systemd's > systemd-modules-load.service expects. > > Signed-off-by: David Hildenbrand > --- > arch/s

Re: [PATCH v2 3/4] s390/crypto: prng: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Cornelia Huck
On Wed, 12 Jun 2019 12:22:47 +0200 David Hildenbrand wrote: > Let's use the error value that is typically used if HW support is not > available when trying to load a module - this is also what systemd's > systemd-modules-load.service expects. > > Signed-off-by: David Hildenbrand > --- > arch/s

Re: ctr(aes) broken in CAAM driver

2019-06-12 Thread Horia Geanta
On 6/12/2019 12:40 PM, Sascha Hauer wrote: > Hi Horia, > > On Wed, May 15, 2019 at 01:35:16PM +, Horia Geanta wrote: >> For talitos, the problem is the lack of IV update. >> >> For caam, the problem is incorrect IV update (output IV is equal to last >> ciphertext block, which is correect for c

Re: [PATCH v2 2/4] s390/crypto: ghash: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Harald Freudenberger
On 12.06.19 12:22, David Hildenbrand wrote: > Let's use the error value that is typically used if HW support is not > available when trying to load a module - this is also what systemd's > systemd-modules-load.service expects. > > Signed-off-by: David Hildenbrand > --- > arch/s390/crypto/ghash_s3

Re: [PATCH v2 2/4] s390/crypto: ghash: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Cornelia Huck
On Wed, 12 Jun 2019 12:22:46 +0200 David Hildenbrand wrote: > Let's use the error value that is typically used if HW support is not > available when trying to load a module - this is also what systemd's > systemd-modules-load.service expects. > > Signed-off-by: David Hildenbrand > --- > arch/s

Re: [PATCH v2 4/4] s390/crypto: sha: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Harald Freudenberger
On 12.06.19 12:22, David Hildenbrand wrote: > Let's use the error value that is typically used if HW support is not > available when trying to load a module - this is also what systemd's > systemd-modules-load.service expects. > > Signed-off-by: David Hildenbrand > --- > arch/s390/crypto/sha1_s39

Re: [PATCH v2 3/4] s390/crypto: prng: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread Harald Freudenberger
On 12.06.19 12:22, David Hildenbrand wrote: > Let's use the error value that is typically used if HW support is not > available when trying to load a module - this is also what systemd's > systemd-modules-load.service expects. > > Signed-off-by: David Hildenbrand > --- > arch/s390/crypto/prng.c |

[PATCH v2 3/4] s390/crypto: prng: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
Let's use the error value that is typically used if HW support is not available when trying to load a module - this is also what systemd's systemd-modules-load.service expects. Signed-off-by: David Hildenbrand --- arch/s390/crypto/prng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v2 0/4] s390/crypto: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
s390x crypto is one of the rare modules that returns -EOPNOTSUPP instead of -ENODEV in case HW support is not available. Convert to -ENODEV, so e.g., systemd's systemd-modules-load.service ignores this error properly. v1 -> v2: - Include -- "s390/crypto: ghash: Use -ENODEV instead of -EOPNOTSUPP"

[PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
systemd-modules-load.service automatically tries to load the pkey module on systems that have MSA. Pkey also requires the MSA3 facility and a bunch of subfunctions. Failing with -EOPNOTSUPP makes "systemd-modules-load.service" fail on any system that does not have all needed subfunctions. For exam

[PATCH v2 4/4] s390/crypto: sha: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
Let's use the error value that is typically used if HW support is not available when trying to load a module - this is also what systemd's systemd-modules-load.service expects. Signed-off-by: David Hildenbrand --- arch/s390/crypto/sha1_s390.c | 2 +- arch/s390/crypto/sha256_s390.c | 2 +- arch

[PATCH v2 2/4] s390/crypto: ghash: Use -ENODEV instead of -EOPNOTSUPP

2019-06-12 Thread David Hildenbrand
Let's use the error value that is typically used if HW support is not available when trying to load a module - this is also what systemd's systemd-modules-load.service expects. Signed-off-by: David Hildenbrand --- arch/s390/crypto/ghash_s390.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

Re: ctr(aes) broken in CAAM driver

2019-06-12 Thread Sascha Hauer
Hi Horia, On Wed, May 15, 2019 at 01:35:16PM +, Horia Geanta wrote: > For talitos, the problem is the lack of IV update. > > For caam, the problem is incorrect IV update (output IV is equal to last > ciphertext block, which is correect for cbc, but not for ctr mode). > > I am working at a fi