tree:
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.4.y
head: b956d57638aa031e0b660684c0152dd698ecf150
commit: 5b8516f3bedb3e1c273e7747b6e4a85c6e47907a [2653/12234] crypto: sa2ul: Add crypto
driver
config: xtensa-randconfig-s032-20201115 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-107-gaf3512a6-dirty
git remote add ti
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.4.y
git checkout 5b8516f3bedb3e1c273e7747b6e4a85c6e47907a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
> drivers/crypto/sa2ul.c:473:31: sparse: sparse: cast to restricted
__be32
> drivers/crypto/sa2ul.c:902:35: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned int [usertype] @@ got restricted
__be32 [usertype] @@
> drivers/crypto/sa2ul.c:902:35: sparse: expected unsigned int [usertype]
> drivers/crypto/sa2ul.c:902:35: sparse: got restricted __be32 [usertype]
> drivers/crypto/sa2ul.c:1169:6: sparse: sparse: symbol 'sa_register_algos' was
not declared. Should it be static?
> drivers/crypto/sa2ul.c:1198:6: sparse: sparse: symbol 'sa_unregister_algos'
was not declared. Should it be static?
drivers/crypto/sa2ul.c:503:41: sparse:
sparse: incorrect type in assignment (different base types) @@ expected unsigned int
[usertype] @@ got restricted __be32 [usertype] @@
drivers/crypto/sa2ul.c:503:41: sparse: expected unsigned int [usertype]
drivers/crypto/sa2ul.c:503:41: sparse: got restricted __be32 [usertype]
drivers/crypto/sa2ul.c:364:22: sparse: sparse: incorrect type in assignment (different
base types) @@ expected unsigned int [usertype] @@ got restricted __be32
[usertype] @@
drivers/crypto/sa2ul.c:364:22: sparse: expected unsigned int [usertype]
drivers/crypto/sa2ul.c:364:22: sparse: got restricted __be32 [usertype]
drivers/crypto/sa2ul.c: note: in included file (through arch/xtensa/include/asm/io.h,
include/linux/scatterlist.h, include/linux/dmapool.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int [usertype] value @@ got restricted
__le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int [usertype] value @@ got restricted
__le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
vim +473 drivers/crypto/sa2ul.c
369
370 /* Format general command label */
371 static int sa_format_cmdl_gen(struct sa_cmdl_cfg *cfg, u8 *cmdl,
372 struct sa_cmdl_upd_info *upd_info)
373 {
374 u8 enc_offset = 0, auth_offset = 0, total = 0;
375 u8 enc_next_eng = SA_ENG_ID_OUTPORT2;
376 u8 auth_next_eng = SA_ENG_ID_OUTPORT2;
377 u32 *word_ptr = (u32 *)cmdl;
378 int i;
379
380 /* Clear the command label */
381 memzero_explicit(cmdl, (SA_MAX_CMDL_WORDS * sizeof(u32)));
382
383 /* Iniialize the command update structure */
384 memzero_explicit(upd_info, sizeof(*upd_info));
385
386 if (cfg->enc1st) {
387 if (cfg->enc_eng_id != SA_ENG_ID_NONE)
388 auth_offset = SA_CMDL_HEADER_SIZE_BYTES;
389
390 if (cfg->iv_size)
391 auth_offset += cfg->iv_size;
392
393 if (cfg->auth_eng_id != SA_ENG_ID_NONE)
394 enc_next_eng = cfg->auth_eng_id;
395 else
396 enc_next_eng = SA_ENG_ID_OUTPORT2;
397 } else {
398 if (cfg->auth_eng_id != SA_ENG_ID_NONE)
399 enc_offset = SA_CMDL_HEADER_SIZE_BYTES;
400
401 if (cfg->auth_subkey_len)
402 enc_offset += cfg->auth_subkey_len;
403
404 if (cfg->enc_eng_id != SA_ENG_ID_NONE)
405 auth_next_eng = cfg->enc_eng_id;
406 else
407 auth_next_eng = SA_ENG_ID_OUTPORT2;
408 }
409
410 if (cfg->enc_eng_id != SA_ENG_ID_NONE) {
411 upd_info->flags |= SA_CMDL_UPD_ENC;
412 upd_info->enc_size.index = enc_offset >> 2;
413 upd_info->enc_offset.index = upd_info->enc_size.index + 1;
414 /* Encryption command label */
415 cmdl[enc_offset + SA_CMDL_OFFSET_NESC] = enc_next_eng;
416
417 /* Encryption modes requiring IV */
418 if (cfg->iv_size) {
419 upd_info->flags |= SA_CMDL_UPD_ENC_IV;
420 upd_info->enc_iv.index =
421 (enc_offset + SA_CMDL_HEADER_SIZE_BYTES) >> 2;
422 upd_info->enc_iv.size = cfg->iv_size;
423
424 cmdl[enc_offset + SA_CMDL_OFFSET_LABEL_LEN] =
425 SA_CMDL_HEADER_SIZE_BYTES + cfg->iv_size;
426
427 cmdl[enc_offset + SA_CMDL_OFFSET_OPTION_CTRL1] =
428 (SA_CTX_ENC_AUX2_OFFSET | (cfg->iv_size >> 3));
429 enc_offset += SA_CMDL_HEADER_SIZE_BYTES + cfg->iv_size;
430 } else {
431 cmdl[enc_offset + SA_CMDL_OFFSET_LABEL_LEN] =
432 SA_CMDL_HEADER_SIZE_BYTES;
433 enc_offset += SA_CMDL_HEADER_SIZE_BYTES;
434 }
435 }
436
437 if (cfg->auth_eng_id != SA_ENG_ID_NONE) {
438 upd_info->flags |= SA_CMDL_UPD_AUTH;
439 upd_info->auth_size.index = auth_offset >> 2;
440 upd_info->auth_offset.index = upd_info->auth_size.index + 1;
441 cmdl[auth_offset + SA_CMDL_OFFSET_NESC] = auth_next_eng;
442
443 /* Algorithm with subkeys */
444 if (cfg->aalg == SA_AALG_ID_AES_XCBC ||
445 cfg->aalg == SA_AALG_ID_CMAC) {
446 upd_info->flags |= SA_CMDL_UPD_AUX_KEY;
447 upd_info->aux_key_info.index =
448 (auth_offset + SA_CMDL_HEADER_SIZE_BYTES) >> 2;
449 cmdl[auth_offset + SA_CMDL_OFFSET_LABEL_LEN] =
450 SA_CMDL_HEADER_SIZE_BYTES +
451 cfg->auth_subkey_len;
452 cmdl[auth_offset + SA_CMDL_OFFSET_OPTION_CTRL1] =
453 (SA_CTX_ENC_AUX1_OFFSET |
454 (cfg->auth_subkey_len >> 3));
455
456 auth_offset += SA_CMDL_HEADER_SIZE_BYTES +
457 cfg->auth_subkey_len;
458 } else {
459 cmdl[auth_offset + SA_CMDL_OFFSET_LABEL_LEN] =
460 SA_CMDL_HEADER_SIZE_BYTES;
461 auth_offset += SA_CMDL_HEADER_SIZE_BYTES;
462 }
463 }
464
465 if (cfg->enc1st)
466 total = auth_offset;
467 else
468 total = enc_offset;
469
470 total = roundup(total, 8);
471
472 for (i = 0; i < total / 4; i++)
473 word_ptr[i] = be32_to_cpu(word_ptr[i]);
474
475 return total;
476 }
477
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org