Re: [PATCH 1/4] dt-bindings: crypto: Add DT bindings documentation for amlogic-crypto

2019-07-25 Thread Rob Herring
On Thu, Jul 25, 2019 at 1:43 PM Corentin Labbe wrote: > > This patch adds documentation for Device-Tree bindings for the > Amlogic GXL cryptographic offloader driver. > > Signed-off-by: Corentin Labbe > --- > .../bindings/crypto/amlogic-gxl-crypto.yaml | 45 +++ Follow the comp

Zdravstvujte! Vas interesuyut klientskie bazy dannyh?

2019-07-25 Thread linux-crypto
Zdravstvujte! Vas interesuyut klientskie bazy dannyh?

[RFC 9/9] padata: remove cpu_index from the parallel_queue

2019-07-25 Thread Daniel Jordan
With the removal of the ENODATA case from padata_get_next, the cpu_index field is no longer useful, so it can go away. Signed-off-by: Daniel Jordan --- include/linux/padata.h | 2 -- kernel/padata.c| 13 ++--- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/inclu

[RFC 8/9] padata: unbind parallel jobs from specific CPUs

2019-07-25 Thread Daniel Jordan
Padata binds the parallel part of a job to a single CPU. Though the serial parts rely on per-CPU queues, it's not necessary for the parallel part, and it's beneficial to run the job locally on NUMA machines and let the scheduler pick the CPU within a node on a busy system. So, make the parallel w

[RFC 4/9] padata: make padata_do_parallel find alternate callback CPU

2019-07-25 Thread Daniel Jordan
padata_do_parallel currently returns -EINVAL if the callback CPU isn't in the callback cpumask. pcrypt tries to prevent this situation by keeping its own callback cpumask in sync with padata's and checks that the callback CPU it passes to padata is valid. Make padata handle this instead. padata_

[RFC 6/9] padata, pcrypt: take CPU hotplug lock internally in padata_alloc_possible

2019-07-25 Thread Daniel Jordan
With pcrypt's cpumask no longer used, take the CPU hotplug lock inside padata_alloc_possible. Useful later in the series for avoiding nested acquisition of the CPU hotplug lock in padata when padata_alloc_possible is allocating an unbound workqueue. Without this patch, this nested acquisition wou

[RFC 0/9] padata: use unbound workqueues for parallel jobs

2019-07-25 Thread Daniel Jordan
Padata binds the parallel part of a job to a single CPU. Though the serial parts rely on per-CPU queues for correct ordering, they're not necessary for parallel work, and it improves performance to run the job locally on NUMA machines and let the scheduler pick the CPU within a node on a busy syst

[RFC 3/9] workqueue: require CPU hotplug read exclusion for apply_workqueue_attrs

2019-07-25 Thread Daniel Jordan
Change the calling convention for apply_workqueue_attrs to require CPU hotplug read exclusion. Avoids lockdep complaints about nested calls to get_online_cpus in a future patch where padata calls apply_workqueue_attrs when changing other CPU-hotplug-sensitive data structures with the CPU read lock

[RFC 5/9] pcrypt: remove padata cpumask notifier

2019-07-25 Thread Daniel Jordan
Now that padata_do_parallel takes care of finding an alternate callback CPU, there's no need for pcrypt's callback cpumask, so remove it and the notifier callback that keeps it in sync. Signed-off-by: Daniel Jordan --- crypto/pcrypt.c | 125 +++- 1 fil

[RFC 1/9] padata: allocate workqueue internally

2019-07-25 Thread Daniel Jordan
Move workqueue allocation inside of padata to prepare for further changes to how padata uses workqueues. Guarantees the workqueue is created with max_active=1, which padata relies on to work correctly. No functional change. Signed-off-by: Daniel Jordan --- Documentation/padata.txt | 12 ++-

[RFC 2/9] workqueue: unconfine alloc/apply/free_workqueue_attrs()

2019-07-25 Thread Daniel Jordan
padata will use these these interfaces in a later patch, so unconfine them. Signed-off-by: Daniel Jordan --- include/linux/workqueue.h | 4 kernel/workqueue.c| 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueu

[RFC 7/9] padata: use separate workqueues for parallel and serial work

2019-07-25 Thread Daniel Jordan
padata currently uses one per-CPU workqueue per instance for all work. Prepare for running parallel jobs on an unbound workqueue by introducing dedicated workqueues for parallel and serial work. Signed-off-by: Daniel Jordan --- include/linux/padata.h | 6 -- kernel/padata.c| 28 +++

[PATCH 3/4] MAINTAINERS: Add myself as maintainer of amlogic crypto

2019-07-25 Thread Corentin Labbe
I will maintain the amlogic crypto driver. Signed-off-by: Corentin Labbe --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 93d6cae3274d..48e7fd110688 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1450,6 +1450,13 @@ F: drivers/mmc/ho

