Skip to content

Commit 87d7bce

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu: - add multibuffer infrastructure (single_task_running scheduler helper, OKed by Peter on lkml. - add SHA1 multibuffer implementation for AVX2. - reenable "by8" AVX CTR optimisation after fixing counter overflow. - add APM X-Gene SoC RNG support. - SHA256/SHA512 now handles unaligned input correctly. - set lz4 decompressed length correctly. - fix algif socket buffer allocation failure for 64K page machines. - misc fixes * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (47 commits) crypto: sha - Handle unaligned input data in generic sha256 and sha512. Revert "crypto: aesni - disable "by8" AVX CTR optimization" crypto: aesni - remove unused defines in "by8" variant crypto: aesni - fix counter overflow handling in "by8" variant hwrng: printk replacement crypto: qat - Removed unneeded partial state crypto: qat - Fix typo in name of tasklet_struct crypto: caam - Dynamic allocation of addresses for various memory blocks in CAAM. crypto: mcryptd - Fix typos in CRYPTO_MCRYPTD description crypto: algif - avoid excessive use of socket buffer in skcipher arm64: dts: add random number generator dts node to APM X-Gene platform. Documentation: rng: Add X-Gene SoC RNG driver documentation hwrng: xgene - add support for APM X-Gene SoC RNG support crypto: mv_cesa - Add missing #define crypto: testmgr - add test for lz4 and lz4hc crypto: lz4,lz4hc - fix decompression crypto: qat - Use pci_enable_msix_exact() instead of pci_enable_msix() crypto: drbg - fix maximum value checks on 32 bit systems crypto: drbg - fix sparse warning for cpu_to_be[32|64] crypto: sha-mb - sha1_mb_alg_state can be static ...
2 parents 0223f9a + be34c4e commit 87d7bce

50 files changed

Lines changed: 4706 additions & 837 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
APM X-Gene SoC random number generator.
2+
3+
Required properties:
4+
5+
- compatible : should be "apm,xgene-rng"
6+
- reg : specifies base physical address and size of the registers map
7+
- clocks : phandle to clock-controller plus clock-specifier pair
8+
- interrupts : specify the fault interrupt for the RNG device
9+
10+
Example:
11+
12+
rng: rng@10520000 {
13+
compatible = "apm,xgene-rng";
14+
reg = <0x0 0x10520000 0x0 0x100>;
15+
interrupts = <0x0 0x41 0x4>;
16+
clocks = <&rngpkaclk 0>;
17+
};

‎arch/arm64/boot/dts/apm-storm.dtsi‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,19 @@
269269
enable-mask = <0x2>;
270270
clock-output-names = "rtcclk";
271271
};
272+
273+
rngpkaclk: rngpkaclk@17000000 {
274+
compatible = "apm,xgene-device-clock";
275+
#clock-cells = <1>;
276+
clocks = <&socplldiv2 0>;
277+
reg = <0x0 0x17000000 0x0 0x2000>;
278+
reg-names = "csr-reg";
279+
csr-offset = <0xc>;
280+
csr-mask = <0x10>;
281+
enable-offset = <0x10>;
282+
enable-mask = <0x10>;
283+
clock-output-names = "rngpkaclk";
284+
};
272285
};
273286

274287
serial0: serial@1c020000 {
@@ -421,5 +434,13 @@
421434

422435
};
423436
};
437+
438+
rng: rng@10520000 {
439+
compatible = "apm,xgene-rng";
440+
reg = <0x0 0x10520000 0x0 0x100>;
441+
interrupts = <0x0 0x41 0x4>;
442+
clocks = <&rngpkaclk 0>;
443+
};
444+
424445
};
425446
};

‎arch/x86/crypto/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
2626

2727
obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o
2828
obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o
29+
obj-$(CONFIG_CRYPTO_SHA1_MB) += sha-mb/
2930
obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o
3031
obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o
3132
obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o

