forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v5.19-p1' of git://git.kernel.org/pub/scm/linux/kernel/git…
…/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Test in-place en/decryption with two sglists in testmgr - Fix process vs softirq race in cryptd Algorithms: - Add arm64 acceleration for sm4 - Add s390 acceleration for chacha20 Drivers: - Add polarfire soc hwrng support in mpsf - Add support for TI SoC AM62x in sa2ul - Add support for ATSHA204 cryptochip in atmel-sha204a - Add support for PRNG in caam - Restore support for storage encryption in qat - Restore support for storage encryption in hisilicon/sec" * tag 'v5.19-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (116 commits) hwrng: omap3-rom - fix using wrong clk_disable() in omap_rom_rng_runtime_resume() crypto: hisilicon/sec - delete the flag CRYPTO_ALG_ALLOCATES_MEMORY crypto: qat - add support for 401xx devices crypto: qat - re-enable registration of algorithms crypto: qat - honor CRYPTO_TFM_REQ_MAY_SLEEP flag crypto: qat - add param check for DH crypto: qat - add param check for RSA crypto: qat - remove dma_free_coherent() for DH crypto: qat - remove dma_free_coherent() for RSA crypto: qat - fix memory leak in RSA crypto: qat - add backlog mechanism crypto: qat - refactor submission logic crypto: qat - use pre-allocated buffers in datapath crypto: qat - set to zero DH parameters before free crypto: s390 - add crypto library interface for ChaCha20 crypto: talitos - Uniform coding style with defined variable crypto: octeontx2 - simplify the return expression of otx2_cpt_aead_cbc_aes_sha_setkey() crypto: cryptd - Protect per-CPU resource by disabling BH. crypto: sun8i-ce - do not fallback if cryptlen is less than sg length crypto: sun8i-ce - rework debugging ...
- Loading branch information
Showing
118 changed files
with
5,534 additions
and
1,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,20 @@ Description: Dump the status of the QM. | |
Four states: initiated, started, stopped and closed. | ||
Available for both PF and VF, and take no other effect on HPRE. | ||
|
||
What: /sys/kernel/debug/hisi_hpre/<bdf>/qm/diff_regs | ||
Date: Mar 2022 | ||
Contact: [email protected] | ||
Description: QM debug registers(regs) read hardware register value. This | ||
node is used to show the change of the qm register values. This | ||
node can be help users to check the change of register values. | ||
|
||
What: /sys/kernel/debug/hisi_hpre/<bdf>/hpre_dfx/diff_regs | ||
Date: Mar 2022 | ||
Contact: [email protected] | ||
Description: HPRE debug registers(regs) read hardware register value. This | ||
node is used to show the change of the register values. This | ||
node can be help users to check the change of register values. | ||
|
||
What: /sys/kernel/debug/hisi_hpre/<bdf>/hpre_dfx/send_cnt | ||
Date: Apr 2020 | ||
Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,20 @@ Description: Dump the status of the QM. | |
Four states: initiated, started, stopped and closed. | ||
Available for both PF and VF, and take no other effect on SEC. | ||
|
||
What: /sys/kernel/debug/hisi_sec2/<bdf>/qm/diff_regs | ||
Date: Mar 2022 | ||
Contact: [email protected] | ||
Description: QM debug registers(regs) read hardware register value. This | ||
node is used to show the change of the qm register values. This | ||
node can be help users to check the change of register values. | ||
|
||
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/diff_regs | ||
Date: Mar 2022 | ||
Contact: [email protected] | ||
Description: SEC debug registers(regs) read hardware register value. This | ||
node is used to show the change of the register values. This | ||
node can be help users to check the change of register values. | ||
|
||
What: /sys/kernel/debug/hisi_sec2/<bdf>/sec_dfx/send_cnt | ||
Date: Apr 2020 | ||
Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,20 @@ Description: Dump the status of the QM. | |
Four states: initiated, started, stopped and closed. | ||
Available for both PF and VF, and take no other effect on ZIP. | ||
|
||
What: /sys/kernel/debug/hisi_zip/<bdf>/qm/diff_regs | ||
Date: Mar 2022 | ||
Contact: [email protected] | ||
Description: QM debug registers(regs) read hardware register value. This | ||
node is used to show the change of the qm registers value. This | ||
node can be help users to check the change of register values. | ||
|
||
What: /sys/kernel/debug/hisi_zip/<bdf>/zip_dfx/diff_regs | ||
Date: Mar 2022 | ||
Contact: [email protected] | ||
Description: ZIP debug registers(regs) read hardware register value. This | ||
node is used to show the change of the registers value. this | ||
node can be help users to check the change of register values. | ||
|
||
What: /sys/kernel/debug/hisi_zip/<bdf>/zip_dfx/send_cnt | ||
Date: Apr 2020 | ||
Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
What: /sys/bus/pci/devices/<BDF>/fused_part | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/fused_part file reports | ||
whether the CPU or APU has been fused to prevent tampering. | ||
0: Not fused | ||
1: Fused | ||
|
||
What: /sys/bus/pci/devices/<BDF>/debug_lock_on | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/debug_lock_on reports | ||
whether the AMD CPU or APU has been unlocked for debugging. | ||
Possible values: | ||
0: Not locked | ||
1: Locked | ||
|
||
What: /sys/bus/pci/devices/<BDF>/tsme_status | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/tsme_status file reports | ||
the status of transparent secure memory encryption on AMD systems. | ||
Possible values: | ||
0: Not active | ||
1: Active | ||
|
||
What: /sys/bus/pci/devices/<BDF>/anti_rollback_status | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/anti_rollback_status file reports | ||
whether the PSP is enforcing rollback protection. | ||
Possible values: | ||
0: Not enforcing | ||
1: Enforcing | ||
|
||
What: /sys/bus/pci/devices/<BDF>/rpmc_production_enabled | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/rpmc_production_enabled file reports | ||
whether Replay Protected Monotonic Counter support has been enabled. | ||
Possible values: | ||
0: Not enabled | ||
1: Enabled | ||
|
||
What: /sys/bus/pci/devices/<BDF>/rpmc_spirom_available | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/rpmc_spirom_available file reports | ||
whether an Replay Protected Monotonic Counter supported SPI is installed | ||
on the system. | ||
Possible values: | ||
0: Not present | ||
1: Present | ||
|
||
What: /sys/bus/pci/devices/<BDF>/hsp_tpm_available | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/hsp_tpm_available file reports | ||
whether the HSP TPM has been activated. | ||
Possible values: | ||
0: Not activated or present | ||
1: Activated | ||
|
||
What: /sys/bus/pci/devices/<BDF>/rom_armor_enforced | ||
Date: June 2022 | ||
KernelVersion: 5.19 | ||
Contact: [email protected] | ||
Description: | ||
The /sys/bus/pci/devices/<BDF>/rom_armor_enforced file reports | ||
whether RomArmor SPI protection is enforced. | ||
Possible values: | ||
0: Not enforced | ||
1: Enforced |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ properties: | |
- ti,j721e-sa2ul | ||
- ti,am654-sa2ul | ||
- ti,am64-sa2ul | ||
- ti,am62-sa3ul | ||
|
||
reg: | ||
maxItems: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
|
||
#include <linux/linkage.h> | ||
#include <asm/assembler.h> | ||
|
||
.irp b, 0, 1, 2, 3, 4, 5, 6, 7, 8 | ||
.set .Lv\b\().4s, \b | ||
.endr | ||
|
||
.macro sm4e, rd, rn | ||
.inst 0xcec08400 | .L\rd | (.L\rn << 5) | ||
.endm | ||
|
||
/* | ||
* void sm4_ce_do_crypt(const u32 *rk, u32 *out, const u32 *in); | ||
*/ | ||
.text | ||
SYM_FUNC_START(sm4_ce_do_crypt) | ||
ld1 {v8.4s}, [x2] | ||
ld1 {v0.4s-v3.4s}, [x0], #64 | ||
CPU_LE( rev32 v8.16b, v8.16b ) | ||
ld1 {v4.4s-v7.4s}, [x0] | ||
sm4e v8.4s, v0.4s | ||
sm4e v8.4s, v1.4s | ||
sm4e v8.4s, v2.4s | ||
sm4e v8.4s, v3.4s | ||
sm4e v8.4s, v4.4s | ||
sm4e v8.4s, v5.4s | ||
sm4e v8.4s, v6.4s | ||
sm4e v8.4s, v7.4s | ||
rev64 v8.4s, v8.4s | ||
ext v8.16b, v8.16b, v8.16b, #8 | ||
CPU_LE( rev32 v8.16b, v8.16b ) | ||
st1 {v8.4s}, [x1] | ||
ret | ||
SYM_FUNC_END(sm4_ce_do_crypt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
|
||
#include <asm/neon.h> | ||
#include <asm/simd.h> | ||
#include <crypto/sm4.h> | ||
#include <crypto/internal/simd.h> | ||
#include <linux/module.h> | ||
#include <linux/cpufeature.h> | ||
#include <linux/crypto.h> | ||
#include <linux/types.h> | ||
|
||
MODULE_ALIAS_CRYPTO("sm4"); | ||
MODULE_ALIAS_CRYPTO("sm4-ce"); | ||
MODULE_DESCRIPTION("SM4 symmetric cipher using ARMv8 Crypto Extensions"); | ||
MODULE_AUTHOR("Ard Biesheuvel <[email protected]>"); | ||
MODULE_LICENSE("GPL v2"); | ||
|
||
asmlinkage void sm4_ce_do_crypt(const u32 *rk, void *out, const void *in); | ||
|
||
static int sm4_ce_setkey(struct crypto_tfm *tfm, const u8 *key, | ||
unsigned int key_len) | ||
{ | ||
struct sm4_ctx *ctx = crypto_tfm_ctx(tfm); | ||
|
||
return sm4_expandkey(ctx, key, key_len); | ||
} | ||
|
||
static void sm4_ce_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) | ||
{ | ||
const struct sm4_ctx *ctx = crypto_tfm_ctx(tfm); | ||
|
||
if (!crypto_simd_usable()) { | ||
sm4_crypt_block(ctx->rkey_enc, out, in); | ||
} else { | ||
kernel_neon_begin(); | ||
sm4_ce_do_crypt(ctx->rkey_enc, out, in); | ||
kernel_neon_end(); | ||
} | ||
} | ||
|
||
static void sm4_ce_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) | ||
{ | ||
const struct sm4_ctx *ctx = crypto_tfm_ctx(tfm); | ||
|
||
if (!crypto_simd_usable()) { | ||
sm4_crypt_block(ctx->rkey_dec, out, in); | ||
} else { | ||
kernel_neon_begin(); | ||
sm4_ce_do_crypt(ctx->rkey_dec, out, in); | ||
kernel_neon_end(); | ||
} | ||
} | ||
|
||
static struct crypto_alg sm4_ce_alg = { | ||
.cra_name = "sm4", | ||
.cra_driver_name = "sm4-ce", | ||
.cra_priority = 300, | ||
.cra_flags = CRYPTO_ALG_TYPE_CIPHER, | ||
.cra_blocksize = SM4_BLOCK_SIZE, | ||
.cra_ctxsize = sizeof(struct sm4_ctx), | ||
.cra_module = THIS_MODULE, | ||
.cra_u.cipher = { | ||
.cia_min_keysize = SM4_KEY_SIZE, | ||
.cia_max_keysize = SM4_KEY_SIZE, | ||
.cia_setkey = sm4_ce_setkey, | ||
.cia_encrypt = sm4_ce_encrypt, | ||
.cia_decrypt = sm4_ce_decrypt | ||
} | ||
}; | ||
|
||
static int __init sm4_ce_mod_init(void) | ||
{ | ||
return crypto_register_alg(&sm4_ce_alg); | ||
} | ||
|
||
static void __exit sm4_ce_mod_fini(void) | ||
{ | ||
crypto_unregister_alg(&sm4_ce_alg); | ||
} | ||
|
||
module_cpu_feature_match(SM4, sm4_ce_mod_init); | ||
module_exit(sm4_ce_mod_fini); |
Oops, something went wrong.