Skip to content

Commit 84c7d76

Browse files
committed
Merge tag 'v6.10-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: "API: - Remove crypto stats interface Algorithms: - Add faster AES-XTS on modern x86_64 CPUs - Forbid curves with order less than 224 bits in ecc (FIPS 186-5) - Add ECDSA NIST P521 Drivers: - Expose otp zone in atmel - Add dh fallback for primes > 4K in qat - Add interface for live migration in qat - Use dma for aes requests in starfive - Add full DMA support for stm32mpx in stm32 - Add Tegra Security Engine driver Others: - Introduce scope-based x509_certificate allocation" * tag 'v6.10-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (123 commits) crypto: atmel-sha204a - provide the otp content crypto: atmel-sha204a - add reading from otp zone crypto: atmel-i2c - rename read function crypto: atmel-i2c - add missing arg description crypto: iaa - Use kmemdup() instead of kzalloc() and memcpy() crypto: sahara - use 'time_left' variable with wait_for_completion_timeout() crypto: api - use 'time_left' variable with wait_for_completion_killable_timeout() crypto: caam - i.MX8ULP donot have CAAM page0 access crypto: caam - init-clk based on caam-page0-access crypto: starfive - Use fallback for unaligned dma access crypto: starfive - Do not free stack buffer crypto: starfive - Skip unneeded fallback allocation crypto: starfive - Skip dma setup for zeroed message crypto: hisilicon/sec2 - fix for register offset crypto: hisilicon/debugfs - mask the unnecessary info from the dump crypto: qat - specify firmware files for 402xx crypto: x86/aes-gcm - simplify GCM hash subkey derivation crypto: x86/aes-gcm - delete unused GCM assembly code crypto: x86/aes-xts - simplify loop in xts_crypt_slowpath() hwrng: stm32 - repair clock handling ...
2 parents 87caef4 + 13909a0 commit 84c7d76

File tree

153 files changed

+10315
-3205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+10315
-3205
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/crypto/nvidia,tegra234-se-aes.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NVIDIA Tegra Security Engine for AES algorithms
8+
9+
description:
10+
The Tegra Security Engine accelerates the following AES encryption/decryption
11+
algorithms - AES-ECB, AES-CBC, AES-OFB, AES-XTS, AES-CTR, AES-GCM, AES-CCM,
12+
AES-CMAC
13+
14+
maintainers:
15+
- Akhil R <[email protected]>
16+
17+
properties:
18+
compatible:
19+
const: nvidia,tegra234-se-aes
20+
21+
reg:
22+
maxItems: 1
23+
24+
clocks:
25+
maxItems: 1
26+
27+
iommus:
28+
maxItems: 1
29+
30+
dma-coherent: true
31+
32+
required:
33+
- compatible
34+
- reg
35+
- clocks
36+
- iommus
37+
38+
additionalProperties: false
39+
40+
examples:
41+
- |
42+
#include <dt-bindings/memory/tegra234-mc.h>
43+
#include <dt-bindings/clock/tegra234-clock.h>
44+
45+
crypto@15820000 {
46+
compatible = "nvidia,tegra234-se-aes";
47+
reg = <0x15820000 0x10000>;
48+
clocks = <&bpmp TEGRA234_CLK_SE>;
49+
iommus = <&smmu TEGRA234_SID_SES_SE1>;
50+
dma-coherent;
51+
};
52+
...
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/crypto/nvidia,tegra234-se-hash.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NVIDIA Tegra Security Engine for HASH algorithms
8+
9+
description:
10+
The Tegra Security HASH Engine accelerates the following HASH functions -
11+
SHA1, SHA224, SHA256, SHA384, SHA512, SHA3-224, SHA3-256, SHA3-384, SHA3-512
12+
HMAC(SHA224), HMAC(SHA256), HMAC(SHA384), HMAC(SHA512)
13+
14+
maintainers:
15+
- Akhil R <[email protected]>
16+
17+
properties:
18+
compatible:
19+
const: nvidia,tegra234-se-hash
20+
21+
reg:
22+
maxItems: 1
23+
24+
clocks:
25+
maxItems: 1
26+
27+
iommus:
28+
maxItems: 1
29+
30+
dma-coherent: true
31+
32+
required:
33+
- compatible
34+
- reg
35+
- clocks
36+
- iommus
37+
38+
additionalProperties: false
39+
40+
examples:
41+
- |
42+
#include <dt-bindings/memory/tegra234-mc.h>
43+
#include <dt-bindings/clock/tegra234-clock.h>
44+
45+
crypto@15840000 {
46+
compatible = "nvidia,tegra234-se-hash";
47+
reg = <0x15840000 0x10000>;
48+
clocks = <&bpmp TEGRA234_CLK_SE>;
49+
iommus = <&smmu TEGRA234_SID_SES_SE2>;
50+
dma-coherent;
51+
};
52+
...