‎arch/x86/crypto/aes_ctrby8_avx-x86_64.S‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@
7979
#define xcounter %xmm8
8080
#define xbyteswap %xmm9
8181
#define xkey0 %xmm10
82-
#define xkey3 %xmm11
83-
#define xkey6 %xmm12
84-
#define xkey9 %xmm13
8582
#define xkey4 %xmm11
8683
#define xkey8 %xmm12
8784
#define xkey12 %xmm13
@@ -108,6 +105,10 @@
108105

109106
byteswap_const:
110107
.octa 0x000102030405060708090A0B0C0D0E0F
108+
ddq_low_msk:
109+
.octa 0x0000000000000000FFFFFFFFFFFFFFFF
110+
ddq_high_add_1:
111+
.octa 0x00000000000000010000000000000000
111112
ddq_add_1:
112113
.octa 0x00000000000000000000000000000001
113114
ddq_add_2:
@@ -169,7 +170,12 @@ ddq_add_8:
169170
.rept (by - 1)
170171
club DDQ_DATA, i
171172
club XDATA, i
172-
vpaddd var_ddq_add(%rip), xcounter, var_xdata
173+
vpaddq var_ddq_add(%rip), xcounter, var_xdata
174+
vptest ddq_low_msk(%rip), var_xdata
175+
jnz 1f
176+
vpaddq ddq_high_add_1(%rip), var_xdata, var_xdata
177+
vpaddq ddq_high_add_1(%rip), xcounter, xcounter
178+
1:
173179
vpshufb xbyteswap, var_xdata, var_xdata
174180
.set i, (i +1)
175181
.endr
@@ -178,7 +184,11 @@ ddq_add_8:
178184

179185
vpxor xkey0, xdata0, xdata0
180186
club DDQ_DATA, by
181-
vpaddd var_ddq_add(%rip), xcounter, xcounter
187+
vpaddq var_ddq_add(%rip), xcounter, xcounter
188+
vptest ddq_low_msk(%rip), xcounter
189+
jnz 1f
190+
vpaddq ddq_high_add_1(%rip), xcounter, xcounter
191+
1:
182192

183193
.set i, 1
184194
.rept (by - 1)

‎arch/x86/crypto/aesni-intel_glue.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ static void ctr_crypt_final(struct crypto_aes_ctx *ctx,
481481
crypto_inc(ctrblk, AES_BLOCK_SIZE);
482482
}
483483

484-
#if 0 /* temporary disabled due to failing crypto tests */
484+
#ifdef CONFIG_AS_AVX
485485
static void aesni_ctr_enc_avx_tfm(struct crypto_aes_ctx *ctx, u8 *out,
486486
const u8 *in, unsigned int len, u8 *iv)
487487
{
@@ -1522,7 +1522,7 @@ static int __init aesni_init(void)
15221522
aesni_gcm_dec_tfm = aesni_gcm_dec;
15231523
}
15241524
aesni_ctr_enc_tfm = aesni_ctr_enc;
1525-
#if 0 /* temporary disabled due to failing crypto tests */
1525+
#ifdef CONFIG_AS_AVX
15261526
if (cpu_has_avx) {
15271527
/* optimize performance of ctr mode encryption transform */
15281528
aesni_ctr_enc_tfm = aesni_ctr_enc_avx_tfm;

‎arch/x86/crypto/sha-mb/Makefile‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Arch-specific CryptoAPI modules.
3+
#
4+
5+
avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1\
6+
$(comma)4)$(comma)%ymm2,yes,no)
7+
ifeq ($(avx2_supported),yes)
8+
obj-$(CONFIG_CRYPTO_SHA1_MB) += sha1-mb.o
9+
sha1-mb-y := sha1_mb.o sha1_mb_mgr_flush_avx2.o \
10+
sha1_mb_mgr_init_avx2.o sha1_mb_mgr_submit_avx2.o sha1_x8_avx2.o
11+
endif

0 commit comments

Comments
 (0)