[PATCH 0/4] crypto: add amlogic crypto offloader driver

2019-07-25 Thread Corentin Labbe
Hello This serie adds support for the crypto offloader present on amlogic GXL SoCs. Tested on meson-gxl-s905x-khadas-vim and meson-gxl-s905x-libretech-cc Regards Corentin Labbe (4): dt-bindings: crypto: Add DT bindings documentation for amlogic-crypto crypto: amlogic: Add crypto accelerator

[PATCH 1/4] dt-bindings: crypto: Add DT bindings documentation for amlogic-crypto

2019-07-25 Thread Corentin Labbe
This patch adds documentation for Device-Tree bindings for the Amlogic GXL cryptographic offloader driver. Signed-off-by: Corentin Labbe --- .../bindings/crypto/amlogic-gxl-crypto.yaml | 45 +++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bind

[PATCH 2/4] crypto: amlogic: Add crypto accelerator for amlogic GXL

2019-07-25 Thread Corentin Labbe
This patch adds support for the amlogic GXL cryptographic offloader present on GXL SoCs. This driver supports AES cipher in CBC/ECB mode. Signed-off-by: Corentin Labbe --- drivers/crypto/Kconfig | 2 + drivers/crypto/Makefile | 1 + drivers/crypto/amlogic/Kc

[PATCH 4/4] ARM64: dts: amlogic: adds crypto hardware node

2019-07-25 Thread Corentin Labbe
This patch adds the GXL crypto hardware node for all GXL SoCs. Signed-off-by: Corentin Labbe --- arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi in

Re: [RFC PATCH] rxrpc: Fix -Wframe-larger-than= warnings from on-stack crypto

2019-07-25 Thread David Howells
Would you rather this went through net or net-next? David

Re: [RFC PATCH] rxrpc: Fix -Wframe-larger-than= warnings from on-stack crypto

