tree:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
linux-5.4.y
head: 1cdaf895c99d319c0007d0b62818cf85fc4b087f
commit: 5e33535cf13c0a85f2bda324fced2502f9ca82e9 [2529/5257] crypto: ccree - fix FDE
descriptor sequence
config: h8300-randconfig-r012-20200521 (attached as .config)
compiler: h8300-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
git checkout 5e33535cf13c0a85f2bda324fced2502f9ca82e9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/h8300/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:10,
from drivers/crypto/ccree/cc_cipher.c:5:
include/linux/dma-mapping.h: In function 'dma_map_resource':
include/asm-generic/page.h:91:32: warning: comparison of unsigned expression >= 0 is
always true [-Wtype-limits]
91 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) -
ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); |
^~~~~~~~~
include/linux/dma-mapping.h:355:19: note: in expansion of macro 'pfn_valid'
355 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
drivers/crypto/ccree/cc_cipher.c: In function 'cc_slot_to_key_type':
drivers/crypto/ccree/cc_cipher.c:268:15: warning: comparison is always true due to limited
range of data type [-Wtype-limits]
268 | if (slot_num >= CC_FIRST_HW_KEY_SLOT && slot_num <=
CC_LAST_HW_KEY_SLOT)
| ^~
drivers/crypto/ccree/cc_cipher.c: In function 'cc_setup_state_desc':
<< from drivers/crypto/ccree/cc_cipher.c:5:
> drivers/crypto/ccree/cc_cipher.c:539:15: warning: variable
'du_size' set but not used [-Wunused-but-set-variable]
539 | unsigned int
du_size = nbytes;
| ^~~~~~~
vim +/du_size +539 drivers/crypto/ccree/cc_cipher.c
6f17e00f77d8ab Gilad Ben-Yossef 2019-04-18 525
5e33535cf13c0a Ofir Drang 2020-01-16 526
dd8486c7508550 Gilad Ben-Yossef 2019-04-18 527 static void cc_setup_state_desc(struct
crypto_tfm *tfm,
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 528 struct cipher_req_ctx *req_ctx,
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 529 unsigned int ivsize, unsigned int
nbytes,
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 530 struct cc_hw_desc desc[],
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 531 unsigned int *seq_size)
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 532 {
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 533 struct cc_cipher_ctx *ctx_p =
crypto_tfm_ctx(tfm);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 534 struct device *dev =
drvdata_to_dev(ctx_p->drvdata);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 535 int cipher_mode =
ctx_p->cipher_mode;
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 536 int flow_mode = ctx_p->flow_mode;
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 537 int direction =
req_ctx->gen_ctx.op_type;
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 538 dma_addr_t iv_dma_addr =
req_ctx->gen_ctx.iv_dma_addr;
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 @539 unsigned int du_size = nbytes;
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 540
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 541 struct cc_crypto_alg *cc_alg =
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 542 container_of(tfm->__crt_alg, struct
cc_crypto_alg,
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 543 skcipher_alg.base);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 544
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 545 if (cc_alg->data_unit)
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 546 du_size = cc_alg->data_unit;
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 547
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 548 switch (cipher_mode) {
dd8486c7508550 Gilad Ben-Yossef 2019-04-18 549 case DRV_CIPHER_ECB:
dd8486c7508550 Gilad Ben-Yossef 2019-04-18 550 break;
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 551 case DRV_CIPHER_CBC:
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 552 case DRV_CIPHER_CBC_CTS:
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 553 case DRV_CIPHER_CTR:
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 554 case DRV_CIPHER_OFB:
dd8486c7508550 Gilad Ben-Yossef 2019-04-18 555 /* Load IV */
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 556 hw_desc_init(&desc[*seq_size]);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 557 set_din_type(&desc[*seq_size],
DMA_DLLI, iv_dma_addr, ivsize,
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 558 NS_BIT);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 559
set_cipher_config0(&desc[*seq_size], direction);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 560 set_flow_mode(&desc[*seq_size],
flow_mode);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 561 set_cipher_mode(&desc[*seq_size],
cipher_mode);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 562 if (cipher_mode == DRV_CIPHER_CTR ||
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 563 cipher_mode == DRV_CIPHER_OFB) {
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 564 set_setup_mode(&desc[*seq_size],
SETUP_LOAD_STATE1);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 565 } else {
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 566 set_setup_mode(&desc[*seq_size],
SETUP_LOAD_STATE0);
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 567 }
63ee04c8b491ee Gilad Ben-Yossef 2018-01-22 568 (*seq_size)++;
dd8486c7508550 Gilad Ben-Yossef 2019-04-18 569 break;
dd8486c7508550 Gilad Ben-Yossef 2019-04-18 570 case DRV_CIPHER_XTS:
dd8486c7508550 Gilad Ben-Yossef 2019-04-18 571 case DRV_CIPHER_ESSIV:
5e33535cf13c0a Ofir Drang 2020-01-16 572 case DRV_CIPHER_BITLOCKER:
5e33535cf13c0a Ofir Drang 2020-01-16 573 break;
5e33535cf13c0a Ofir Drang 2020-01-16 574 default:
5e33535cf13c0a Ofir Drang 2020-01-16 575 dev_err(dev, "Unsupported cipher
mode (%d)\n", cipher_mode);
5e33535cf13c0a Ofir Drang 2020-01-16 576 }
5e33535cf13c0a Ofir Drang 2020-01-16 577 }
5e33535cf13c0a Ofir Drang 2020-01-16 578
:::::: The code at line 539 was first introduced by commit
:::::: 63ee04c8b491ee148489347e7da9fbfd982ca2bb crypto: ccree - add skcipher support
:::::: TO: Gilad Ben-Yossef <gilad(a)benyossef.com>
:::::: CC: Herbert Xu <herbert(a)gondor.apana.org.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org