kernel: bump 5.4 to 5.4.92
[openwrt/openwrt.git] / target / linux / generic / hack-5.4 / 260-crypto_test_dependencies.patch
1 From fd1799b0bf5efa46dd3e6dfbbf3955564807e508 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Fri, 7 Jul 2017 17:12:51 +0200
4 Subject: kernel: prevent cryptomgr from pulling in useless extra dependencies for tests that are not run
5
6 Reduces kernel size after LZMA by about 5k on MIPS
7
8 lede-commit: 044c316167e076479a344c59905e5b435b84a77f
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 ---
11 crypto/Kconfig | 13 ++++++-------
12 crypto/algboss.c | 4 ++++
13 2 files changed, 10 insertions(+), 7 deletions(-)
14
15 --- a/crypto/Kconfig
16 +++ b/crypto/Kconfig
17 @@ -120,13 +120,13 @@ config CRYPTO_MANAGER
18 cbc(aes).
19
20 config CRYPTO_MANAGER2
21 - def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
22 - select CRYPTO_AEAD2
23 - select CRYPTO_HASH2
24 - select CRYPTO_BLKCIPHER2
25 - select CRYPTO_AKCIPHER2
26 - select CRYPTO_KPP2
27 - select CRYPTO_ACOMP2
28 + def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y && !CRYPTO_MANAGER_DISABLE_TESTS)
29 + select CRYPTO_AEAD2 if !CRYPTO_MANAGER_DISABLE_TESTS
30 + select CRYPTO_HASH2 if !CRYPTO_MANAGER_DISABLE_TESTS
31 + select CRYPTO_BLKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS
32 + select CRYPTO_AKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS
33 + select CRYPTO_KPP2 if !CRYPTO_MANAGER_DISABLE_TESTS
34 + select CRYPTO_ACOMP2 if !CRYPTO_MANAGER_DISABLE_TESTS
35
36 config CRYPTO_USER
37 tristate "Userspace cryptographic algorithm configuration"
38 @@ -136,8 +136,6 @@ config CRYPTO_USER
39 Userspace configuration for cryptographic instantiations such as
40 cbc(aes).
41
42 -if CRYPTO_MANAGER2
43 -
44 config CRYPTO_MANAGER_DISABLE_TESTS
45 bool "Disable run-time self tests"
46 default y
47 @@ -145,6 +143,8 @@ config CRYPTO_MANAGER_DISABLE_TESTS
48 Disable run-time self tests that normally take place at
49 algorithm registration.
50
51 +if CRYPTO_MANAGER2
52 +
53 config CRYPTO_MANAGER_EXTRA_TESTS
54 bool "Enable extra run-time crypto self tests"
55 depends on DEBUG_KERNEL && !CRYPTO_MANAGER_DISABLE_TESTS
56 --- a/crypto/algboss.c
57 +++ b/crypto/algboss.c
58 @@ -240,8 +240,12 @@ static int cryptomgr_schedule_test(struc
59 type = alg->cra_flags;
60
61 /* Do not test internal algorithms. */
62 +#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
63 + type |= CRYPTO_ALG_TESTED;
64 +#else
65 if (type & CRYPTO_ALG_INTERNAL)
66 type |= CRYPTO_ALG_TESTED;
67 +#endif
68
69 param->type = type;
70