Documentation/devicetree/bindings/crypto/omap-sham.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.

Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ properties:
1515
- enum:
1616
- qcom,sa8775p-inline-crypto-engine
1717
- qcom,sc7180-inline-crypto-engine
18+
- qcom,sc7280-inline-crypto-engine
1819
- qcom,sm8450-inline-crypto-engine
1920
- qcom,sm8550-inline-crypto-engine
2021
- qcom,sm8650-inline-crypto-engine

Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ maintainers:
1212

1313
properties:
1414
compatible:
15-
const: starfive,jh7110-crypto
15+
enum:
16+
- starfive,jh7110-crypto
17+
- starfive,jh8100-crypto
1618

1719
reg:
1820
maxItems: 1
@@ -28,7 +30,10 @@ properties:
2830
- const: ahb
2931

3032
interrupts:
31-
maxItems: 1
33+
minItems: 1
34+
items:
35+
- description: SHA2 module irq
36+
- description: SM3 module irq
3237

3338
resets:
3439
maxItems: 1
@@ -54,6 +59,27 @@ required:
5459

5560
additionalProperties: false
5661

62+
allOf:
63+
- if:
64+
properties:
65+
compatible:
66+
const: starfive,jh7110-crypto
67+
68+
then:
69+
properties:
70+
interrupts:
71+
maxItems: 1
72+
73+
- if:
74+
properties:
75+
compatible:
76+
const: starfive,jh8100-crypto
77+
78+
then:
79+
properties:
80+
interrupts:
81+
minItems: 2
82+
5783
examples:
5884
- |
5985
crypto: crypto@16000000 {
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/crypto/ti,omap-sham.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: OMAP SoC SHA crypto Module
8+
9+
maintainers:
10+
- Animesh Agarwal <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- ti,omap2-sham
16+
- ti,omap4-sham
17+
- ti,omap5-sham
18+
19+
reg:
20+
maxItems: 1
21+
22+
interrupts:
23+
maxItems: 1
24+
25+
dmas:
26+
maxItems: 1
27+
28+
dma-names:
29+
const: rx
30+
31+
ti,hwmods:
32+
description: Name of the hwmod associated with the SHAM module
33+
$ref: /schemas/types.yaml#/definitions/string
34+
enum: [sham]
35+
36+
dependencies:
37+
dmas: [dma-names]
38+
39+
additionalProperties: false
40+
41+
required:
42+
- compatible
43+
- ti,hwmods
44+
- reg
45+
- interrupts
46+
47+
examples:
48+
- |
49+
sham@53100000 {
50+
compatible = "ti,omap4-sham";
51+
ti,hwmods = "sham";
52+
reg = <0x53100000 0x200>;
53+
interrupts = <109>;
54+
dmas = <&edma 36>;
55+
dma-names = "rx";
56+
};

Documentation/driver-api/crypto/iaa/iaa-crypto.rst

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ has the old 'iax' device naming in place) ::
179179

180180
# configure wq1.0
181181

182-
accel-config config-wq --group-id=0 --mode=dedicated --type=kernel --name="iaa_crypto" --device_name="crypto" iax1/wq1.0
182+
accel-config config-wq --group-id=0 --mode=dedicated --type=kernel --priority=10 --name="iaa_crypto" --driver-name="crypto" iax1/wq1.0
183+
184+
accel-config config-engine iax1/engine1.0 --group-id=0
183185

184186
# enable IAA device iax1
185187

@@ -321,33 +323,30 @@ driver will generate statistics which can be accessed in debugfs at::
321323

322324
# ls -al /sys/kernel/debug/iaa-crypto/
323325
total 0
324-
drwxr-xr-x 2 root root 0 Mar 3 09:35 .
325-
drwx------ 47 root root 0 Mar 3 09:35 ..
326-
-rw-r--r-- 1 root root 0 Mar 3 09:35 max_acomp_delay_ns
327-
-rw-r--r-- 1 root root 0 Mar 3 09:35 max_adecomp_delay_ns
328-
-rw-r--r-- 1 root root 0 Mar 3 09:35 max_comp_delay_ns
329-
-rw-r--r-- 1 root root 0 Mar 3 09:35 max_decomp_delay_ns
330-
-rw-r--r-- 1 root root 0 Mar 3 09:35 stats_reset
331-
-rw-r--r-- 1 root root 0 Mar 3 09:35 total_comp_bytes_out
332-
-rw-r--r-- 1 root root 0 Mar 3 09:35 total_comp_calls
333-
-rw-r--r-- 1 root root 0 Mar 3 09:35 total_decomp_bytes_in
334-
-rw-r--r-- 1 root root 0 Mar 3 09:35 total_decomp_calls
335-
-rw-r--r-- 1 root root 0 Mar 3 09:35 wq_stats
336-
337-
Most of the above statisticss are self-explanatory. The wq_stats file
338-
shows per-wq stats, a set for each iaa device and wq in addition to
339-
some global stats::
326+
drwxr-xr-x 2 root root 0 Mar 3 07:55 .
327+
drwx------ 53 root root 0 Mar 3 07:55 ..
328+
-rw-r--r-- 1 root root 0 Mar 3 07:55 global_stats
329+
-rw-r--r-- 1 root root 0 Mar 3 07:55 stats_reset
330+
-rw-r--r-- 1 root root 0 Mar 3 07:55 wq_stats
340331

