[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210051851.Nkn08mS4-lkp@intel.com>
Date: Wed, 5 Oct 2022 18:15:02 +0800
From: kernel test robot <lkp@...el.com>
To: Neal Liu <neal_liu@...eedtech.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>,
Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...id.au>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
"Chia-Wei Wang --cc=linux-kernel @ vger . kernel . org"
<chiawei_wang@...eedtech.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-crypto@...r.kernel.org, linux-aspeed@...ts.ozlabs.org,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/4] crypto: aspeed: Add ACRY RSA driver
Hi Neal,
I love your patch! Perhaps something to improve:
[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on herbert-crypto-2.6/master next-20221004]
[cannot apply to robh/for-next linus/master v6.0]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Neal-Liu/Add-Aspeed-ACRY-driver-for-hardware-acceleration/20221004-113050
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: hexagon-allyesconfig
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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
# https://github.com/intel-lab-lkp/linux/commit/b074e55ba308dfda90527144dfa77bea9b9a9321
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Neal-Liu/Add-Aspeed-ACRY-driver-for-hardware-acceleration/20221004-113050
git checkout b074e55ba308dfda90527144dfa77bea9b9a9321
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/crypto/aspeed/ drivers/net/ethernet/marvell/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/crypto/aspeed/aspeed-acry.c:293:5: warning: variable 'data' is uninitialized when used here [-Wuninitialized]
data <<= 8;
^~~~
drivers/crypto/aspeed/aspeed-acry.c:267:10: note: initialize the variable 'data' to silence this warning
u32 data;
^
= 0
1 warning generated.
vim +/data +293 drivers/crypto/aspeed/aspeed-acry.c
245
246 /*
247 * Copy Exp/Mod to DMA buffer for engine used.
248 *
249 * Params:
250 * - mode 0 : Exponential
251 * - mode 1 : Modulus
252 *
253 * Example:
254 * - DRAM memory layout:
255 * D[0], D[4], D[8], D[12]
256 * - ACRY SRAM memory layout should reverse the order of source data:
257 * D[12], D[8], D[4], D[0]
258 */
259 static int aspeed_acry_rsa_ctx_copy(struct aspeed_acry_dev *acry_dev, void *buf,
260 const void *xbuf, size_t nbytes,
261 enum aspeed_rsa_key_mode mode)
262 {
263 const uint8_t *src = xbuf;
264 u32 *dw_buf = (u32 *)buf;
265 int nbits, ndw;
266 int i, j, idx;
267 u32 data;
268
269 ACRY_DBG(acry_dev, "nbytes:0x%x, mode:%d\n", nbytes, mode);
270
271 if (nbytes > ASPEED_ACRY_RSA_MAX_KEY_LEN)
272 return -ENOMEM;
273
274 /* Remove the leading zeros */
275 while (nbytes > 0 && src[0] == 0) {
276 src++;
277 nbytes--;
278 }
279
280 nbits = nbytes * 8;
281 if (nbytes > 0)
282 nbits -= count_leading_zeros(src[0]) - (BITS_PER_LONG - 8);
283
284 /* double-world alignment */
285 ndw = DIV_ROUND_UP(nbytes, BYTES_PER_DWORD);
286
287 if (nbytes > 0) {
288 i = BYTES_PER_DWORD - nbytes % BYTES_PER_DWORD;
289 i %= BYTES_PER_DWORD;
290
291 for (j = ndw; j > 0; j--) {
292 for (; i < BYTES_PER_DWORD; i++) {
> 293 data <<= 8;
294 data |= *src++;
295 }
296
297 i = 0;
298
299 if (mode == ASPEED_RSA_EXP_MODE)
300 idx = acry_dev->exp_dw_mapping[j - 1];
301 else if (mode == ASPEED_RSA_MOD_MODE)
302 idx = acry_dev->mod_dw_mapping[j - 1];
303
304 dw_buf[idx] = cpu_to_le32(data);
305 }
306 }
307
308 return nbits;
309 }
310
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (278356 bytes)
Powered by blists - more mailing lists