Re: [PATCH v2 2/2] vsprintf: Move space out of string literals in fourcc_string()
by kernel test robot
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.17-rc1 next-20220124]
[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/Andy-Shevchenko/vsprintf-Fix-pot...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
config: riscv-randconfig-r042-20220124 (https://download.01.org/0day-ci/archive/20220125/202201250142.DtHQRlOS-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2e58a18910867ba6795066e044293e6daf89edf5)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/f1895edcabdc5dae0528ffff9c3cb665a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andy-Shevchenko/vsprintf-Fix-potential-unaligned-access/20220124-224420
git checkout f1895edcabdc5dae0528ffff9c3cb665a937223d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> lib/vsprintf.c:1794:6: error: implicitly declaring library function 'stpcpy' with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-declaration]
p = stpcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
^
lib/vsprintf.c:1794:6: note: include the header <string.h> or explicitly provide a declaration for 'stpcpy'
1 error generated.
vim +1794 lib/vsprintf.c
1767
1768 static noinline_for_stack
1769 char *fourcc_string(char *buf, char *end, const u32 *fourcc,
1770 struct printf_spec spec, const char *fmt)
1771 {
1772 char output[sizeof("0123 little-endian (0x01234567)")];
1773 char *p = output;
1774 unsigned int i;
1775 u32 orig, val;
1776
1777 if (fmt[1] != 'c' || fmt[2] != 'c')
1778 return error_string(buf, end, "(%p4?)", spec);
1779
1780 if (check_pointer(&buf, end, fourcc, spec))
1781 return buf;
1782
1783 orig = get_unaligned(fourcc);
1784 val = orig & ~BIT(31);
1785
1786 for (i = 0; i < sizeof(u32); i++) {
1787 unsigned char c = val >> (i * 8);
1788
1789 /* Print non-control ASCII characters as-is, dot otherwise */
1790 *p++ = isascii(c) && isprint(c) ? c : '.';
1791 }
1792
1793 *p++ = ' ';
> 1794 p = stpcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
1795
1796 *p++ = ' ';
1797 *p++ = '(';
1798 p = special_hex_number(p, output + sizeof(output) - 2, orig, sizeof(u32));
1799 *p++ = ')';
1800 *p = '\0';
1801
1802 return string(buf, end, output, spec);
1803 }
1804
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH v2 2/2] vsprintf: Move space out of string literals in fourcc_string()
by kernel test robot
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.17-rc1 next-20220124]
[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/Andy-Shevchenko/vsprintf-Fix-pot...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
config: arc-randconfig-r026-20220124 (https://download.01.org/0day-ci/archive/20220125/202201250147.uYccwqwy-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.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
# https://github.com/0day-ci/linux/commit/f1895edcabdc5dae0528ffff9c3cb665a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andy-Shevchenko/vsprintf-Fix-potential-unaligned-access/20220124-224420
git checkout f1895edcabdc5dae0528ffff9c3cb665a937223d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
lib/vsprintf.c: In function 'va_format':
lib/vsprintf.c:1695:9: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1695 | buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
| ^~~
lib/vsprintf.c: In function 'fourcc_string':
>> lib/vsprintf.c:1794:13: error: implicit declaration of function 'stpcpy'; did you mean 'strcpy'? [-Werror=implicit-function-declaration]
1794 | p = stpcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
| ^~~~~~
| strcpy
>> lib/vsprintf.c:1794:11: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1794 | p = stpcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
| ^
cc1: some warnings being treated as errors
vim +1794 lib/vsprintf.c
1685
1686 static char *va_format(char *buf, char *end, struct va_format *va_fmt,
1687 struct printf_spec spec, const char *fmt)
1688 {
1689 va_list va;
1690
1691 if (check_pointer(&buf, end, va_fmt, spec))
1692 return buf;
1693
1694 va_copy(va, *va_fmt->va);
> 1695 buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
1696 va_end(va);
1697
1698 return buf;
1699 }
1700
1701 static noinline_for_stack
1702 char *uuid_string(char *buf, char *end, const u8 *addr,
1703 struct printf_spec spec, const char *fmt)
1704 {
1705 char uuid[UUID_STRING_LEN + 1];
1706 char *p = uuid;
1707 int i;
1708 const u8 *index = uuid_index;
1709 bool uc = false;
1710
1711 if (check_pointer(&buf, end, addr, spec))
1712 return buf;
1713
1714 switch (*(++fmt)) {
1715 case 'L':
1716 uc = true;
1717 fallthrough;
1718 case 'l':
1719 index = guid_index;
1720 break;
1721 case 'B':
1722 uc = true;
1723 break;
1724 }
1725
1726 for (i = 0; i < 16; i++) {
1727 if (uc)
1728 p = hex_byte_pack_upper(p, addr[index[i]]);
1729 else
1730 p = hex_byte_pack(p, addr[index[i]]);
1731 switch (i) {
1732 case 3:
1733 case 5:
1734 case 7:
1735 case 9:
1736 *p++ = '-';
1737 break;
1738 }
1739 }
1740
1741 *p = 0;
1742
1743 return string_nocheck(buf, end, uuid, spec);
1744 }
1745
1746 static noinline_for_stack
1747 char *netdev_bits(char *buf, char *end, const void *addr,
1748 struct printf_spec spec, const char *fmt)
1749 {
1750 unsigned long long num;
1751 int size;
1752
1753 if (check_pointer(&buf, end, addr, spec))
1754 return buf;
1755
1756 switch (fmt[1]) {
1757 case 'F':
1758 num = *(const netdev_features_t *)addr;
1759 size = sizeof(netdev_features_t);
1760 break;
1761 default:
1762 return error_string(buf, end, "(%pN?)", spec);
1763 }
1764
1765 return special_hex_number(buf, end, num, size);
1766 }
1767
1768 static noinline_for_stack
1769 char *fourcc_string(char *buf, char *end, const u32 *fourcc,
1770 struct printf_spec spec, const char *fmt)
1771 {
1772 char output[sizeof("0123 little-endian (0x01234567)")];
1773 char *p = output;
1774 unsigned int i;
1775 u32 orig, val;
1776
1777 if (fmt[1] != 'c' || fmt[2] != 'c')
1778 return error_string(buf, end, "(%p4?)", spec);
1779
1780 if (check_pointer(&buf, end, fourcc, spec))
1781 return buf;
1782
1783 orig = get_unaligned(fourcc);
1784 val = orig & ~BIT(31);
1785
1786 for (i = 0; i < sizeof(u32); i++) {
1787 unsigned char c = val >> (i * 8);
1788
1789 /* Print non-control ASCII characters as-is, dot otherwise */
1790 *p++ = isascii(c) && isprint(c) ? c : '.';
1791 }
1792
1793 *p++ = ' ';
> 1794 p = stpcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
1795
1796 *p++ = ' ';
1797 *p++ = '(';
1798 p = special_hex_number(p, output + sizeof(output) - 2, orig, sizeof(u32));
1799 *p++ = ')';
1800 *p = '\0';
1801
1802 return string(buf, end, output, spec);
1803 }
1804
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[esmil:visionfive 57/63] drivers/nvdla/sdp.c:265:18: warning: variable 'atom_size' set but not used
by kernel test robot
tree: https://github.com/esmil/linux visionfive
head: fdbe623707a8f3f9b9d2cb3c4c240299a12b8302
commit: 1858f8a7f96cbdd6c84d58ef025852d3538c7f3b [57/63] nvdla: add NVDLA driver
config: csky-allyesconfig (https://download.01.org/0day-ci/archive/20220125/202201250115.BCWxnuvp-lk...)
compiler: csky-linux-gcc (GCC) 11.2.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
# https://github.com/esmil/linux/commit/1858f8a7f96cbdd6c84d58ef025852d3538...
git remote add esmil https://github.com/esmil/linux
git fetch --no-tags esmil visionfive
git checkout 1858f8a7f96cbdd6c84d58ef025852d3538c7f3b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=csky SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/ drivers/nvdla/ drivers/staging/android/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/nvdla/sdp.c: In function 'processor_sdp_program':
>> drivers/nvdla/sdp.c:265:18: warning: variable 'atom_size' set but not used [-Wunused-but-set-variable]
265 | uint32_t atom_size;
| ^~~~~~~~~
--
drivers/nvdla/engine_isr.c: In function 'dla_isr_handler':
>> drivers/nvdla/engine_isr.c:38:18: warning: variable 'mask' set but not used [-Wunused-but-set-variable]
38 | uint32_t mask;
| ^~~~
--
drivers/nvdla/nvdla_core_callbacks.c: In function 'dla_debug':
>> drivers/nvdla/nvdla_core_callbacks.c:83:9: warning: function 'dla_debug' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
83 | vprintk(pr_fmt(str), args);
| ^~~~~~~
drivers/nvdla/nvdla_core_callbacks.c: In function 'dla_info':
>> drivers/nvdla/nvdla_core_callbacks.c:91:9: warning: function 'dla_info' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
91 | vprintk(str, args);
| ^~~~~~~
drivers/nvdla/nvdla_core_callbacks.c: In function 'dla_warn':
>> drivers/nvdla/nvdla_core_callbacks.c:99:9: warning: function 'dla_warn' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
99 | vprintk(str, args);
| ^~~~~~~
drivers/nvdla/nvdla_core_callbacks.c: In function 'dla_error':
>> drivers/nvdla/nvdla_core_callbacks.c:107:9: warning: function 'dla_error' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
107 | vprintk(str, args);
| ^~~~~~~
--
>> drivers/nvdla/engine.c:92: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Get DMA data cube address
drivers/nvdla/engine.c:113: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Read input buffer address
--
>> drivers/nvdla/bdma.c:125: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Program BDMA slot for transfer
--
>> drivers/nvdla/scheduler.c:432: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Dequeue next operation of same type from list of operations
drivers/nvdla/scheduler.c:579: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Handle operation completion notification
drivers/nvdla/scheduler.c:723: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Read network configuration from DRAM, network descriptor address
drivers/nvdla/scheduler.c:1060: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Execute task selected by task scheduler
vim +/atom_size +265 drivers/nvdla/sdp.c
256
257 static int32_t
258 processor_sdp_program(struct dla_processor_group *group)
259 {
260 int32_t ret = 0;
261 uint64_t src_addr = -1, x1_addr = -1, x2_addr = -1;
262 uint64_t y_addr = -1, dst_addr = -1;
263 uint32_t reg, high, low;
264 uint8_t fly;
> 265 uint32_t atom_size;
266 struct dla_sdp_op *x1_op;
267 struct dla_sdp_op *x2_op;
268 struct dla_sdp_op *y_op;
269 uint8_t x1_rdma_ena;
270 uint8_t x2_rdma_ena;
271 uint8_t y_rdma_ena;
272 uint8_t out_dma_ena;
273 struct dla_lut_param lut;
274 struct dla_engine *engine = dla_get_engine();
275 struct dla_sdp_op_desc *sdp_op;
276 struct dla_sdp_surface_desc *sdp_surface;
277
278 dla_trace("Enter: %s", __func__);
279 atom_size = engine->config_data->atom_size;
280
281 sdp_op = &group->operation_desc->sdp_op;
282 sdp_surface = &group->surface_desc->sdp_surface;
283
284 fly = sdp_surface->src_data.type == DLA_MEM_HW;
285 out_dma_ena = sdp_surface->dst_data.type != DLA_MEM_HW;
286 x1_op = &sdp_op->x1_op;
287 x2_op = &sdp_op->x2_op;
288 y_op = &sdp_op->y_op;
289 x1_rdma_ena = x1_op->enable && x1_op->type != SDP_OP_NONE;
290 x2_rdma_ena = x2_op->enable && x2_op->type != SDP_OP_NONE;
291 y_rdma_ena = y_op->enable && y_op->type != SDP_OP_NONE;
292
293 /* load address */
294 if (!fly) {
295 ret = dla_read_input_address(&sdp_surface->src_data,
296 &src_addr,
297 group->op_desc->index,
298 group->roi_index,
299 1);
300 if (ret)
301 goto exit;
302 CHECK_ALIGN(src_addr, atom_size);
303 }
304
305 if (out_dma_ena) {
306 dla_get_dma_cube_address(engine->driver_context,
307 engine->task->task_data,
308 sdp_surface->dst_data.address,
309 sdp_surface->dst_data.offset,
310 (void *)&dst_addr,
311 DESTINATION_DMA);
312 CHECK_ALIGN(dst_addr, atom_size);
313 }
314
315 if (sdp_op->lut_index >= 0) {
316 group->lut_index = sdp_op->lut_index;
317 dla_read_lut(engine, sdp_op->lut_index, (void *)&lut);
318 dla_debug_lut_params(&lut);
319 }
320
321
322 x1_rdma_ena &= (x1_op->mode != SDP_OP_PER_LAYER);
323 x2_rdma_ena &= (x2_op->mode != SDP_OP_PER_LAYER);
324 y_rdma_ena &= (y_op->mode != SDP_OP_PER_LAYER);
325
326 if (x1_rdma_ena) {
327 dla_get_dma_cube_address(engine->driver_context,
328 engine->task->task_data,
329 sdp_surface->x1_data.address,
330 sdp_surface->x1_data.offset,
331 (void *)&x1_addr,
332 DESTINATION_DMA);
333 CHECK_ALIGN(x1_addr, atom_size);
334 }
335 if (x2_rdma_ena) {
336 dla_get_dma_cube_address(engine->driver_context,
337 engine->task->task_data,
338 sdp_surface->x2_data.address,
339 sdp_surface->x2_data.offset,
340 (void *)&x2_addr,
341 DESTINATION_DMA);
342 CHECK_ALIGN(x2_addr, atom_size);
343 }
344 if (y_rdma_ena) {
345 dla_get_dma_cube_address(engine->driver_context,
346 engine->task->task_data,
347 sdp_surface->y_data.address,
348 sdp_surface->y_data.offset,
349 (void *)&y_addr,
350 DESTINATION_DMA);
351 CHECK_ALIGN(y_addr, atom_size);
352 }
353
354 reg = (map_fly[0] << SHIFT(SDP_RDMA_D_FEATURE_MODE_CFG_0, FLYING_MODE));
355 sdp_rdma_reg_write(D_FEATURE_MODE_CFG, reg);
356
357 reg = (map_ena[1] << SHIFT(SDP_RDMA_D_BRDMA_CFG_0, BRDMA_DISABLE));
358 sdp_rdma_reg_write(D_BRDMA_CFG, reg);
359 reg = (map_ena[1] << SHIFT(SDP_RDMA_D_NRDMA_CFG_0, NRDMA_DISABLE));
360 sdp_rdma_reg_write(D_NRDMA_CFG, reg);
361 reg = (map_ena[1] << SHIFT(SDP_RDMA_D_ERDMA_CFG_0, ERDMA_DISABLE));
362 sdp_rdma_reg_write(D_ERDMA_CFG, reg);
363
364 reg = (map_fly[fly] <<
365 SHIFT(SDP_RDMA_D_FEATURE_MODE_CFG_0, FLYING_MODE)) |
366 (map_wg[sdp_op->conv_mode == CONV_MODE_WINOGRAD] <<
367 SHIFT(SDP_RDMA_D_FEATURE_MODE_CFG_0, WINOGRAD)) |
368 (map_precision[sdp_op->src_precision] <<
369 SHIFT(SDP_RDMA_D_FEATURE_MODE_CFG_0, IN_PRECISION)) |
370 (map_precision[sdp_op->dst_precision] <<
371 SHIFT(SDP_RDMA_D_FEATURE_MODE_CFG_0, OUT_PRECISION)) |
372 (map_proc_precision[sdp_op->dst_precision][sdp_op->src_precision] <<
373 SHIFT(SDP_RDMA_D_FEATURE_MODE_CFG_0, PROC_PRECISION)) |
374 ((sdp_op->batch_num-1) <<
375 SHIFT(SDP_RDMA_D_FEATURE_MODE_CFG_0, BATCH_NUMBER));
376 sdp_rdma_reg_write(D_FEATURE_MODE_CFG, reg);
377
378 if (group->is_rdma_needed) {
379
380 sdp_rdma_reg_write(D_DATA_CUBE_WIDTH,
381 sdp_surface->src_data.width - 1);
382 sdp_rdma_reg_write(D_DATA_CUBE_HEIGHT,
383 sdp_surface->src_data.height - 1);
384 sdp_rdma_reg_write(D_DATA_CUBE_CHANNEL,
385 sdp_surface->src_data.channel - 1);
386
387 /* config SDP source info */
388 if (!fly) {
389 /**
390 * if not on-the-fly, we have to config
391 * the source cube info
392 */
393 high = HIGH32BITS(src_addr);
394 low = LOW32BITS(src_addr);
395 sdp_rdma_reg_write(D_SRC_BASE_ADDR_LOW, low);
396 sdp_rdma_reg_write(D_SRC_BASE_ADDR_HIGH, high);
397 sdp_rdma_reg_write(D_SRC_LINE_STRIDE,
398 sdp_surface->src_data.line_stride);
399 sdp_rdma_reg_write(D_SRC_SURFACE_STRIDE,
400 sdp_surface->src_data.surf_stride);
401 sdp_rdma_reg_write(D_SRC_DMA_CFG,
402 map_ram_type[sdp_surface->src_data.type]);
403 }
404
405 /* config x1 source info */
406 reg = (map_ena[x1_rdma_ena] <<
407 SHIFT(SDP_RDMA_D_BRDMA_CFG_0,
408 BRDMA_DISABLE)) |
409 (map_op_type[x1_op->type] <<
410 SHIFT(SDP_RDMA_D_BRDMA_CFG_0,
411 BRDMA_DATA_USE)) |
412 (map_element_size[x1_op->precision] <<
413 SHIFT(SDP_RDMA_D_BRDMA_CFG_0,
414 BRDMA_DATA_SIZE)) |
415 (map_op_mode[x1_op->mode] <<
416 SHIFT(SDP_RDMA_D_BRDMA_CFG_0,
417 BRDMA_DATA_MODE)) |
418 (map_ram_type[sdp_surface->x1_data.type] <<
419 SHIFT(SDP_RDMA_D_BRDMA_CFG_0,
420 BRDMA_RAM_TYPE));
421 sdp_rdma_reg_write(D_BRDMA_CFG, reg);
422
423 if (x1_rdma_ena) {
424 high = HIGH32BITS(x1_addr);
425 low = LOW32BITS(x1_addr);
426 sdp_rdma_reg_write(D_BS_BASE_ADDR_LOW,
427 low);
428 sdp_rdma_reg_write(D_BS_BASE_ADDR_HIGH,
429 high);
430 sdp_rdma_reg_write(D_BS_LINE_STRIDE,
431 sdp_surface->x1_data.line_stride);
432 sdp_rdma_reg_write(D_BS_SURFACE_STRIDE,
433 sdp_surface->x1_data.surf_stride);
434 }
435
436 /* config x2 source info */
437 reg = (map_ena[x2_rdma_ena] <<
438 SHIFT(SDP_RDMA_D_NRDMA_CFG_0,
439 NRDMA_DISABLE)) |
440 (map_op_type[x2_op->type] <<
441 SHIFT(SDP_RDMA_D_NRDMA_CFG_0,
442 NRDMA_DATA_USE)) |
443 (map_element_size[x2_op->precision] <<
444 SHIFT(SDP_RDMA_D_NRDMA_CFG_0,
445 NRDMA_DATA_SIZE)) |
446 (map_op_mode[x2_op->mode] <<
447 SHIFT(SDP_RDMA_D_NRDMA_CFG_0,
448 NRDMA_DATA_MODE)) |
449 (map_ram_type[sdp_surface->x2_data.type] <<
450 SHIFT(SDP_RDMA_D_NRDMA_CFG_0,
451 NRDMA_RAM_TYPE));
452
453 sdp_rdma_reg_write(D_NRDMA_CFG, reg);
454
455 if (x2_rdma_ena) {
456 high = HIGH32BITS(x2_addr);
457 low = LOW32BITS(x2_addr);
458 sdp_rdma_reg_write(D_BN_BASE_ADDR_LOW,
459 low);
460 sdp_rdma_reg_write(D_BN_BASE_ADDR_HIGH,
461 high);
462 sdp_rdma_reg_write(D_BN_LINE_STRIDE,
463 sdp_surface->x2_data.line_stride);
464 sdp_rdma_reg_write(D_BN_SURFACE_STRIDE,
465 sdp_surface->x2_data.surf_stride);
466 }
467
468 /* config y source info */
469 reg = (map_ena[y_rdma_ena] <<
470 SHIFT(SDP_RDMA_D_ERDMA_CFG_0,
471 ERDMA_DISABLE)) |
472 (map_op_type[y_op->type] <<
473 SHIFT(SDP_RDMA_D_ERDMA_CFG_0,
474 ERDMA_DATA_USE)) |
475 (map_element_size[y_op->precision] <<
476 SHIFT(SDP_RDMA_D_ERDMA_CFG_0,
477 ERDMA_DATA_SIZE)) |
478 (map_op_mode[y_op->mode] <<
479 SHIFT(SDP_RDMA_D_ERDMA_CFG_0,
480 ERDMA_DATA_MODE)) |
481 (map_ram_type[sdp_surface->y_data.type] <<
482 SHIFT(SDP_RDMA_D_ERDMA_CFG_0,
483 ERDMA_RAM_TYPE));
484
485 sdp_rdma_reg_write(D_ERDMA_CFG, reg);
486 if (y_rdma_ena) {
487 high = HIGH32BITS(y_addr);
488 low = LOW32BITS(y_addr);
489 sdp_rdma_reg_write(D_EW_BASE_ADDR_LOW,
490 low);
491 sdp_rdma_reg_write(D_EW_BASE_ADDR_HIGH,
492 high);
493 sdp_rdma_reg_write(D_EW_LINE_STRIDE,
494 sdp_surface->y_data.line_stride);
495 sdp_rdma_reg_write(D_EW_SURFACE_STRIDE,
496 sdp_surface->y_data.surf_stride);
497 }
498 }
499
500 if (sdp_op->lut_index >= 0)
501 update_lut(SDP_S_LUT_ACCESS_CFG_0, &lut,
502 sdp_op->src_precision);
503
504 sdp_reg_write(D_DATA_CUBE_WIDTH, sdp_surface->src_data.width - 1);
505 sdp_reg_write(D_DATA_CUBE_HEIGHT, sdp_surface->src_data.height - 1);
506 sdp_reg_write(D_DATA_CUBE_CHANNEL, sdp_surface->src_data.channel - 1);
507
508 if (out_dma_ena) {
509 high = HIGH32BITS(dst_addr);
510 low = LOW32BITS(dst_addr);
511 sdp_reg_write(D_DST_BASE_ADDR_HIGH,
512 high);
513 sdp_reg_write(D_DST_BASE_ADDR_LOW,
514 low);
515 sdp_reg_write(D_DST_LINE_STRIDE,
516 sdp_surface->dst_data.line_stride);
517 sdp_reg_write(D_DST_SURFACE_STRIDE,
518 sdp_surface->dst_data.surf_stride);
519 }
520
521 /* Config BS module */
522 reg = (map_bypass[x1_op->enable] <<
523 SHIFT(SDP_D_DP_BS_CFG_0,
524 BS_BYPASS)) |
525 (map_bypass[x1_op->type != SDP_OP_MUL &&
526 x1_op->type != SDP_OP_NONE] <<
527 SHIFT(SDP_D_DP_BS_CFG_0,
528 BS_ALU_BYPASS)) |
529 (map_alu_op[x1_op->alu_type] <<
530 SHIFT(SDP_D_DP_BS_CFG_0,
531 BS_ALU_ALGO)) |
532 (map_bypass[x1_op->type != SDP_OP_ADD &&
533 x1_op->type != SDP_OP_NONE] <<
534 SHIFT(SDP_D_DP_BS_CFG_0,
535 BS_MUL_BYPASS)) |
536 (map_prelu[x1_op->act == ACTIVATION_PRELU]
537 << SHIFT(SDP_D_DP_BS_CFG_0,
538 BS_MUL_PRELU)) |
539 (map_bypass[x1_op->act == ACTIVATION_RELU] <<
540 SHIFT(SDP_D_DP_BS_CFG_0,
541 BS_RELU_BYPASS));
542 sdp_reg_write(D_DP_BS_CFG, reg);
543
544 if (x1_op->enable) {
545 if (x1_op->type == SDP_OP_ADD ||
546 x1_op->type == SDP_OP_BOTH) {
547 reg = (map_alu_src[x1_op->mode == SDP_OP_PER_LAYER] <<
548 SHIFT(SDP_D_DP_BS_ALU_CFG_0,
549 BS_ALU_SRC)) |
550 (x1_op->shift_value <<
551 SHIFT(SDP_D_DP_BS_ALU_CFG_0,
552 BS_ALU_SHIFT_VALUE));
553 sdp_reg_write(D_DP_BS_ALU_CFG, reg);
554 }
555
556 if (x1_op->mode == SDP_OP_PER_LAYER) {
557 sdp_reg_write(D_DP_BS_ALU_SRC_VALUE,
558 x1_op->alu_operand);
559 sdp_reg_write(D_DP_BS_MUL_SRC_VALUE,
560 x1_op->mul_operand);
561 }
562
563 /**
564 * MUL truncate will take effect no matter
565 * MUL is bypassed or not
566 */
567 reg = (map_alu_src[x1_op->mode == SDP_OP_PER_LAYER] <<
568 SHIFT(SDP_D_DP_BS_MUL_CFG_0,
569 BS_MUL_SRC)) |
570 (x1_op->truncate <<
571 SHIFT(SDP_D_DP_BS_MUL_CFG_0,
572 BS_MUL_SHIFT_VALUE));
573 sdp_reg_write(D_DP_BS_MUL_CFG, reg);
574 }
575
576 /* Config BN module */
577 reg = (map_bypass[x2_op->enable] <<
578 SHIFT(SDP_D_DP_BN_CFG_0,
579 BN_BYPASS)) |
580 (map_bypass[x2_op->type != SDP_OP_MUL &&
581 x2_op->type != SDP_OP_NONE] <<
582 SHIFT(SDP_D_DP_BN_CFG_0,
583 BN_ALU_BYPASS)) |
584 (map_alu_op[x2_op->alu_type] <<
585 SHIFT(SDP_D_DP_BN_CFG_0,
586 BN_ALU_ALGO)) |
587 (map_bypass[x2_op->type != SDP_OP_ADD &&
588 x2_op->type != SDP_OP_NONE] <<
589 SHIFT(SDP_D_DP_BN_CFG_0,
590 BN_MUL_BYPASS)) |
591 (map_prelu[x2_op->act == ACTIVATION_PRELU]
592 << SHIFT(SDP_D_DP_BN_CFG_0,
593 BN_MUL_PRELU)) |
594 (map_bypass[x2_op->act == ACTIVATION_RELU]
595 << SHIFT(SDP_D_DP_BN_CFG_0,
596 BN_RELU_BYPASS));
597 sdp_reg_write(D_DP_BN_CFG, reg);
598
599 if (x2_op->enable) {
600 if (x2_op->type == SDP_OP_ADD ||
601 x2_op->type == SDP_OP_BOTH) {
602 reg = (map_alu_src[x2_op->mode == SDP_OP_PER_LAYER] <<
603 SHIFT(SDP_D_DP_BN_ALU_CFG_0,
604 BN_ALU_SRC)) |
605 (x2_op->shift_value <<
606 SHIFT(SDP_D_DP_BN_ALU_CFG_0,
607 BN_ALU_SHIFT_VALUE));
608 sdp_reg_write(D_DP_BN_ALU_CFG, reg);
609 }
610
611 if (x2_op->mode == SDP_OP_PER_LAYER) {
612 sdp_reg_write(D_DP_BN_ALU_SRC_VALUE,
613 x2_op->alu_operand);
614 sdp_reg_write(D_DP_BN_MUL_SRC_VALUE,
615 x2_op->mul_operand);
616 }
617
618 reg = (map_alu_src[x2_op->mode == SDP_OP_PER_LAYER] <<
619 SHIFT(SDP_D_DP_BN_MUL_CFG_0,
620 BN_MUL_SRC)) |
621 (x2_op->truncate <<
622 SHIFT(SDP_D_DP_BN_MUL_CFG_0,
623 BN_MUL_SHIFT_VALUE));
624 sdp_reg_write(D_DP_BN_MUL_CFG, reg);
625 }
626
627 /* Config EW module */
628 reg = (map_bypass[y_op->enable] <<
629 SHIFT(SDP_D_DP_EW_CFG_0,
630 EW_BYPASS)) |
631 (map_bypass[y_op->type != SDP_OP_MUL &&
632 y_op->type != SDP_OP_NONE] <<
633 SHIFT(SDP_D_DP_EW_CFG_0,
634 EW_ALU_BYPASS)) |
635 (map_alu_op[y_op->alu_type] <<
636 SHIFT(SDP_D_DP_EW_CFG_0,
637 EW_ALU_ALGO)) |
638 (map_bypass[y_op->type != SDP_OP_ADD &&
639 y_op->type != SDP_OP_NONE] <<
640 SHIFT(SDP_D_DP_EW_CFG_0,
641 EW_MUL_BYPASS)) |
642 ((map_prelu[y_op->act == ACTIVATION_PRELU]) <<
643 SHIFT(SDP_D_DP_EW_CFG_0,
644 EW_MUL_PRELU)) |
645 (map_bypass[y_op->act == ACTIVATION_LUT] <<
646 SHIFT(SDP_D_DP_EW_CFG_0,
647 EW_LUT_BYPASS));
648 sdp_reg_write(D_DP_EW_CFG, reg);
649
650 if (y_op->enable) {
651 if (y_op->type == SDP_OP_ADD || y_op->type == SDP_OP_BOTH) {
652 reg = (map_alu_src[y_op->mode == SDP_OP_PER_LAYER] <<
653 SHIFT(SDP_D_DP_EW_ALU_CFG_0,
654 EW_ALU_SRC)) |
655 (map_bypass[y_op->cvt.alu_cvt.enable] <<
656 SHIFT(SDP_D_DP_EW_ALU_CFG_0,
657 EW_ALU_CVT_BYPASS));
658 sdp_reg_write(D_DP_EW_ALU_CFG, reg);
659
660 if (y_op->mode == SDP_OP_PER_LAYER) {
661 sdp_reg_write(D_DP_EW_ALU_SRC_VALUE,
662 y_op->alu_operand);
663 } else {
664 sdp_reg_write(D_DP_EW_ALU_CVT_OFFSET_VALUE,
665 y_op->cvt.alu_cvt.offset);
666 sdp_reg_write(D_DP_EW_ALU_CVT_SCALE_VALUE,
667 y_op->cvt.alu_cvt.scale);
668 sdp_reg_write(D_DP_EW_ALU_CVT_TRUNCATE_VALUE,
669 y_op->cvt.alu_cvt.truncate);
670 }
671 }
672
673 if (y_op->type == SDP_OP_MUL || y_op->type == SDP_OP_BOTH) {
674 reg = (map_alu_src[y_op->mode == SDP_OP_PER_LAYER] <<
675 SHIFT(SDP_D_DP_EW_MUL_CFG_0,
676 EW_MUL_SRC)) |
677 (map_bypass[y_op->cvt.mul_cvt.enable] <<
678 SHIFT(SDP_D_DP_EW_MUL_CFG_0,
679 EW_MUL_CVT_BYPASS));
680 sdp_reg_write(D_DP_EW_MUL_CFG, reg);
681
682 if (y_op->mode == SDP_OP_PER_LAYER) {
683 sdp_reg_write(D_DP_EW_MUL_SRC_VALUE,
684 y_op->mul_operand);
685 } else {
686 sdp_reg_write(D_DP_EW_MUL_CVT_OFFSET_VALUE,
687 y_op->cvt.mul_cvt.offset);
688 sdp_reg_write(D_DP_EW_MUL_CVT_SCALE_VALUE,
689 y_op->cvt.mul_cvt.scale);
690 sdp_reg_write(D_DP_EW_MUL_CVT_TRUNCATE_VALUE,
691 y_op->cvt.mul_cvt.truncate);
692 }
693 }
694
695 sdp_reg_write(D_DP_EW_TRUNCATE_VALUE, y_op->truncate);
696 }
697
698 reg = (map_fly[sdp_surface->src_data.type == DLA_MEM_HW] <<
699 SHIFT(SDP_D_FEATURE_MODE_CFG_0,
700 FLYING_MODE)) |
701 (map_dst[sdp_surface->dst_data.type == DLA_MEM_HW] <<
702 SHIFT(SDP_D_FEATURE_MODE_CFG_0,
703 OUTPUT_DST)) |
704 (map_wg[sdp_op->conv_mode == CONV_MODE_WINOGRAD] <<
705 SHIFT(SDP_D_FEATURE_MODE_CFG_0,
706 WINOGRAD)) |
707 ((sdp_op->batch_num - 1) <<
708 SHIFT(SDP_D_FEATURE_MODE_CFG_0,
709 BATCH_NUMBER));
710 sdp_reg_write(D_FEATURE_MODE_CFG, reg);
711 sdp_reg_write(D_DST_DMA_CFG,
712 map_ram_type[sdp_surface->dst_data.type]);
713 if (sdp_op->batch_num > 1)
714 sdp_reg_write(D_DST_BATCH_STRIDE, sdp_op->batch_stride);
715
716 reg =
717 (map_proc_precision[sdp_op->dst_precision][sdp_op->src_precision] <<
718 SHIFT(SDP_D_DATA_FORMAT_0,
719 PROC_PRECISION)) |
720 (map_precision[sdp_op->dst_precision] <<
721 SHIFT(SDP_D_DATA_FORMAT_0,
722 OUT_PRECISION));
723 sdp_reg_write(D_DATA_FORMAT, reg);
724 sdp_reg_write(D_CVT_OFFSET, sdp_op->out_cvt.offset);
725 sdp_reg_write(D_CVT_SCALE, sdp_op->out_cvt.scale);
726 sdp_reg_write(D_CVT_SHIFT, sdp_op->out_cvt.truncate);
727
728 exit:
729 dla_trace("Exit: %s", __func__);
730 RETURN(ret);
731 }
732
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
arch/x86/boot/compressed/../../../../lib/zstd/decompress/zstd_decompress_block.c:1390 ZSTD_decompressSequences() warn: inconsistent indenting
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: e0c1b49f5b674cca7b10549c53b3791d0bbc90a8 lib: zstd: Upgrade to latest upstream zstd version 1.4.10
date: 3 months ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220125/202201250105.FTvWmcNq-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
arch/x86/boot/compressed/../../../../lib/zstd/decompress/zstd_decompress_block.c:1390 ZSTD_decompressSequences() warn: inconsistent indenting
arch/x86/boot/compressed/../../../../lib/zstd/decompress/zstd_decompress_block.c:1414 ZSTD_decompressSequencesLong() warn: inconsistent indenting
Old smatch warnings:
arch/x86/boot/compressed/../../../../lib/zstd/decompress/huf_decompress.c:397 HUF_decompress4X1_usingDTable_internal_body() warn: maybe use && instead of &
arch/x86/boot/compressed/../../../../lib/zstd/decompress/huf_decompress.c:397 HUF_decompress4X1_usingDTable_internal_body() warn: maybe use && instead of &
arch/x86/boot/compressed/../../../../lib/zstd/decompress/huf_decompress.c:850 HUF_decompress4X2_usingDTable_internal_body() warn: maybe use && instead of &
arch/x86/boot/compressed/../../../../lib/zstd/decompress/huf_decompress.c:850 HUF_decompress4X2_usingDTable_internal_body() warn: maybe use && instead of &
arch/x86/boot/compressed/misc.c:292 parse_elf() warn: ignoring unreachable code.
vim +1390 arch/x86/boot/compressed/../../../../lib/zstd/decompress/zstd_decompress_block.c
1369
1370 typedef size_t (*ZSTD_decompressSequences_t)(
1371 ZSTD_DCtx* dctx,
1372 void* dst, size_t maxDstSize,
1373 const void* seqStart, size_t seqSize, int nbSeq,
1374 const ZSTD_longOffset_e isLongOffset,
1375 const int frame);
1376
1377 #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
1378 static size_t
1379 ZSTD_decompressSequences(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize,
1380 const void* seqStart, size_t seqSize, int nbSeq,
1381 const ZSTD_longOffset_e isLongOffset,
1382 const int frame)
1383 {
1384 DEBUGLOG(5, "ZSTD_decompressSequences");
1385 #if DYNAMIC_BMI2
1386 if (dctx->bmi2) {
1387 return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);
1388 }
1389 #endif
> 1390 return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);
1391 }
1392 #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */
1393
1394
1395 #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
1396 /* ZSTD_decompressSequencesLong() :
1397 * decompression function triggered when a minimum share of offsets is considered "long",
1398 * aka out of cache.
1399 * note : "long" definition seems overloaded here, sometimes meaning "wider than bitstream register", and sometimes meaning "farther than memory cache distance".
1400 * This function will try to mitigate main memory latency through the use of prefetching */
1401 static size_t
1402 ZSTD_decompressSequencesLong(ZSTD_DCtx* dctx,
1403 void* dst, size_t maxDstSize,
1404 const void* seqStart, size_t seqSize, int nbSeq,
1405 const ZSTD_longOffset_e isLongOffset,
1406 const int frame)
1407 {
1408 DEBUGLOG(5, "ZSTD_decompressSequencesLong");
1409 #if DYNAMIC_BMI2
1410 if (dctx->bmi2) {
1411 return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);
1412 }
1413 #endif
> 1414 return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame);
1415 }
1416 #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */
1417
1418
1419
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH 3/5] mm: page_vma_mapped: support checking if a pfn is mapped into a vma
by kernel test robot
Hi Muchun,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-mm/master]
url: https://github.com/0day-ci/linux/commits/Muchun-Song/mm-rmap-fix-cache-fl...
base: https://github.com/hnaz/linux-mm master
config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20220125/202201250022.zqRQezMj-lk...)
compiler: powerpc-linux-gcc (GCC) 11.2.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
# https://github.com/0day-ci/linux/commit/0c83393977dfe53edadec9793328b7281...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Muchun-Song/mm-rmap-fix-cache-flush-on-THP-pages/20220121-160020
git checkout 0c83393977dfe53edadec9793328b7281e8af7aa
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
mm/page_vma_mapped.c: In function 'page_vma_mapped_walk':
>> mm/page_vma_mapped.c:246:37: error: implicit declaration of function 'pmd_pfn'; did you mean 'pmd_off'? [-Werror=implicit-function-declaration]
246 | if (pmd_pfn(pmde) != pfn)
| ^~~~~~~
| pmd_off
cc1: some warnings being treated as errors
vim +246 mm/page_vma_mapped.c
134
135 /**
136 * page_vma_mapped_walk - check if @pvmw->page or @pvmw->pfn is mapped in
137 * @pvmw->vma at @pvmw->address
138 * @pvmw: pointer to struct page_vma_mapped_walk. page (or pfn and nr and
139 * index), vma, address and flags must be set. pmd, pte and ptl must be NULL.
140 *
141 * Returns true if the page or pfn is mapped in the vma. @pvmw->pmd and
142 * @pvmw->pte point to relevant page table entries. @pvmw->ptl is locked.
143 * @pvmw->address is adjusted if needed (for PTE-mapped THPs).
144 *
145 * If @pvmw->pmd is set but @pvmw->pte is not, you have found PMD-mapped page
146 * (usually THP or Huge DEVMAP). For PMD-mapped page, you should run
147 * page_vma_mapped_walk() in a loop to find all PTEs that map the huge page.
148 *
149 * For HugeTLB pages, @pvmw->pte is set to the relevant page table entry
150 * regardless of which page table level the page is mapped at. @pvmw->pmd is
151 * NULL.
152 *
153 * Returns false if there are no more page table entries for the page or pfn in
154 * the vma. @pvmw->ptl is unlocked and @pvmw->pte is unmapped.
155 *
156 * If you need to stop the walk before page_vma_mapped_walk() returned false,
157 * use page_vma_mapped_walk_done(). It will do the housekeeping.
158 */
159 bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
160 {
161 struct mm_struct *mm = pvmw->vma->vm_mm;
162 struct page *page;
163 unsigned long end;
164 unsigned long pfn;
165 pgd_t *pgd;
166 p4d_t *p4d;
167 pud_t *pud;
168 pmd_t pmde;
169
170 if (pvmw->flags & PVMW_PFN_WALK) {
171 page = NULL;
172 pfn = pvmw->pfn;
173 } else {
174 page = pvmw->page;
175 pfn = page_to_pfn(page);
176 }
177
178 /* The only possible pmd mapping has been handled on last iteration */
179 if (pvmw->pmd && !pvmw->pte)
180 return not_found(pvmw);
181
182 if (unlikely(page && PageHuge(page))) {
183 /* The only possible mapping was handled on last iteration */
184 if (pvmw->pte)
185 return not_found(pvmw);
186
187 /* when pud is not present, pte will be NULL */
188 pvmw->pte = huge_pte_offset(mm, pvmw->address, page_size(page));
189 if (!pvmw->pte)
190 return false;
191
192 pvmw->ptl = huge_pte_lockptr(page_hstate(page), mm, pvmw->pte);
193 spin_lock(pvmw->ptl);
194 if (!check_pte(pvmw))
195 return not_found(pvmw);
196 return true;
197 }
198
199 /*
200 * Seek to next pte only makes sense for THP.
201 * But more important than that optimization, is to filter out
202 * any PageKsm page: whose page->index misleads vma_address()
203 * and vma_address_end() to disaster.
204 */
205 if (page)
206 end = PageTransCompound(page) ?
207 vma_address_end(page, pvmw->vma) :
208 pvmw->address + PAGE_SIZE;
209 else
210 end = vma_pgoff_address_end(pvmw->index, pvmw->nr, pvmw->vma);
211
212 if (pvmw->pte)
213 goto next_pte;
214 restart:
215 do {
216 pgd = pgd_offset(mm, pvmw->address);
217 if (!pgd_present(*pgd)) {
218 step_forward(pvmw, PGDIR_SIZE);
219 continue;
220 }
221 p4d = p4d_offset(pgd, pvmw->address);
222 if (!p4d_present(*p4d)) {
223 step_forward(pvmw, P4D_SIZE);
224 continue;
225 }
226 pud = pud_offset(p4d, pvmw->address);
227 if (!pud_present(*pud)) {
228 step_forward(pvmw, PUD_SIZE);
229 continue;
230 }
231
232 pvmw->pmd = pmd_offset(pud, pvmw->address);
233 /*
234 * Make sure the pmd value isn't cached in a register by the
235 * compiler and used as a stale value after we've observed a
236 * subsequent update.
237 */
238 pmde = READ_ONCE(*pvmw->pmd);
239
240 if (pmd_leaf(pmde) || is_pmd_migration_entry(pmde)) {
241 pvmw->ptl = pmd_lock(mm, pvmw->pmd);
242 pmde = *pvmw->pmd;
243 if (likely(pmd_leaf(pmde))) {
244 if (pvmw->flags & PVMW_MIGRATION)
245 return not_found(pvmw);
> 246 if (pmd_pfn(pmde) != pfn)
247 return not_found(pvmw);
248 return true;
249 }
250 if (!pmd_present(pmde)) {
251 swp_entry_t entry;
252
253 if (!thp_migration_supported() ||
254 !(pvmw->flags & PVMW_MIGRATION))
255 return not_found(pvmw);
256 entry = pmd_to_swp_entry(pmde);
257 if (!is_migration_entry(entry) ||
258 page_to_pfn(pfn_swap_entry_to_page(entry)) != pfn)
259 return not_found(pvmw);
260 return true;
261 }
262 /* THP pmd was split under us: handle on pte level */
263 spin_unlock(pvmw->ptl);
264 pvmw->ptl = NULL;
265 } else if (!pmd_present(pmde)) {
266 /*
267 * If PVMW_SYNC, take and drop THP pmd lock so that we
268 * cannot return prematurely, while zap_huge_pmd() has
269 * cleared *pmd but not decremented compound_mapcount().
270 */
271 if ((pvmw->flags & PVMW_SYNC) && page &&
272 PageTransCompound(page)) {
273 spinlock_t *ptl = pmd_lock(mm, pvmw->pmd);
274
275 spin_unlock(ptl);
276 }
277 step_forward(pvmw, PMD_SIZE);
278 continue;
279 }
280 if (!map_pte(pvmw))
281 goto next_pte;
282 this_pte:
283 if (check_pte(pvmw))
284 return true;
285 next_pte:
286 do {
287 pvmw->address += PAGE_SIZE;
288 if (pvmw->address >= end)
289 return not_found(pvmw);
290 /* Did we cross page table boundary? */
291 if ((pvmw->address & (PMD_SIZE - PAGE_SIZE)) == 0) {
292 if (pvmw->ptl) {
293 spin_unlock(pvmw->ptl);
294 pvmw->ptl = NULL;
295 }
296 pte_unmap(pvmw->pte);
297 pvmw->pte = NULL;
298 goto restart;
299 }
300 pvmw->pte++;
301 if ((pvmw->flags & PVMW_SYNC) && !pvmw->ptl) {
302 pvmw->ptl = pte_lockptr(mm, pvmw->pmd);
303 spin_lock(pvmw->ptl);
304 }
305 } while (pte_none(*pvmw->pte));
306
307 if (!pvmw->ptl) {
308 pvmw->ptl = pte_lockptr(mm, pvmw->pmd);
309 spin_lock(pvmw->ptl);
310 }
311 goto this_pte;
312 } while (pvmw->address < end);
313
314 return false;
315 }
316
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[ammarfaizi2-block:google/android/kernel/common/android13-5.10 2301/9999] drivers/usb/gadget/configfs.c:1620:2: error: implicit declaration of function 'acc_disconnect'
by kernel test robot
Hi Ronak,
FYI, the error/warning still remains.
tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android13-5.10
head: eb69f26fe8e2177cfb7cbf859a23fc5ac59cacb7
commit: 80fef39de7e9dbe706d0cbc820a09b5c05dc366f [2301/9999] ANDROID: usb: gadget: Resolve NULL pointer dereference in composite_disconnect
config: arm64-randconfig-r021-20220120 (https://download.01.org/0day-ci/archive/20220125/202201250013.vOmQcvaI-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7b3d30728816403d1fd73cc5082e9fb761262bce)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/ammarfaizi2/linux-block/commit/80fef39de7e9dbe706d0cbc...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android13-5.10
git checkout 80fef39de7e9dbe706d0cbc820a09b5c05dc366f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/usb/gadget/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/usb/gadget/configfs.c:1620:2: error: implicit declaration of function 'acc_disconnect' [-Werror,-Wimplicit-function-declaration]
acc_disconnect();
^
1 error generated.
vim +/acc_disconnect +1620 drivers/usb/gadget/configfs.c
1603
1604 static void configfs_composite_disconnect(struct usb_gadget *gadget)
1605 {
1606 struct usb_composite_dev *cdev;
1607 struct gadget_info *gi;
1608 unsigned long flags;
1609
1610 cdev = get_gadget_data(gadget);
1611 if (!cdev)
1612 return;
1613
1614 #ifdef CONFIG_USB_CONFIGFS_F_ACC
1615 /*
1616 * accessory HID support can be active while the
1617 * accessory function is not actually enabled,
1618 * so we need to inform it when we are disconnected.
1619 */
> 1620 acc_disconnect();
1621 #endif
1622 gi = container_of(cdev, struct gadget_info, cdev);
1623 spin_lock_irqsave(&gi->spinlock, flags);
1624 cdev = get_gadget_data(gadget);
1625 if (!cdev || gi->unbind) {
1626 spin_unlock_irqrestore(&gi->spinlock, flags);
1627 return;
1628 }
1629
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[PATCH bpf-next] bpf: fix flexible_array.cocci warnings
by Julia Lawall
From: kernel test robot <lkp(a)intel.com>
Zero-length and one-element arrays are deprecated, see
Documentation/process/deprecated.rst
Flexible-array members should be used instead.
Generated by: scripts/coccinelle/misc/flexible_array.cocci
Fixes: c1ff181ffabc ("selftests/bpf: Extend kfunc selftests")
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: Julia Lawall <julia.lawall(a)inria.fr>
CC: Kumar Kartikeya Dwivedi <memxor(a)gmail.com>
---
url: https://github.com/0day-ci/linux/commits/Kumar-Kartikeya-Dwivedi/Introduc...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
test_run.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -293,7 +293,7 @@ struct prog_test_fail2 {
struct prog_test_fail3 {
int len;
char arr1[2];
- char arr2[0];
+ char arr2[];
};
noinline void bpf_kfunc_call_test_pass_ctx(struct __sk_buff *skb)
7 months, 4 weeks
fs/ext4/fast_commit.c:1774:50: sparse: sparse: incorrect type in argument 2 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 0b5b5a62b945a141e64011b2f90ee7e46f14be98 ext4: use ext4_ext_remove_space() for fast commit replay delete range
date: 2 weeks ago
config: csky-randconfig-s032-20220120 (https://download.01.org/0day-ci/archive/20220125/202201250031.GhpANyOP-lk...)
compiler: csky-linux-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0b5b5a62b945a141e64011b2f90ee7e46f14be98
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash
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 >>)
>> fs/ext4/fast_commit.c:1774:50: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned int [usertype] start @@ got restricted __le32 [addressable] [usertype] fc_lblk @@
fs/ext4/fast_commit.c:1774:50: sparse: expected unsigned int [usertype] start
fs/ext4/fast_commit.c:1774:50: sparse: got restricted __le32 [addressable] [usertype] fc_lblk
>> fs/ext4/fast_commit.c:1775:39: sparse: sparse: restricted __le32 degrades to integer
fs/ext4/fast_commit.c:1775:56: sparse: sparse: restricted __le32 degrades to integer
vim +1774 fs/ext4/fast_commit.c
1724
1725 /* Replay DEL_RANGE tag */
1726 static int
1727 ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
1728 u8 *val)
1729 {
1730 struct inode *inode;
1731 struct ext4_fc_del_range lrange;
1732 struct ext4_map_blocks map;
1733 ext4_lblk_t cur, remaining;
1734 int ret;
1735
1736 memcpy(&lrange, val, sizeof(lrange));
1737 cur = le32_to_cpu(lrange.fc_lblk);
1738 remaining = le32_to_cpu(lrange.fc_len);
1739
1740 trace_ext4_fc_replay(sb, EXT4_FC_TAG_DEL_RANGE,
1741 le32_to_cpu(lrange.fc_ino), cur, remaining);
1742
1743 inode = ext4_iget(sb, le32_to_cpu(lrange.fc_ino), EXT4_IGET_NORMAL);
1744 if (IS_ERR(inode)) {
1745 jbd_debug(1, "Inode %d not found", le32_to_cpu(lrange.fc_ino));
1746 return 0;
1747 }
1748
1749 ret = ext4_fc_record_modified_inode(sb, inode->i_ino);
1750
1751 jbd_debug(1, "DEL_RANGE, inode %ld, lblk %d, len %d\n",
1752 inode->i_ino, le32_to_cpu(lrange.fc_lblk),
1753 le32_to_cpu(lrange.fc_len));
1754 while (remaining > 0) {
1755 map.m_lblk = cur;
1756 map.m_len = remaining;
1757
1758 ret = ext4_map_blocks(NULL, inode, &map, 0);
1759 if (ret < 0) {
1760 iput(inode);
1761 return 0;
1762 }
1763 if (ret > 0) {
1764 remaining -= ret;
1765 cur += ret;
1766 ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
1767 } else {
1768 remaining -= map.m_len;
1769 cur += map.m_len;
1770 }
1771 }
1772
1773 down_write(&EXT4_I(inode)->i_data_sem);
> 1774 ret = ext4_ext_remove_space(inode, lrange.fc_lblk,
> 1775 lrange.fc_lblk + lrange.fc_len - 1);
1776 up_write(&EXT4_I(inode)->i_data_sem);
1777 if (ret) {
1778 iput(inode);
1779 return 0;
1780 }
1781 ext4_ext_replay_shrink_inode(inode,
1782 i_size_read(inode) >> sb->s_blocksize_bits);
1783 ext4_mark_inode_dirty(NULL, inode);
1784 iput(inode);
1785
1786 return 0;
1787 }
1788
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks