public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [RFC PATCH 14/16] crypto: qat - add support for zstd
       [not found] <20251128191531.1703018-15-giovanni.cabiddu@intel.com>
@ 2025-11-29 16:57 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-29 16:57 UTC (permalink / raw)
  To: Giovanni Cabiddu; +Cc: llvm, oe-kbuild-all

Hi Giovanni,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on ebbdf6466b30e3b37f3b360826efd21f0633fb9e]

url:    https://github.com/intel-lab-lkp/linux/commits/Giovanni-Cabiddu/crypto-zstd-fix-double-free-in-per-CPU-stream-cleanup/20251128-222112
base:   ebbdf6466b30e3b37f3b360826efd21f0633fb9e
patch link:    https://lore.kernel.org/r/20251128191531.1703018-15-giovanni.cabiddu%40intel.com
patch subject: [RFC PATCH 14/16] crypto: qat - add support for zstd
config: i386-buildonly-randconfig-003 (https://download.01.org/0day-ci/archive/20251130/202511300007.jf6qGfjm-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251130/202511300007.jf6qGfjm-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511300007.jf6qGfjm-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/crypto/intel/qat/qat_common/qat_comp_zstd_utils.c:104:17: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
     103 |                                 pr_debug("[%s]: qat zstd sequence overflow (seqs_idx:%lu, out_seqs_capacity:%lu, lz4s_buff_size:%u)\n",
         |                                                                                      ~~~
         |                                                                                      %zu
     104 |                                          __func__, seqs_idx, out_seqs_capacity, lz4s_buff_size);
         |                                                    ^~~~~~~~
   include/linux/printk.h:636:26: note: expanded from macro 'pr_debug'
     636 |         dynamic_pr_debug(fmt, ##__VA_ARGS__)
         |                          ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:270:22: note: expanded from macro 'dynamic_pr_debug'
     270 |                            pr_fmt(fmt), ##__VA_ARGS__)
         |                                   ~~~     ^~~~~~~~~~~
   include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call'
     250 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |                                                                  ^~~~~~~~~~~
   include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls'
     248 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls'
     224 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   drivers/crypto/intel/qat/qat_common/qat_comp_zstd_utils.c:104:27: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
     103 |                                 pr_debug("[%s]: qat zstd sequence overflow (seqs_idx:%lu, out_seqs_capacity:%lu, lz4s_buff_size:%u)\n",
         |                                                                                                             ~~~
         |                                                                                                             %zu
     104 |                                          __func__, seqs_idx, out_seqs_capacity, lz4s_buff_size);
         |                                                              ^~~~~~~~~~~~~~~~~
   include/linux/printk.h:636:26: note: expanded from macro 'pr_debug'
     636 |         dynamic_pr_debug(fmt, ##__VA_ARGS__)
         |                          ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:270:22: note: expanded from macro 'dynamic_pr_debug'
     270 |                            pr_fmt(fmt), ##__VA_ARGS__)
         |                                   ~~~     ^~~~~~~~~~~
   include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call'
     250 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |                                                                  ^~~~~~~~~~~
   include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls'
     248 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls'
     224 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   2 warnings generated.


vim +104 drivers/crypto/intel/qat/qat_common/qat_comp_zstd_utils.c

    14	
    15	/*
    16	 * Implement the same algorithm as the QAT ZSTD sequence producer plugin,
    17	 * to decode LZ4s formatted data into ZSTD_Sequence format.
    18	 */
    19	size_t qat_alg_dec_lz4s(ZSTD_Sequence *out_seqs, size_t out_seqs_capacity,
    20				unsigned char *lz4s_buff, unsigned int lz4s_buff_size,
    21				unsigned char *literals, unsigned int *lit_len)
    22	{
    23		unsigned char *end_ip = lz4s_buff + lz4s_buff_size;
    24		unsigned int hist_literal_len = 0;
    25		unsigned char *ip = lz4s_buff;
    26		size_t seqs_idx = 0;
    27	
    28		*lit_len = 0;
    29	
    30		if (!lz4s_buff_size)
    31			return 0;
    32	
    33		while (ip < end_ip) {
    34			size_t length = 0;
    35			size_t offset = 0;
    36			size_t literal_len = 0, match_len = 0;
    37	
    38			/* get literal length */
    39			unsigned const token = *ip++;
    40	
    41			length = token >> ML_BITS;
    42			if (length == RUN_MASK) {
    43				unsigned int s;
    44	
    45				do {
    46					s = *ip++;
    47					length += s;
    48				} while (s == 255);
    49			}
    50	
    51			literal_len = length;
    52	
    53			{
    54				u8 *start = ip;
    55				u8 *dest = literals;
    56				u8 *dest_end = literals + length;
    57	
    58				do {
    59					__builtin_memcpy(dest, start, QAT_ZSTD_LIT_COPY_LEN);
    60					dest += QAT_ZSTD_LIT_COPY_LEN;
    61					start += QAT_ZSTD_LIT_COPY_LEN;
    62				} while (dest < dest_end);
    63			}
    64	
    65			literals += length;
    66			*lit_len += length;
    67	
    68			ip += length;
    69			if (ip == end_ip) { /* Meet the end of the LZ4 sequence */
    70				literal_len += hist_literal_len;
    71				out_seqs[seqs_idx].litLength = literal_len;
    72				out_seqs[seqs_idx].offset = offset;
    73				out_seqs[seqs_idx].matchLength = match_len;
    74				break;
    75			}
    76	
    77			/* get matchPos */
    78			offset = le16_to_cpu(*(__le16 *)ip);
    79			ip += 2;
    80	
    81			/* get match length */
    82			length = token & ML_MASK;
    83			if (length == ML_MASK) {
    84				unsigned int s;
    85	
    86				do {
    87					s = *ip++;
    88					length += s;
    89				} while (s == 255);
    90			}
    91			if (length != 0) {
    92				length += LZ4MINMATCH;
    93				match_len = (unsigned short)length;
    94				literal_len += hist_literal_len;
    95	
    96				/* update ZSTD_Sequence */
    97				out_seqs[seqs_idx].offset = offset;
    98				out_seqs[seqs_idx].litLength = literal_len;
    99				out_seqs[seqs_idx].matchLength = match_len;
   100				hist_literal_len = 0;
   101				++seqs_idx;
   102				if (seqs_idx >= (out_seqs_capacity - 1)) {
   103					pr_debug("[%s]: qat zstd sequence overflow (seqs_idx:%lu, out_seqs_capacity:%lu, lz4s_buff_size:%u)\n",
 > 104						 __func__, seqs_idx, out_seqs_capacity, lz4s_buff_size);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-29 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251128191531.1703018-15-giovanni.cabiddu@intel.com>
2025-11-29 16:57 ` [RFC PATCH 14/16] crypto: qat - add support for zstd kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox