Skip to content

Commit 5d95ff8

Browse files
committed
Merge tag 'v6.5-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: "API: - Add linear akcipher/sig API - Add tfm cloning (hmac, cmac) - Add statesize to crypto_ahash Algorithms: - Allow only odd e and restrict value in FIPS mode for RSA - Replace LFSR with SHA3-256 in jitter - Add interface for gathering of raw entropy in jitter Drivers: - Fix race on data_avail and actual data in hwrng/virtio - Add hash and HMAC support in starfive - Add RSA algo support in starfive - Add support for PCI device 0x156E in ccp" * tag 'v6.5-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (85 commits) crypto: akcipher - Do not copy dst if it is NULL crypto: sig - Fix verify call crypto: akcipher - Set request tfm on sync path crypto: sm2 - Provide sm2_compute_z_digest when sm2 is disabled hwrng: imx-rngc - switch to DEFINE_SIMPLE_DEV_PM_OPS hwrng: st - keep clock enabled while hwrng is registered hwrng: st - support compile-testing hwrng: imx-rngc - fix the timeout for init and self check KEYS: asymmetric: Use new crypto interface without scatterlists KEYS: asymmetric: Move sm2 code into x509_public_key KEYS: Add forward declaration in asymmetric-parser.h crypto: sig - Add interface for sign/verify crypto: akcipher - Add sync interface without SG lists crypto: cipher - On clone do crypto_mod_get() crypto: api - Add __crypto_alloc_tfmgfp crypto: api - Remove crypto_init_ops() crypto: rsa - allow only odd e and restrict value in FIPS mode crypto: geniv - Split geniv out of AEAD Kconfig option crypto: algboss - Add missing dependency on RNG2 crypto: starfive - Add RSA algo support ...
2 parents d85a143 + 486bfb0 commit 5d95ff8

File tree

116 files changed

+4942
-971
lines changed

Some content is hidden

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

116 files changed

+4942
-971
lines changed

Documentation/ABI/testing/sysfs-driver-qat

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,18 @@ Description: (RW) Reports the current configuration of the QAT device.
2727

2828
* sym;asym: the device is configured for running crypto
2929
services
30+
* asym;sym: identical to sym;asym
3031
* dc: the device is configured for running compression services
32+
* sym: the device is configured for running symmetric crypto
33+
services
34+
* asym: the device is configured for running asymmetric crypto
35+
services
36+
* asym;dc: the device is configured for running asymmetric
37+
crypto services and compression services
38+
* dc;asym: identical to asym;dc
39+
* sym;dc: the device is configured for running symmetric crypto
40+
services and compression services
41+
* dc;sym: identical to sym;dc
3142

3243
It is possible to set the configuration only if the device
3344
is in the `down` state (see /sys/bus/pci/devices/<BDF>/qat/state)
@@ -47,3 +58,38 @@ Description: (RW) Reports the current configuration of the QAT device.
4758
dc
4859

4960
This attribute is only available for qat_4xxx devices.
61+
62+
What: /sys/bus/pci/devices/<BDF>/qat/pm_idle_enabled
63+
Date: June 2023
64+
KernelVersion: 6.5
65+
66+
Description: (RW) This configuration option provides a way to force the device into remaining in
67+
the MAX power state.
68+
If idle support is enabled the device will transition to the `MIN` power state when
69+
idle, otherwise will stay in the MAX power state.
70+
Write to the file to enable or disable idle support.
71+
72+
The values are:
73+
74+
* 0: idle support is disabled
75+
* 1: idle support is enabled
76+
77+
Default value is 1.
78+
79+
It is possible to set the pm_idle_enabled value only if the device
80+
is in the `down` state (see /sys/bus/pci/devices/<BDF>/qat/state)
81+
82+
The following example shows how to change the pm_idle_enabled of
83+
a device::
84+
85+
# cat /sys/bus/pci/devices/<BDF>/qat/state
86+
up
87+
# cat /sys/bus/pci/devices/<BDF>/qat/pm_idle_enabled
88+
1
89+
# echo down > /sys/bus/pci/devices/<BDF>/qat/state
90+
# echo 0 > /sys/bus/pci/devices/<BDF>/qat/pm_idle_enabled
91+
# echo up > /sys/bus/pci/devices/<BDF>/qat/state
92+
# cat /sys/bus/pci/devices/<BDF>/qat/pm_idle_enabled
93+
0
94+
95+
This attribute is only available for qat_4xxx devices.

Documentation/devicetree/bindings/crypto/qcom-qce.yaml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ properties:
2424
deprecated: true
2525
description: Kept only for ABI backward compatibility
2626