2019-07-25 Thread Arnd Bergmann
On Thu, Jul 25, 2019 at 3:31 PM David Howells wrote: > > rxkad sometimes triggers a warning about oversized stack frames when > building with clang for a 32-bit architecture: > > net/rxrpc/rxkad.c:243:12: error: stack frame size of 1088 bytes in function > 'rxkad_secure_packet' [-Werror,-Wframe-l

Re: [RFC PATCH] rxrpc: Fix -Wframe-larger-than= warnings from on-stack crypto

2019-07-25 Thread David Howells
Ard Biesheuvel wrote: > Given that this part of the driver only uses synchronous crypto, and > only using a hardcoded algo and mode [pcbc(fcrypt)], of which only a > generic C implementation exists, may I suggest that we switch to a > library based approach instead? > > That way, we can get rid

Re: [PATCH] crypto: qat - Silence smp_processor_id() warning

2019-07-25 Thread Sverdlin, Alexander (Nokia - DE/Ulm)
Hi! On 25/07/2019 15:26, Giovanni Cabiddu wrote: >> It seems that smp_processor_id() is only used for a best-effort >> load-balancing, refer to qat_crypto_get_instance_node(). It's not feasible >> to disable preemption for the duration of the crypto requests. Therefore, >> just silence the warning

Re: [PATCH] crypto: qat - Silence smp_processor_id() warning

2019-07-25 Thread Sverdlin, Alexander (Nokia - DE/Ulm)
Hi! On 25/07/2019 15:26, Giovanni Cabiddu wrote: >> It seems that smp_processor_id() is only used for a best-effort >> load-balancing, refer to qat_crypto_get_instance_node(). It's not feasible >> to disable preemption for the duration of the crypto requests. Therefore, >> just silence the warning

Re: [RFC PATCH] rxrpc: Fix -Wframe-larger-than= warnings from on-stack crypto

2019-07-25 Thread Ard Biesheuvel
On Thu, 25 Jul 2019 at 16:31, David Howells wrote: > > rxkad sometimes triggers a warning about oversized stack frames when > building with clang for a 32-bit architecture: > > net/rxrpc/rxkad.c:243:12: error: stack frame size of 1088 bytes in function > 'rxkad_secure_packet' [-Werror,-Wframe-lar

[PATCH v3 06/14] crypto: caam - check assoclen

2019-07-25 Thread Iuliana Prodan
Check assoclen to solve the extra tests that expect -EINVAL to be returned when the associated data size is not valid. Validated assoclen for RFC4106 and RFC4543 which expects an assoclen of 16 or 20. Based on seqiv, IPsec ESP and RFC4543/RFC4106 the assoclen is sizeof IP Header (spi, seq_no, exte

[PATCH v3 07/14] crypto: caam - check zero-length input

2019-07-25 Thread Iuliana Prodan
Check zero-length input, for skcipher algorithm, to solve the extra tests. This is a valid operation, therefore the API will return no error. Signed-off-by: Iuliana Prodan Reviewed-by: Horia Geanta --- drivers/crypto/caam/caamalg.c | 6 ++ drivers/crypto/caam/caamalg_qi.c | 3 +++ driv

[PATCH v3 02/14] crypto: caam - fix return code in completion callbacks

2019-07-25 Thread Iuliana Prodan
From: Horia Geantă Modify drive to provide a valid errno (and not the HW error ID) to the user, via completion callbacks. A "valid errno" is currently not explicitly mentioned in the docs, however the error code is expected to match the one returned by the generic SW implementation. Note: in mo

[PATCH v3 00/14] crypto: caam - fixes for kernel v5.3

2019-07-25 Thread Iuliana Prodan
The series solves: - the failures found with fuzz testing; - resources clean-up on caampkc/caamrng exit path. The first 10 patches solve the issues found with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled. They modify the drivers to provide a valid error (and not the hardware error ID) to the user, vi

[PATCH v3 05/14] crypto: caam - check authsize

2019-07-25 Thread Iuliana Prodan
Check authsize to solve the extra tests that expect -EINVAL to be returned when the authentication tag size is not valid. Validated authsize for GCM, RFC4106 and RFC4543. Signed-off-by: Iuliana Prodan --- drivers/crypto/caam/caamalg.c | 13 + drivers/crypto/caam/caamalg_qi.c |

[PATCH v3 10/14] crypto: caam - fix MDHA key derivation for certain user key lengths

2019-07-25 Thread Iuliana Prodan
From: Horia Geantă Fuzz testing uncovered an issue when |user key| > |derived key|. Derived key generation has to be fixed in two cases: 1. Era >= 6 (DKP is available) DKP cannot be used with immediate input key if |user key| > |derived key|, since the resulting descriptor (after DKP execution)

[PATCH v3 09/14] crypto: caam - keep both virtual and dma key addresses

2019-07-25 Thread Iuliana Prodan
From: Horia Geantă Update alginfo struct to keep both virtual and dma key addresses, so that descriptors have them at hand. One example where this is needed is in the xcbc(aes) shared descriptors, which are updated in current patch. Another example is the upcoming fix for DKP. Signed-off-by: Hor

[PATCH v3 12/14] crypto: caam - execute module exit point only if necessary

2019-07-25 Thread Iuliana Prodan
Commit 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries") changed entry and exit points behavior for caamalg, caamalg_qi, caamalg_qi2, caamhash, caampkc, caamrng. For example, previously caam_pkc_init() and caam_pkc_exit() were module entry/exit points. This means that if an er

[PATCH v3 04/14] crypto: caam - check key length

2019-07-25 Thread Iuliana Prodan
Check key length to solve the extra tests that expect -EINVAL to be returned when the key size is not valid. Validated AES keylen for skcipher, ahash and aead. Signed-off-by: Iuliana Prodan --- Changes since v2: - remove check for keylen < 4, since is included in check_aes_keylen; - update commi

[PATCH v3 11/14] crypto: caam - free resources in case caam_rng registration failed

2019-07-25 Thread Iuliana Prodan
Check the return value of the hardware registration for caam_rng and free resources in case of failure. Fixes: e24f7c9 ("crypto: caam - hwrng support") Signed-off-by: Iuliana Prodan --- Changes since v2: - update Fixes tag. --- drivers/crypto/caam/caamrng.c | 5 - 1 file changed, 4 insertion

[PATCH v3 08/14] crypto: caam - update rfc4106 sh desc to support zero length input

2019-07-25 Thread Iuliana Prodan
Update share descriptor for rfc4106 to skip instructions in case cryptlen is zero. If no instructions are jumped the DECO hangs and a timeout error is thrown. Signed-off-by: Iuliana Prodan --- Changes since v2: - update shared descriptor with the erratum workaround. --- drivers/crypto/caam/caama

[PATCH v3 13/14] crypto: caam - unregister algorithm only if the registration succeeded

2019-07-25 Thread Iuliana Prodan
To know if a registration succeeded added a new struct, caam_akcipher_alg, that keeps, also, the registration status. This status is updated in caam_pkc_init and verified in caam_pkc_exit to unregister an algorithm. Fixes: 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries") Sign

[PATCH v3 03/14] crypto: caam - update IV only when crypto operation succeeds

2019-07-25 Thread Iuliana Prodan
From: Horia Geantă skcipher encryption might fail and in some cases, like (invalid) input length smaller then block size, updating the IV would lead to panic due to copying from a negative offset (req->cryptlen - ivsize). Signed-off-by: Horia Geantă Signed-off-by: Iuliana Prodan --- drivers/c

[PATCH v3 14/14] crypto: caam - change return value in case CAAM has no MDHA

2019-07-25 Thread Iuliana Prodan
To be consistent with other CAAM modules, caamhash should return 0 instead of -ENODEV in case CAAM has no MDHA. Based on commit 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries") the value returned by entry point is never checked and the exit point is always executed. Signed-

[PATCH v3 01/14] crypto: caam/qi - fix error handling in ERN handler

2019-07-25 Thread Iuliana Prodan
From: Horia Geantă ERN handler calls the caam/qi frontend "done" callback with a status of -EIO. This is incorrect, since the callback expects a status value meaningful for the crypto engine - hence the cryptic messages like the one below: platform caam_qi: 15: unknown error source Fix this by p

[PATCH v2] crypto: gcm - restrict assoclen for rfc4543

2019-07-25 Thread Iuliana Prodan
Based on seqiv, IPsec ESP and rfc4543/rfc4106 the assoclen can be 16 or 20 bytes. >From esp4/esp6, assoclen is sizeof IP Header. This includes spi, seq_no and extended seq_no, that is 8 or 12 bytes. In seqiv, to asscolen is added the IV size (8 bytes). Therefore, the assoclen, for rfc4543, should

[PATCH 1/2] crypto: gcm - helper functions for assoclen/authsize check

2019-07-25 Thread Iuliana Prodan
Added inline helper functions to check authsize and assoclen for gcm and rfc4106. These are used in the generic implementation of gcm and rfc4106. Signed-off-by: Iuliana Prodan --- crypto/gcm.c | 41 +++- include/crypto/gcm.h | 53 +

[PATCH 2/2] crypto: aes - helper function to validate key length for AES algorithms

2019-07-25 Thread Iuliana Prodan
Add inline helper function to check key length for AES algorithms. The key can be 128, 192 or 256 bits size. This function is used in the generic aes and aes_ti implementations. Signed-off-by: Iuliana Prodan --- crypto/aes_generic.c | 7 --- crypto/aes_ti.c | 8 include/crypt

[PATCH 0/2] crypto: validate inputs for gcm and aes

2019-07-25 Thread Iuliana Prodan
Added inline helper functions to check authsize and assoclen for gcm and rfc4106. Added, also, inline helper function to check key length for AES algorithms. These are used in the generic implementation of gcm/rfc4106 and aes/aes_ti. Iuliana Prodan (2): crypto: gcm - helper functions for assoc

[RFC PATCH] rxrpc: Fix -Wframe-larger-than= warnings from on-stack crypto

2019-07-25 Thread David Howells
rxkad sometimes triggers a warning about oversized stack frames when building with clang for a 32-bit architecture: net/rxrpc/rxkad.c:243:12: error: stack frame size of 1088 bytes in function 'rxkad_secure_packet' [-Werror,-Wframe-larger-than=] net/rxrpc/rxkad.c:501:12: error: stack frame size of

Re: [PATCH] crypto: qat - Silence smp_processor_id() warning

2019-07-25 Thread Giovanni Cabiddu
Hi Alexander, Thanks for you patch. On Tue, Jul 23, 2019 at 07:24:01AM +, Sverdlin, Alexander (Nokia - DE/Ulm) wrote: > It seems that smp_processor_id() is only used for a best-effort > load-balancing, refer to qat_crypto_get_instance_node(). It's not feasible > to disable preemption for the

Re: [PATCH] hwrng: Use device-managed registration API

2019-07-25 Thread Łukasz Stelmach
It was <2019-07-25 czw 10:01>, when Chuhong Yuan wrote: > Use devm_hwrng_register to simplify the implementation. > Manual unregistration and some remove functions can be > removed now. > > Signed-off-by: Chuhong Yuan > --- > drivers/char/hw_random/atmel-rng.c | 3 +-- > drivers/char/hw_rand

Re: Backlog support for CAAM?

2019-07-25 Thread Richard Weinberger
- Ursprüngliche Mail - > Von: "horia geanta" > An: "richard" , "Linux Crypto Mailing List" > , "linux-kernel" > > CC: "aymen sghaier" , "david" , > "Baolin Wang" > Gesendet: Donnerstag, 25. Juli 2019 07:57:28 > Betreff: Re: Backlog support for CAAM? > On 7/25/2019 12:22 AM, Richard We

[PATCH] hwrng: Use device-managed registration API

2019-07-25 Thread Chuhong Yuan
Use devm_hwrng_register to simplify the implementation. Manual unregistration and some remove functions can be removed now. Signed-off-by: Chuhong Yuan --- drivers/char/hw_random/atmel-rng.c | 3 +-- drivers/char/hw_random/cavium-rng-vf.c | 11 +-- drivers/char/hw_random/exynos-trng