Hi Herbert,
I love your patch! Yet something to improve:
[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master rockchip/for-next v5.7 next-20200611]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see
https://stackoverflow.com/a/37406982]
url:
https://github.com/0day-ci/linux/commits/Herbert-Xu/crypto-algapi-Remove-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
arch/powerpc/crypto/crc-vpmsum_test.c: In function 'crc_test_init':
> arch/powerpc/crypto/crc-vpmsum_test.c:78:20: error: implicit
declaration of function 'prandom_u32_max' [-Werror=implicit-function-declaration]
78 | size_t offset = prandom_u32_max(16);
| ^~~~~~~~~~~~~~~
> arch/powerpc/crypto/crc-vpmsum_test.c:83:4: error: implicit
declaration of function 'prandom_bytes' [-Werror=implicit-function-declaration]
83 | prandom_bytes(data, len);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/prandom_u32_max +78 arch/powerpc/crypto/crc-vpmsum_test.c
146c8688d99c574 Daniel Axtens 2017-03-15 20
146c8688d99c574 Daniel Axtens 2017-03-15 21
146c8688d99c574 Daniel Axtens 2017-03-15 22 static int __init crc_test_init(void)
146c8688d99c574 Daniel Axtens 2017-03-15 23 {
146c8688d99c574 Daniel Axtens 2017-03-15 24 u16 crc16 = 0, verify16 = 0;
146c8688d99c574 Daniel Axtens 2017-03-15 25 u32 crc32 = 0, verify32 = 0;
146c8688d99c574 Daniel Axtens 2017-03-15 26 __le32 verify32le = 0;
146c8688d99c574 Daniel Axtens 2017-03-15 27 unsigned char *data;
146c8688d99c574 Daniel Axtens 2017-03-15 28 unsigned long i;
146c8688d99c574 Daniel Axtens 2017-03-15 29 int ret;
146c8688d99c574 Daniel Axtens 2017-03-15 30
146c8688d99c574 Daniel Axtens 2017-03-15 31 struct crypto_shash *crct10dif_tfm;
146c8688d99c574 Daniel Axtens 2017-03-15 32 struct crypto_shash *crc32c_tfm;
146c8688d99c574 Daniel Axtens 2017-03-15 33
146c8688d99c574 Daniel Axtens 2017-03-15 34 if (!cpu_has_feature(CPU_FTR_ARCH_207S))
146c8688d99c574 Daniel Axtens 2017-03-15 35 return -ENODEV;
146c8688d99c574 Daniel Axtens 2017-03-15 36
146c8688d99c574 Daniel Axtens 2017-03-15 37 data = kmalloc(MAX_CRC_LENGTH,
GFP_KERNEL);
146c8688d99c574 Daniel Axtens 2017-03-15 38 if (!data)
146c8688d99c574 Daniel Axtens 2017-03-15 39 return -ENOMEM;
146c8688d99c574 Daniel Axtens 2017-03-15 40
146c8688d99c574 Daniel Axtens 2017-03-15 41 crct10dif_tfm =
crypto_alloc_shash("crct10dif", 0, 0);
146c8688d99c574 Daniel Axtens 2017-03-15 42
146c8688d99c574 Daniel Axtens 2017-03-15 43 if (IS_ERR(crct10dif_tfm)) {
146c8688d99c574 Daniel Axtens 2017-03-15 44 pr_err("Error allocating
crc-t10dif\n");
146c8688d99c574 Daniel Axtens 2017-03-15 45 goto free_buf;
146c8688d99c574 Daniel Axtens 2017-03-15 46 }
146c8688d99c574 Daniel Axtens 2017-03-15 47
146c8688d99c574 Daniel Axtens 2017-03-15 48 crc32c_tfm =
crypto_alloc_shash("crc32c", 0, 0);
146c8688d99c574 Daniel Axtens 2017-03-15 49
146c8688d99c574 Daniel Axtens 2017-03-15 50 if (IS_ERR(crc32c_tfm)) {
146c8688d99c574 Daniel Axtens 2017-03-15 51 pr_err("Error allocating
crc32c\n");
146c8688d99c574 Daniel Axtens 2017-03-15 52 goto free_16;
146c8688d99c574 Daniel Axtens 2017-03-15 53 }
146c8688d99c574 Daniel Axtens 2017-03-15 54
146c8688d99c574 Daniel Axtens 2017-03-15 55 do {
146c8688d99c574 Daniel Axtens 2017-03-15 56 SHASH_DESC_ON_STACK(crct10dif_shash,
crct10dif_tfm);
146c8688d99c574 Daniel Axtens 2017-03-15 57 SHASH_DESC_ON_STACK(crc32c_shash,
crc32c_tfm);
146c8688d99c574 Daniel Axtens 2017-03-15 58
146c8688d99c574 Daniel Axtens 2017-03-15 59 crct10dif_shash->tfm =
crct10dif_tfm;
146c8688d99c574 Daniel Axtens 2017-03-15 60 ret =
crypto_shash_init(crct10dif_shash);
146c8688d99c574 Daniel Axtens 2017-03-15 61
146c8688d99c574 Daniel Axtens 2017-03-15 62 if (ret) {
146c8688d99c574 Daniel Axtens 2017-03-15 63 pr_err("Error initing
crc-t10dif\n");
146c8688d99c574 Daniel Axtens 2017-03-15 64 goto free_32;
146c8688d99c574 Daniel Axtens 2017-03-15 65 }
146c8688d99c574 Daniel Axtens 2017-03-15 66
146c8688d99c574 Daniel Axtens 2017-03-15 67
146c8688d99c574 Daniel Axtens 2017-03-15 68 crc32c_shash->tfm = crc32c_tfm;
146c8688d99c574 Daniel Axtens 2017-03-15 69 ret = crypto_shash_init(crc32c_shash);
146c8688d99c574 Daniel Axtens 2017-03-15 70
146c8688d99c574 Daniel Axtens 2017-03-15 71 if (ret) {
146c8688d99c574 Daniel Axtens 2017-03-15 72 pr_err("Error initing
crc32c\n");
146c8688d99c574 Daniel Axtens 2017-03-15 73 goto free_32;
146c8688d99c574 Daniel Axtens 2017-03-15 74 }
146c8688d99c574 Daniel Axtens 2017-03-15 75
146c8688d99c574 Daniel Axtens 2017-03-15 76 pr_info("crc-vpmsum_test begins,
%lu iterations\n", iterations);
146c8688d99c574 Daniel Axtens 2017-03-15 77 for (i=0; i<iterations; i++) {
80d04b7fabe161a George Spelvin 2019-03-21 @78 size_t offset = prandom_u32_max(16);
80d04b7fabe161a George Spelvin 2019-03-21 79 size_t len =
prandom_u32_max(MAX_CRC_LENGTH);
146c8688d99c574 Daniel Axtens 2017-03-15 80
146c8688d99c574 Daniel Axtens 2017-03-15 81 if (len <= offset)
146c8688d99c574 Daniel Axtens 2017-03-15 82 continue;
80d04b7fabe161a George Spelvin 2019-03-21 @83 prandom_bytes(data, len);
146c8688d99c574 Daniel Axtens 2017-03-15 84 len -= offset;
146c8688d99c574 Daniel Axtens 2017-03-15 85
146c8688d99c574 Daniel Axtens 2017-03-15 86 crypto_shash_update(crct10dif_shash,
data+offset, len);
146c8688d99c574 Daniel Axtens 2017-03-15 87 crypto_shash_final(crct10dif_shash, (u8
*)(&crc16));
146c8688d99c574 Daniel Axtens 2017-03-15 88 verify16 = crc_t10dif_generic(verify16,
data+offset, len);
146c8688d99c574 Daniel Axtens 2017-03-15 89
146c8688d99c574 Daniel Axtens 2017-03-15 90
146c8688d99c574 Daniel Axtens 2017-03-15 91 if (crc16 != verify16) {
146c8688d99c574 Daniel Axtens 2017-03-15 92 pr_err("FAILURE in CRC16: got
0x%04x expected 0x%04x (len %lu)\n",
146c8688d99c574 Daniel Axtens 2017-03-15 93 crc16, verify16, len);
146c8688d99c574 Daniel Axtens 2017-03-15 94 break;
146c8688d99c574 Daniel Axtens 2017-03-15 95 }
146c8688d99c574 Daniel Axtens 2017-03-15 96
146c8688d99c574 Daniel Axtens 2017-03-15 97 crypto_shash_update(crc32c_shash,
data+offset, len);
146c8688d99c574 Daniel Axtens 2017-03-15 98 crypto_shash_final(crc32c_shash, (u8
*)(&crc32));
146c8688d99c574 Daniel Axtens 2017-03-15 99 verify32 = le32_to_cpu(verify32le);
146c8688d99c574 Daniel Axtens 2017-03-15 100 verify32le =
~cpu_to_le32(__crc32c_le(~verify32, data+offset, len));
146c8688d99c574 Daniel Axtens 2017-03-15 101 if (crc32 != (u32)verify32le) {
146c8688d99c574 Daniel Axtens 2017-03-15 102 pr_err("FAILURE in CRC32: got
0x%08x expected 0x%08x (len %lu)\n",
146c8688d99c574 Daniel Axtens 2017-03-15 103 crc32, verify32, len);
146c8688d99c574 Daniel Axtens 2017-03-15 104 break;
146c8688d99c574 Daniel Axtens 2017-03-15 105 }
9f0acf9f80ad504 Chris Smart 2019-11-03 106 cond_resched();
146c8688d99c574 Daniel Axtens 2017-03-15 107 }
146c8688d99c574 Daniel Axtens 2017-03-15 108 pr_info("crc-vpmsum_test done,
completed %lu iterations\n", i);
146c8688d99c574 Daniel Axtens 2017-03-15 109 } while (0);
146c8688d99c574 Daniel Axtens 2017-03-15 110
146c8688d99c574 Daniel Axtens 2017-03-15 111 free_32:
146c8688d99c574 Daniel Axtens 2017-03-15 112 crypto_free_shash(crc32c_tfm);
146c8688d99c574 Daniel Axtens 2017-03-15 113
146c8688d99c574 Daniel Axtens 2017-03-15 114 free_16:
146c8688d99c574 Daniel Axtens 2017-03-15 115 crypto_free_shash(crct10dif_tfm);
146c8688d99c574 Daniel Axtens 2017-03-15 116
146c8688d99c574 Daniel Axtens 2017-03-15 117 free_buf:
146c8688d99c574 Daniel Axtens 2017-03-15 118 kfree(data);
146c8688d99c574 Daniel Axtens 2017-03-15 119
146c8688d99c574 Daniel Axtens 2017-03-15 120 return 0;
146c8688d99c574 Daniel Axtens 2017-03-15 121 }
146c8688d99c574 Daniel Axtens 2017-03-15 122
:::::: The code at line 78 was first introduced by commit
:::::: 80d04b7fabe161a23d143b3bfcfca1b002c23da1 powerpc/crypto: Use cheaper random numbers
for crc-vpmsum self-test
:::::: TO: George Spelvin <lkml(a)sdf.org>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org