27+
- items:
28+
- enum:
29+
- qcom,ipq4019-qce
30+
- qcom,sm8150-qce
31+
- const: qcom,qce
32+
2733
- items:
2834
- enum:
2935
- qcom,ipq6018-qce
3036
- qcom,ipq8074-qce
3137
- qcom,msm8996-qce
38+
- qcom,qcm2290-qce
3239
- qcom,sdm845-qce
40+
- qcom,sm6115-qce
3341
- const: qcom,ipq4019-qce
3442
- const: qcom,qce
3543

@@ -46,16 +54,12 @@ properties:
4654
maxItems: 1
4755

4856
clocks:
49-
items:
50-
- description: iface clocks register interface.
51-
- description: bus clocks data transfer interface.
52-
- description: core clocks rest of the crypto block.
57+
minItems: 1
58+
maxItems: 3
5359

5460
clock-names:
55-
items:
56-
- const: iface
57-
- const: bus
58-
- const: core
61+
minItems: 1
62+
maxItems: 3
5963

6064
iommus:
6165
minItems: 1
@@ -89,9 +93,37 @@ allOf:
8993
enum:
9094
- qcom,crypto-v5.1
9195
- qcom,crypto-v5.4
92-
- qcom,ipq4019-qce
96+
- qcom,ipq6018-qce
97+
- qcom,ipq8074-qce
98+
- qcom,msm8996-qce
99+
- qcom,sdm845-qce
100+
then:
101+
properties:
102+
clocks:
103+
maxItems: 3
104+
clock-names:
105+
items:
106+
- const: iface
107+
- const: bus
108+
- const: core
109+
required:
110+
- clocks
111+
- clock-names
93112

113+
- if:
114+
properties:
115+
compatible:
116+
contains:
117+
enum:
118+
- qcom,qcm2290-qce
119+
- qcom,sm6115-qce
94120
then:
121+
properties:
122+
clocks:
123+
maxItems: 1
124+
clock-names:
125+
items:
126+
- const: core
95127
required:
96128
- clocks
97129
- clock-names
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/crypto/starfive,jh7110-crypto.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: StarFive Cryptographic Module
8+
9+
maintainers:
10+
- Jia Jie Ho <[email protected]>
11+
- William Qiu <[email protected]>
12+
13+
properties:
14+
compatible:
15+
const: starfive,jh7110-crypto
16+
17+
reg:
18+
maxItems: 1
19+
20+
clocks:
21+
items:
22+
- description: Hardware reference clock
23+
- description: AHB reference clock
24+
25+
clock-names:
26+
items:
27+
- const: hclk
28+
- const: ahb
29+
30+
interrupts:
31+
maxItems: 1
32+
33+
resets:
34+
maxItems: 1
35+
36+
dmas:
37+
items:
38+
- description: TX DMA channel
39+
- description: RX DMA channel
40+
41+
dma-names:
42+
items:
43+
- const: tx
44+
- const: rx
45+
46+
required:
47+
- compatible
48+
- reg
49+
- clocks
50+
- clock-names
51+
- resets
52+
- dmas
53+
- dma-names
54+
55+
additionalProperties: false
56+
57+
examples:
58+
- |
59+
crypto: crypto@16000000 {
60+
compatible = "starfive,jh7110-crypto";
61+
reg = <0x16000000 0x4000>;
62+
clocks = <&clk 15>, <&clk 16>;
63+
clock-names = "hclk", "ahb";
64+
interrupts = <28>;
65+
resets = <&reset 3>;
66+
dmas = <&dma 1 2>,
67+
<&dma 0 2>;
68+
dma-names = "tx", "rx";
69+
};
70+
...

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20265,6 +20265,13 @@ F: Documentation/devicetree/bindings/clock/starfive,jh71*.yaml
2026520265
F: drivers/clk/starfive/clk-starfive-jh71*
2026620266
F: include/dt-bindings/clock/starfive?jh71*.h
2026720267

20268+
STARFIVE CRYPTO DRIVER
20269+
M: Jia Jie Ho <[email protected]>
20270+
M: William Qiu <[email protected]>
20271+
S: Supported
20272+
F: Documentation/devicetree/bindings/crypto/starfive*
20273+
F: drivers/crypto/starfive/
20274+
2026820275
STARFIVE JH71X0 PINCTRL DRIVERS
2026920276
M: Emil Renner Berthing <[email protected]>
2027020277
M: Jianlong Huang <[email protected]>

arch/arm/crypto/sha1_neon_glue.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
#include "sha1.h"
2828

29-
asmlinkage void sha1_transform_neon(void *state_h, const char *data,
30-
unsigned int rounds);
29+
asmlinkage void sha1_transform_neon(struct sha1_state *state_h,
30+
const u8 *data, int rounds);
3131

