From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [Patch v3 6/7] crypto: qce: common: Add support for AEAD algorithms
Date: Thu, 29 Apr 2021 07:44:53 +0800 [thread overview]
Message-ID: <202104290726.yTf7KasR-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 12122 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210420033602.1729947-7-thara.gopinath@linaro.org>
References: <20210420033602.1729947-7-thara.gopinath@linaro.org>
TO: Thara Gopinath <thara.gopinath@linaro.org>
TO: herbert(a)gondor.apana.org.au
TO: davem(a)davemloft.net
TO: bjorn.andersson(a)linaro.org
CC: ebiggers(a)google.com
CC: ardb(a)kernel.org
CC: sivaprak(a)codeaurora.org
CC: linux-crypto(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: linux-arm-msm(a)vger.kernel.org
Hi Thara,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on cryptodev/master]
[also build test WARNING on crypto/master next-20210428]
[cannot apply to sparc-next/master v5.12]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Thara-Gopinath/Add-support-for-AEAD-algorithms-in-Qualcomm-Crypto-Engine-driver/20210420-113944
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: arm-randconfig-m031-20210428 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/crypto/qce/common.c:482 qce_setup_regs_aead() error: uninitialized symbol 'auth_ivsize'.
vim +/auth_ivsize +482 drivers/crypto/qce/common.c
b152c1b17bb6ad Thara Gopinath 2021-04-19 418
b152c1b17bb6ad Thara Gopinath 2021-04-19 419 static int qce_setup_regs_aead(struct crypto_async_request *async_req)
b152c1b17bb6ad Thara Gopinath 2021-04-19 420 {
b152c1b17bb6ad Thara Gopinath 2021-04-19 421 struct aead_request *req = aead_request_cast(async_req);
b152c1b17bb6ad Thara Gopinath 2021-04-19 422 struct qce_aead_reqctx *rctx = aead_request_ctx(req);
b152c1b17bb6ad Thara Gopinath 2021-04-19 423 struct qce_aead_ctx *ctx = crypto_tfm_ctx(async_req->tfm);
b152c1b17bb6ad Thara Gopinath 2021-04-19 424 struct qce_alg_template *tmpl = to_aead_tmpl(crypto_aead_reqtfm(req));
b152c1b17bb6ad Thara Gopinath 2021-04-19 425 struct qce_device *qce = tmpl->qce;
b152c1b17bb6ad Thara Gopinath 2021-04-19 426 u32 enckey[QCE_MAX_CIPHER_KEY_SIZE / sizeof(u32)] = {0};
b152c1b17bb6ad Thara Gopinath 2021-04-19 427 u32 enciv[QCE_MAX_IV_SIZE / sizeof(u32)] = {0};
b152c1b17bb6ad Thara Gopinath 2021-04-19 428 u32 authkey[QCE_SHA_HMAC_KEY_SIZE / sizeof(u32)] = {0};
b152c1b17bb6ad Thara Gopinath 2021-04-19 429 u32 authiv[SHA256_DIGEST_SIZE / sizeof(u32)] = {0};
b152c1b17bb6ad Thara Gopinath 2021-04-19 430 u32 authnonce[QCE_MAX_NONCE / sizeof(u32)] = {0};
b152c1b17bb6ad Thara Gopinath 2021-04-19 431 unsigned int enc_keylen = ctx->enc_keylen;
b152c1b17bb6ad Thara Gopinath 2021-04-19 432 unsigned int auth_keylen = ctx->auth_keylen;
b152c1b17bb6ad Thara Gopinath 2021-04-19 433 unsigned int enc_ivsize = rctx->ivsize;
b152c1b17bb6ad Thara Gopinath 2021-04-19 434 unsigned int auth_ivsize;
b152c1b17bb6ad Thara Gopinath 2021-04-19 435 unsigned int enckey_words, enciv_words;
b152c1b17bb6ad Thara Gopinath 2021-04-19 436 unsigned int authkey_words, authiv_words, authnonce_words;
b152c1b17bb6ad Thara Gopinath 2021-04-19 437 unsigned long flags = rctx->flags;
b152c1b17bb6ad Thara Gopinath 2021-04-19 438 u32 encr_cfg, auth_cfg, config, totallen;
b152c1b17bb6ad Thara Gopinath 2021-04-19 439 u32 iv_last_word;
b152c1b17bb6ad Thara Gopinath 2021-04-19 440
b152c1b17bb6ad Thara Gopinath 2021-04-19 441 qce_setup_config(qce);
b152c1b17bb6ad Thara Gopinath 2021-04-19 442
b152c1b17bb6ad Thara Gopinath 2021-04-19 443 /* Write encryption key */
b152c1b17bb6ad Thara Gopinath 2021-04-19 444 enckey_words = qce_be32_to_cpu_array(enckey, ctx->enc_key, enc_keylen);
b152c1b17bb6ad Thara Gopinath 2021-04-19 445 qce_write_array(qce, REG_ENCR_KEY0, enckey, enckey_words);
b152c1b17bb6ad Thara Gopinath 2021-04-19 446
b152c1b17bb6ad Thara Gopinath 2021-04-19 447 /* Write encryption iv */
b152c1b17bb6ad Thara Gopinath 2021-04-19 448 enciv_words = qce_be32_to_cpu_array(enciv, rctx->iv, enc_ivsize);
b152c1b17bb6ad Thara Gopinath 2021-04-19 449 qce_write_array(qce, REG_CNTR0_IV0, enciv, enciv_words);
b152c1b17bb6ad Thara Gopinath 2021-04-19 450
b152c1b17bb6ad Thara Gopinath 2021-04-19 451 if (IS_CCM(rctx->flags)) {
b152c1b17bb6ad Thara Gopinath 2021-04-19 452 iv_last_word = enciv[enciv_words - 1];
b152c1b17bb6ad Thara Gopinath 2021-04-19 453 qce_write(qce, REG_CNTR3_IV3, iv_last_word + 1);
b152c1b17bb6ad Thara Gopinath 2021-04-19 454 qce_write_array(qce, REG_ENCR_CCM_INT_CNTR0, (u32 *)enciv, enciv_words);
b152c1b17bb6ad Thara Gopinath 2021-04-19 455 qce_write(qce, REG_CNTR_MASK, ~0);
b152c1b17bb6ad Thara Gopinath 2021-04-19 456 qce_write(qce, REG_CNTR_MASK0, ~0);
b152c1b17bb6ad Thara Gopinath 2021-04-19 457 qce_write(qce, REG_CNTR_MASK1, ~0);
b152c1b17bb6ad Thara Gopinath 2021-04-19 458 qce_write(qce, REG_CNTR_MASK2, ~0);
b152c1b17bb6ad Thara Gopinath 2021-04-19 459 }
b152c1b17bb6ad Thara Gopinath 2021-04-19 460
b152c1b17bb6ad Thara Gopinath 2021-04-19 461 /* Clear authentication IV and KEY registers of previous values */
b152c1b17bb6ad Thara Gopinath 2021-04-19 462 qce_clear_array(qce, REG_AUTH_IV0, 16);
b152c1b17bb6ad Thara Gopinath 2021-04-19 463 qce_clear_array(qce, REG_AUTH_KEY0, 16);
b152c1b17bb6ad Thara Gopinath 2021-04-19 464
b152c1b17bb6ad Thara Gopinath 2021-04-19 465 /* Clear byte count */
b152c1b17bb6ad Thara Gopinath 2021-04-19 466 qce_clear_array(qce, REG_AUTH_BYTECNT0, 4);
b152c1b17bb6ad Thara Gopinath 2021-04-19 467
b152c1b17bb6ad Thara Gopinath 2021-04-19 468 /* Write authentication key */
b152c1b17bb6ad Thara Gopinath 2021-04-19 469 authkey_words = qce_be32_to_cpu_array(authkey, ctx->auth_key, auth_keylen);
b152c1b17bb6ad Thara Gopinath 2021-04-19 470 qce_write_array(qce, REG_AUTH_KEY0, (u32 *)authkey, authkey_words);
b152c1b17bb6ad Thara Gopinath 2021-04-19 471
b152c1b17bb6ad Thara Gopinath 2021-04-19 472 /* Write initial authentication IV only for HMAC algorithms */
b152c1b17bb6ad Thara Gopinath 2021-04-19 473 if (IS_SHA_HMAC(rctx->flags)) {
b152c1b17bb6ad Thara Gopinath 2021-04-19 474 /* Write default authentication iv */
b152c1b17bb6ad Thara Gopinath 2021-04-19 475 if (IS_SHA1_HMAC(rctx->flags)) {
b152c1b17bb6ad Thara Gopinath 2021-04-19 476 auth_ivsize = SHA1_DIGEST_SIZE;
b152c1b17bb6ad Thara Gopinath 2021-04-19 477 memcpy(authiv, std_iv_sha1, auth_ivsize);
b152c1b17bb6ad Thara Gopinath 2021-04-19 478 } else if (IS_SHA256_HMAC(rctx->flags)) {
b152c1b17bb6ad Thara Gopinath 2021-04-19 479 auth_ivsize = SHA256_DIGEST_SIZE;
b152c1b17bb6ad Thara Gopinath 2021-04-19 480 memcpy(authiv, std_iv_sha256, auth_ivsize);
b152c1b17bb6ad Thara Gopinath 2021-04-19 481 }
b152c1b17bb6ad Thara Gopinath 2021-04-19 @482 authiv_words = auth_ivsize / sizeof(u32);
b152c1b17bb6ad Thara Gopinath 2021-04-19 483 qce_write_array(qce, REG_AUTH_IV0, (u32 *)authiv, authiv_words);
b152c1b17bb6ad Thara Gopinath 2021-04-19 484 } else if (IS_CCM(rctx->flags)) {
b152c1b17bb6ad Thara Gopinath 2021-04-19 485 /* Write nonce for CCM algorithms */
b152c1b17bb6ad Thara Gopinath 2021-04-19 486 authnonce_words = qce_be32_to_cpu_array(authnonce, rctx->ccm_nonce, QCE_MAX_NONCE);
b152c1b17bb6ad Thara Gopinath 2021-04-19 487 qce_write_array(qce, REG_AUTH_INFO_NONCE0, authnonce, authnonce_words);
b152c1b17bb6ad Thara Gopinath 2021-04-19 488 }
b152c1b17bb6ad Thara Gopinath 2021-04-19 489
b152c1b17bb6ad Thara Gopinath 2021-04-19 490 /* Set up ENCR_SEG_CFG */
b152c1b17bb6ad Thara Gopinath 2021-04-19 491 encr_cfg = qce_encr_cfg(flags, enc_keylen);
b152c1b17bb6ad Thara Gopinath 2021-04-19 492 if (IS_ENCRYPT(flags))
b152c1b17bb6ad Thara Gopinath 2021-04-19 493 encr_cfg |= BIT(ENCODE_SHIFT);
b152c1b17bb6ad Thara Gopinath 2021-04-19 494 qce_write(qce, REG_ENCR_SEG_CFG, encr_cfg);
b152c1b17bb6ad Thara Gopinath 2021-04-19 495
b152c1b17bb6ad Thara Gopinath 2021-04-19 496 /* Set up AUTH_SEG_CFG */
b152c1b17bb6ad Thara Gopinath 2021-04-19 497 auth_cfg = qce_auth_cfg(rctx->flags, auth_keylen, ctx->authsize);
b152c1b17bb6ad Thara Gopinath 2021-04-19 498 auth_cfg |= BIT(AUTH_LAST_SHIFT);
b152c1b17bb6ad Thara Gopinath 2021-04-19 499 auth_cfg |= BIT(AUTH_FIRST_SHIFT);
b152c1b17bb6ad Thara Gopinath 2021-04-19 500 if (IS_ENCRYPT(flags)) {
b152c1b17bb6ad Thara Gopinath 2021-04-19 501 if (IS_CCM(rctx->flags))
b152c1b17bb6ad Thara Gopinath 2021-04-19 502 auth_cfg |= AUTH_POS_BEFORE << AUTH_POS_SHIFT;
b152c1b17bb6ad Thara Gopinath 2021-04-19 503 else
b152c1b17bb6ad Thara Gopinath 2021-04-19 504 auth_cfg |= AUTH_POS_AFTER << AUTH_POS_SHIFT;
b152c1b17bb6ad Thara Gopinath 2021-04-19 505 } else {
b152c1b17bb6ad Thara Gopinath 2021-04-19 506 if (IS_CCM(rctx->flags))
b152c1b17bb6ad Thara Gopinath 2021-04-19 507 auth_cfg |= AUTH_POS_AFTER << AUTH_POS_SHIFT;
b152c1b17bb6ad Thara Gopinath 2021-04-19 508 else
b152c1b17bb6ad Thara Gopinath 2021-04-19 509 auth_cfg |= AUTH_POS_BEFORE << AUTH_POS_SHIFT;
b152c1b17bb6ad Thara Gopinath 2021-04-19 510 }
b152c1b17bb6ad Thara Gopinath 2021-04-19 511 qce_write(qce, REG_AUTH_SEG_CFG, auth_cfg);
b152c1b17bb6ad Thara Gopinath 2021-04-19 512
b152c1b17bb6ad Thara Gopinath 2021-04-19 513 totallen = rctx->cryptlen + rctx->assoclen;
b152c1b17bb6ad Thara Gopinath 2021-04-19 514
b152c1b17bb6ad Thara Gopinath 2021-04-19 515 /* Set the encryption size and start offset */
b152c1b17bb6ad Thara Gopinath 2021-04-19 516 if (IS_CCM(rctx->flags) && IS_DECRYPT(rctx->flags))
b152c1b17bb6ad Thara Gopinath 2021-04-19 517 qce_write(qce, REG_ENCR_SEG_SIZE, rctx->cryptlen + ctx->authsize);
b152c1b17bb6ad Thara Gopinath 2021-04-19 518 else
b152c1b17bb6ad Thara Gopinath 2021-04-19 519 qce_write(qce, REG_ENCR_SEG_SIZE, rctx->cryptlen);
b152c1b17bb6ad Thara Gopinath 2021-04-19 520 qce_write(qce, REG_ENCR_SEG_START, rctx->assoclen & 0xffff);
b152c1b17bb6ad Thara Gopinath 2021-04-19 521
b152c1b17bb6ad Thara Gopinath 2021-04-19 522 /* Set the authentication size and start offset */
b152c1b17bb6ad Thara Gopinath 2021-04-19 523 qce_write(qce, REG_AUTH_SEG_SIZE, totallen);
b152c1b17bb6ad Thara Gopinath 2021-04-19 524 qce_write(qce, REG_AUTH_SEG_START, 0);
b152c1b17bb6ad Thara Gopinath 2021-04-19 525
b152c1b17bb6ad Thara Gopinath 2021-04-19 526 /* Write total length */
b152c1b17bb6ad Thara Gopinath 2021-04-19 527 if (IS_CCM(rctx->flags) && IS_DECRYPT(rctx->flags))
b152c1b17bb6ad Thara Gopinath 2021-04-19 528 qce_write(qce, REG_SEG_SIZE, totallen + ctx->authsize);
b152c1b17bb6ad Thara Gopinath 2021-04-19 529 else
b152c1b17bb6ad Thara Gopinath 2021-04-19 530 qce_write(qce, REG_SEG_SIZE, totallen);
b152c1b17bb6ad Thara Gopinath 2021-04-19 531
b152c1b17bb6ad Thara Gopinath 2021-04-19 532 /* get little endianness */
b152c1b17bb6ad Thara Gopinath 2021-04-19 533 config = qce_config_reg(qce, 1);
b152c1b17bb6ad Thara Gopinath 2021-04-19 534 qce_write(qce, REG_CONFIG, config);
b152c1b17bb6ad Thara Gopinath 2021-04-19 535
b152c1b17bb6ad Thara Gopinath 2021-04-19 536 /* Start the process */
b152c1b17bb6ad Thara Gopinath 2021-04-19 537 qce_crypto_go(qce, !IS_CCM(flags));
b152c1b17bb6ad Thara Gopinath 2021-04-19 538
b152c1b17bb6ad Thara Gopinath 2021-04-19 539 return 0;
b152c1b17bb6ad Thara Gopinath 2021-04-19 540 }
b152c1b17bb6ad Thara Gopinath 2021-04-19 541 #endif
b152c1b17bb6ad Thara Gopinath 2021-04-19 542
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 41010 bytes --]
next reply other threads:[~2021-04-28 23:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 23:44 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-04-20 3:35 [Patch v3 0/7] Add support for AEAD algorithms in Qualcomm Crypto Engine driver Thara Gopinath
2021-04-20 3:36 ` [Patch v3 6/7] crypto: qce: common: Add support for AEAD algorithms Thara Gopinath
2021-04-21 20:15 ` kernel test robot
2021-04-21 20:15 ` kernel test robot
2021-04-29 5:25 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202104290726.yTf7KasR-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.