341-
# cat wq_stats
332+
The global_stats file shows a set of global statistics collected since
333+
the driver has been loaded or reset::
334+
335+
# cat global_stats
342336
global stats:
343-
total_comp_calls: 100
344-
total_decomp_calls: 100
345-
total_comp_bytes_out: 22800
346-
total_decomp_bytes_in: 22800
337+
total_comp_calls: 4300
338+
total_decomp_calls: 4164
339+
total_sw_decomp_calls: 0
340+
total_comp_bytes_out: 5993989
341+
total_decomp_bytes_in: 5993989
347342
total_completion_einval_errors: 0
348343
total_completion_timeout_errors: 0
349-
total_completion_comp_buf_overflow_errors: 0
344+
total_completion_comp_buf_overflow_errors: 136
345+
346+
The wq_stats file shows per-wq stats, a set for each iaa device and wq
347+
in addition to some global stats::
350348

349+
# cat wq_stats
351350
iaa device:
352351
id: 1
353352
n_wqs: 1
@@ -379,21 +378,36 @@ some global stats::
379378
iaa device:
380379
id: 5
381380
n_wqs: 1
382-
comp_calls: 100
383-
comp_bytes: 22800
384-
decomp_calls: 100
385-
decomp_bytes: 22800
381+
comp_calls: 1360
382+
comp_bytes: 1999776
383+
decomp_calls: 0
384+
decomp_bytes: 0
386385
wqs:
387386
name: iaa_crypto
388-
comp_calls: 100
389-
comp_bytes: 22800
390-
decomp_calls: 100
391-
decomp_bytes: 22800
387+
comp_calls: 1360
388+
comp_bytes: 1999776
389+
decomp_calls: 0
390+
decomp_bytes: 0
392391

393-
Writing 0 to 'stats_reset' resets all the stats, including the
392+
iaa device:
393+
id: 7
394+
n_wqs: 1
395+
comp_calls: 2940
396+
comp_bytes: 3994213
397+
decomp_calls: 4164
398+
decomp_bytes: 5993989
399+
wqs:
400+
name: iaa_crypto
401+
comp_calls: 2940
402+
comp_bytes: 3994213
403+
decomp_calls: 4164
404+
decomp_bytes: 5993989
405+
...
406+
407+
Writing to 'stats_reset' resets all the stats, including the
394408
per-device and per-wq stats::
395409

396-
# echo 0 > stats_reset
410+
# echo 1 > stats_reset
397411
# cat wq_stats
398412
global stats:
399413
total_comp_calls: 0
@@ -536,12 +550,20 @@ The below script automatically does that::
536550

537551
echo "End Disable IAA"
538552

553+
echo "Reload iaa_crypto module"
554+
555+
rmmod iaa_crypto
556+
modprobe iaa_crypto
557+
558+
echo "End Reload iaa_crypto module"
559+
539560
#
540561
# configure iaa wqs and devices
541562
#
542563
echo "Configure IAA"
543564
for ((i = 1; i < ${num_iaa} * 2; i += 2)); do
544-
accel-config config-wq --group-id=0 --mode=dedicated --size=128 --priority=10 --type=kernel --name="iaa_crypto" --driver_name="crypto" iax${i}/wq${i}
565+
accel-config config-wq --group-id=0 --mode=dedicated --wq-size=128 --priority=10 --type=kernel --name="iaa_crypto" --driver-name="crypto" iax${i}/wq${i}.0
566+
accel-config config-engine iax${i}/engine${i}.0 --group-id=0
545567
done
546568

547569
echo "End Configure IAA"
@@ -552,10 +574,10 @@ The below script automatically does that::
552574
echo "Enable IAA"
553575

554576
for ((i = 1; i < ${num_iaa} * 2; i += 2)); do
555-
echo enable iaa iaa${i}
556-
accel-config enable-device iaa${i}
557-
echo enable wq iaa${i}/wq${i}.0
558-
accel-config enable-wq iaa${i}/wq${i}.0
577+
echo enable iaa iax${i}
578+
accel-config enable-device iax${i}
579+
echo enable wq iax${i}/wq${i}.0
580+
accel-config enable-wq iax${i}/wq${i}.0
559581
done
560582

561583
echo "End Enable IAA"

0 commit comments

Comments
 (0)