3232
static int sha1_neon_update(struct shash_desc *desc, const u8 *data,
3333
unsigned int len)
@@ -39,8 +39,7 @@ static int sha1_neon_update(struct shash_desc *desc, const u8 *data,
3939
return sha1_update_arm(desc, data, len);
4040

4141
kernel_neon_begin();
42-
sha1_base_do_update(desc, data, len,
43-
(sha1_block_fn *)sha1_transform_neon);
42+
sha1_base_do_update(desc, data, len, sha1_transform_neon);
4443
kernel_neon_end();
4544

4645
return 0;
@@ -54,9 +53,8 @@ static int sha1_neon_finup(struct shash_desc *desc, const u8 *data,
5453

5554
kernel_neon_begin();
5655
if (len)
57-
sha1_base_do_update(desc, data, len,
58-
(sha1_block_fn *)sha1_transform_neon);
59-
sha1_base_do_finalize(desc, (sha1_block_fn *)sha1_transform_neon);
56+
sha1_base_do_update(desc, data, len, sha1_transform_neon);
57+
sha1_base_do_finalize(desc, sha1_transform_neon);
6058
kernel_neon_end();
6159

6260
return sha1_base_finish(desc, out);

arch/arm/crypto/sha256_neon_glue.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
#include "sha256_glue.h"
2323

24-
asmlinkage void sha256_block_data_order_neon(u32 *digest, const void *data,
25-
unsigned int num_blks);
24+
asmlinkage void sha256_block_data_order_neon(struct sha256_state *digest,
25+
const u8 *data, int num_blks);
2626

2727
static int crypto_sha256_neon_update(struct shash_desc *desc, const u8 *data,
2828
unsigned int len)
@@ -34,8 +34,7 @@ static int crypto_sha256_neon_update(struct shash_desc *desc, const u8 *data,
3434
return crypto_sha256_arm_update(desc, data, len);
3535

3636
kernel_neon_begin();
37-
sha256_base_do_update(desc, data, len,
38-
(sha256_block_fn *)sha256_block_data_order_neon);
37+
sha256_base_do_update(desc, data, len, sha256_block_data_order_neon);
3938
kernel_neon_end();
4039

4140
return 0;
@@ -50,9 +49,8 @@ static int crypto_sha256_neon_finup(struct shash_desc *desc, const u8 *data,
5049
kernel_neon_begin();
5150
if (len)
5251
sha256_base_do_update(desc, data, len,
53-
(sha256_block_fn *)sha256_block_data_order_neon);
54-
sha256_base_do_finalize(desc,
55-
(sha256_block_fn *)sha256_block_data_order_neon);
52+
sha256_block_data_order_neon);
53+
sha256_base_do_finalize(desc, sha256_block_data_order_neon);
5654
kernel_neon_end();
5755

5856
return sha256_base_finish(desc, out);

arch/arm/crypto/sha512-neon-glue.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
MODULE_ALIAS_CRYPTO("sha384-neon");
2121
MODULE_ALIAS_CRYPTO("sha512-neon");
2222

23-
asmlinkage void sha512_block_data_order_neon(u64 *state, u8 const *src,
24-
int blocks);
23+
asmlinkage void sha512_block_data_order_neon(struct sha512_state *state,
24+
const u8 *src, int blocks);
2525

2626
static int sha512_neon_update(struct shash_desc *desc, const u8 *data,
2727
unsigned int len)
@@ -33,8 +33,7 @@ static int sha512_neon_update(struct shash_desc *desc, const u8 *data,
3333
return sha512_arm_update(desc, data, len);
3434

3535
kernel_neon_begin();
36-
sha512_base_do_update(desc, data, len,
37-
(sha512_block_fn *)sha512_block_data_order_neon);
36+
sha512_base_do_update(desc, data, len, sha512_block_data_order_neon);
3837
kernel_neon_end();
3938

4039
return 0;
@@ -49,9 +48,8 @@ static int sha512_neon_finup(struct shash_desc *desc, const u8 *data,
4948
kernel_neon_begin();
5049
if (len)
5150
sha512_base_do_update(desc, data, len,
52-
(sha512_block_fn *)sha512_block_data_order_neon);
53-
sha512_base_do_finalize(desc,
54-
(sha512_block_fn *)sha512_block_data_order_neon);
51+
sha512_block_data_order_neon);
52+
sha512_base_do_finalize(desc, sha512_block_data_order_neon);
5553
kernel_neon_end();
5654

5755
return sha512_base_finish(desc, out);

arch/arm64/crypto/sha256-glue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
#include <crypto/internal/simd.h>
1313
#include <crypto/sha2.h>
1414
#include <crypto/sha256_base.h>
15-
#include <linux/types.h>
15+
#include <linux/module.h>
1616
#include <linux/string.h>
17+
#include <linux/types.h>
1718

1819
MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash for arm64");
1920
MODULE_AUTHOR("Andy Polyakov <[email protected]>");

0 commit comments

Comments
 (0)