[rppt:memblock/iterators-cleanup/v3 10/17] arch/powerpc/kexec/file_load_64.c:385:1: warning: no return statement in function returning non-void
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git memblock/iterators-cleanup/v3
head: f0d593460d044672ca2ea065efc283e30dd23ef1
commit: 3efd016ce3025d16da91568f97de6f0006281657 [10/17] memblock: reduce number of parameters in for_each_mem_range()
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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 3efd016ce3025d16da91568f97de6f0006281657
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>):
arch/powerpc/kexec/file_load_64.c: In function '__locate_mem_hole_bottom_up':
arch/powerpc/kexec/file_load_64.c:354:40: error: macro "for_each_mem_range" passed 8 arguments, but takes just 3
354 | MEMBLOCK_NONE, &start, &end, NULL) {
| ^
In file included from arch/powerpc/kexec/file_load_64.c:21:
include/linux/memblock.h:211: note: macro "for_each_mem_range" defined here
211 | #define for_each_mem_range(i, p_start, p_end) \
|
arch/powerpc/kexec/file_load_64.c:353:2: error: 'for_each_mem_range' undeclared (first use in this function); did you mean 'crash_mem_range'?
353 | for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
| ^~~~~~~~~~~~~~~~~~
| crash_mem_range
arch/powerpc/kexec/file_load_64.c:353:2: note: each undeclared identifier is reported only once for each function it appears in
arch/powerpc/kexec/file_load_64.c:353:20: error: expected ';' before '{' token
353 | for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
| ^
| ;
354 | MEMBLOCK_NONE, &start, &end, NULL) {
| ~
arch/powerpc/kexec/file_load_64.c:351:6: warning: unused variable 'i' [-Wunused-variable]
351 | u64 i;
| ^
arch/powerpc/kexec/file_load_64.c:350:21: warning: unused variable 'end' [-Wunused-variable]
350 | phys_addr_t start, end;
| ^~~
arch/powerpc/kexec/file_load_64.c:350:14: warning: unused variable 'start' [-Wunused-variable]
350 | phys_addr_t start, end;
| ^~~~~
arch/powerpc/kexec/file_load_64.c:349:6: warning: unused variable 'ret' [-Wunused-variable]
349 | int ret = -EADDRNOTAVAIL;
| ^~~
>> arch/powerpc/kexec/file_load_64.c:385:1: warning: no return statement in function returning non-void [-Wreturn-type]
385 | }
| ^
vim +385 arch/powerpc/kexec/file_load_64.c
b8e55a3e5c2088 Hari Bathini 2020-07-29 335
b8e55a3e5c2088 Hari Bathini 2020-07-29 336 /**
b8e55a3e5c2088 Hari Bathini 2020-07-29 337 * __locate_mem_hole_bottom_up - Looks bottom up for a large enough memory hole
b8e55a3e5c2088 Hari Bathini 2020-07-29 338 * in the memory regions between buf_min & buf_max
b8e55a3e5c2088 Hari Bathini 2020-07-29 339 * for the buffer. If found, sets kbuf->mem.
b8e55a3e5c2088 Hari Bathini 2020-07-29 340 * @kbuf: Buffer contents and memory parameters.
b8e55a3e5c2088 Hari Bathini 2020-07-29 341 * @buf_min: Minimum address for the buffer.
b8e55a3e5c2088 Hari Bathini 2020-07-29 342 * @buf_max: Maximum address for the buffer.
b8e55a3e5c2088 Hari Bathini 2020-07-29 343 *
b8e55a3e5c2088 Hari Bathini 2020-07-29 344 * Returns 0 on success, negative errno on error.
b8e55a3e5c2088 Hari Bathini 2020-07-29 345 */
b8e55a3e5c2088 Hari Bathini 2020-07-29 346 static int __locate_mem_hole_bottom_up(struct kexec_buf *kbuf,
b8e55a3e5c2088 Hari Bathini 2020-07-29 347 u64 buf_min, u64 buf_max)
b8e55a3e5c2088 Hari Bathini 2020-07-29 348 {
b8e55a3e5c2088 Hari Bathini 2020-07-29 349 int ret = -EADDRNOTAVAIL;
b8e55a3e5c2088 Hari Bathini 2020-07-29 350 phys_addr_t start, end;
b8e55a3e5c2088 Hari Bathini 2020-07-29 351 u64 i;
b8e55a3e5c2088 Hari Bathini 2020-07-29 352
b8e55a3e5c2088 Hari Bathini 2020-07-29 353 for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
b8e55a3e5c2088 Hari Bathini 2020-07-29 354 MEMBLOCK_NONE, &start, &end, NULL) {
b8e55a3e5c2088 Hari Bathini 2020-07-29 355 /*
b8e55a3e5c2088 Hari Bathini 2020-07-29 356 * memblock uses [start, end) convention while it is
b8e55a3e5c2088 Hari Bathini 2020-07-29 357 * [start, end] here. Fix the off-by-one to have the
b8e55a3e5c2088 Hari Bathini 2020-07-29 358 * same convention.
b8e55a3e5c2088 Hari Bathini 2020-07-29 359 */
b8e55a3e5c2088 Hari Bathini 2020-07-29 360 end -= 1;
b8e55a3e5c2088 Hari Bathini 2020-07-29 361
b8e55a3e5c2088 Hari Bathini 2020-07-29 362 if (end < buf_min)
b8e55a3e5c2088 Hari Bathini 2020-07-29 363 continue;
b8e55a3e5c2088 Hari Bathini 2020-07-29 364
b8e55a3e5c2088 Hari Bathini 2020-07-29 365 /* Memory hole not found */
b8e55a3e5c2088 Hari Bathini 2020-07-29 366 if (start > buf_max)
b8e55a3e5c2088 Hari Bathini 2020-07-29 367 break;
b8e55a3e5c2088 Hari Bathini 2020-07-29 368
b8e55a3e5c2088 Hari Bathini 2020-07-29 369 /* Adjust memory region based on the given range */
b8e55a3e5c2088 Hari Bathini 2020-07-29 370 if (start < buf_min)
b8e55a3e5c2088 Hari Bathini 2020-07-29 371 start = buf_min;
b8e55a3e5c2088 Hari Bathini 2020-07-29 372 if (end > buf_max)
b8e55a3e5c2088 Hari Bathini 2020-07-29 373 end = buf_max;
b8e55a3e5c2088 Hari Bathini 2020-07-29 374
b8e55a3e5c2088 Hari Bathini 2020-07-29 375 start = ALIGN(start, kbuf->buf_align);
b8e55a3e5c2088 Hari Bathini 2020-07-29 376 if (start < end && (end - start + 1) >= kbuf->memsz) {
b8e55a3e5c2088 Hari Bathini 2020-07-29 377 /* Suitable memory range found. Set kbuf->mem */
b8e55a3e5c2088 Hari Bathini 2020-07-29 378 kbuf->mem = start;
b8e55a3e5c2088 Hari Bathini 2020-07-29 379 ret = 0;
b8e55a3e5c2088 Hari Bathini 2020-07-29 380 break;
b8e55a3e5c2088 Hari Bathini 2020-07-29 381 }
b8e55a3e5c2088 Hari Bathini 2020-07-29 382 }
b8e55a3e5c2088 Hari Bathini 2020-07-29 383
b8e55a3e5c2088 Hari Bathini 2020-07-29 384 return ret;
b8e55a3e5c2088 Hari Bathini 2020-07-29 @385 }
b8e55a3e5c2088 Hari Bathini 2020-07-29 386
:::::: The code at line 385 was first introduced by commit
:::::: b8e55a3e5c208862eacded5aad822184f89f85d9 powerpc/kexec_file: Avoid stomping memory used by special regions
:::::: TO: Hari Bathini <hbathini(a)linux.ibm.com>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[rppt:memblock/iterators-cleanup/v3 17/17] arch/powerpc/kexec/file_load_64.c:145:2: error: implicit declaration of function 'for_each_memblock'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git memblock/iterators-cleanup/v3
head: f0d593460d044672ca2ea065efc283e30dd23ef1
commit: f0d593460d044672ca2ea065efc283e30dd23ef1 [17/17] memblock: use separate iterators for memory and reserved regions
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-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 f0d593460d044672ca2ea065efc283e30dd23ef1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>):
arch/powerpc/kexec/file_load_64.c: In function 'get_crash_memory_ranges':
>> arch/powerpc/kexec/file_load_64.c:145:2: error: implicit declaration of function 'for_each_memblock'; did you mean 'for_each_mem_range'? [-Werror=implicit-function-declaration]
145 | for_each_memblock(memory, reg) {
| ^~~~~~~~~~~~~~~~~
| for_each_mem_range
>> arch/powerpc/kexec/file_load_64.c:145:20: error: 'memory' undeclared (first use in this function); did you mean 'memcpy'?
145 | for_each_memblock(memory, reg) {
| ^~~~~~
| memcpy
arch/powerpc/kexec/file_load_64.c:145:20: note: each undeclared identifier is reported only once for each function it appears in
arch/powerpc/kexec/file_load_64.c:145:32: error: expected ';' before '{' token
145 | for_each_memblock(memory, reg) {
| ^~
| ;
arch/powerpc/kexec/file_load_64.c: In function '__locate_mem_hole_bottom_up':
arch/powerpc/kexec/file_load_64.c:354:40: error: macro "for_each_mem_range" passed 8 arguments, but takes just 3
354 | MEMBLOCK_NONE, &start, &end, NULL) {
| ^
In file included from arch/powerpc/kexec/file_load_64.c:21:
include/linux/memblock.h:208: note: macro "for_each_mem_range" defined here
208 | #define for_each_mem_range(i, p_start, p_end) \
|
arch/powerpc/kexec/file_load_64.c:353:2: error: 'for_each_mem_range' undeclared (first use in this function); did you mean 'crash_mem_range'?
353 | for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
| ^~~~~~~~~~~~~~~~~~
| crash_mem_range
arch/powerpc/kexec/file_load_64.c:353:20: error: expected ';' before '{' token
353 | for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
| ^
| ;
354 | MEMBLOCK_NONE, &start, &end, NULL) {
| ~
arch/powerpc/kexec/file_load_64.c:351:6: error: unused variable 'i' [-Werror=unused-variable]
351 | u64 i;
| ^
arch/powerpc/kexec/file_load_64.c:350:21: error: unused variable 'end' [-Werror=unused-variable]
350 | phys_addr_t start, end;
| ^~~
arch/powerpc/kexec/file_load_64.c:350:14: error: unused variable 'start' [-Werror=unused-variable]
350 | phys_addr_t start, end;
| ^~~~~
arch/powerpc/kexec/file_load_64.c:349:6: error: unused variable 'ret' [-Werror=unused-variable]
349 | int ret = -EADDRNOTAVAIL;
| ^~~
arch/powerpc/kexec/file_load_64.c:385:1: error: no return statement in function returning non-void [-Werror=return-type]
385 | }
| ^
cc1: all warnings being treated as errors
vim +145 arch/powerpc/kexec/file_load_64.c
7c64e21a1c5a5b Hari Bathini 2020-07-29 130
cb350c1f1f867d Hari Bathini 2020-07-29 131 /**
cb350c1f1f867d Hari Bathini 2020-07-29 132 * get_crash_memory_ranges - Get crash memory ranges. This list includes
cb350c1f1f867d Hari Bathini 2020-07-29 133 * first/crashing kernel's memory regions that
cb350c1f1f867d Hari Bathini 2020-07-29 134 * would be exported via an elfcore.
cb350c1f1f867d Hari Bathini 2020-07-29 135 * @mem_ranges: Range list to add the memory ranges to.
cb350c1f1f867d Hari Bathini 2020-07-29 136 *
cb350c1f1f867d Hari Bathini 2020-07-29 137 * Returns 0 on success, negative errno on error.
cb350c1f1f867d Hari Bathini 2020-07-29 138 */
cb350c1f1f867d Hari Bathini 2020-07-29 139 static int get_crash_memory_ranges(struct crash_mem **mem_ranges)
cb350c1f1f867d Hari Bathini 2020-07-29 140 {
cb350c1f1f867d Hari Bathini 2020-07-29 141 struct memblock_region *reg;
cb350c1f1f867d Hari Bathini 2020-07-29 142 struct crash_mem *tmem;
cb350c1f1f867d Hari Bathini 2020-07-29 143 int ret;
cb350c1f1f867d Hari Bathini 2020-07-29 144
cb350c1f1f867d Hari Bathini 2020-07-29 @145 for_each_memblock(memory, reg) {
cb350c1f1f867d Hari Bathini 2020-07-29 146 u64 base, size;
cb350c1f1f867d Hari Bathini 2020-07-29 147
cb350c1f1f867d Hari Bathini 2020-07-29 148 base = (u64)reg->base;
cb350c1f1f867d Hari Bathini 2020-07-29 149 size = (u64)reg->size;
cb350c1f1f867d Hari Bathini 2020-07-29 150
cb350c1f1f867d Hari Bathini 2020-07-29 151 /* Skip backup memory region, which needs a separate entry */
cb350c1f1f867d Hari Bathini 2020-07-29 152 if (base == BACKUP_SRC_START) {
cb350c1f1f867d Hari Bathini 2020-07-29 153 if (size > BACKUP_SRC_SIZE) {
cb350c1f1f867d Hari Bathini 2020-07-29 154 base = BACKUP_SRC_END + 1;
cb350c1f1f867d Hari Bathini 2020-07-29 155 size -= BACKUP_SRC_SIZE;
cb350c1f1f867d Hari Bathini 2020-07-29 156 } else
cb350c1f1f867d Hari Bathini 2020-07-29 157 continue;
cb350c1f1f867d Hari Bathini 2020-07-29 158 }
cb350c1f1f867d Hari Bathini 2020-07-29 159
cb350c1f1f867d Hari Bathini 2020-07-29 160 ret = add_mem_range(mem_ranges, base, size);
cb350c1f1f867d Hari Bathini 2020-07-29 161 if (ret)
cb350c1f1f867d Hari Bathini 2020-07-29 162 goto out;
cb350c1f1f867d Hari Bathini 2020-07-29 163
cb350c1f1f867d Hari Bathini 2020-07-29 164 /* Try merging adjacent ranges before reallocation attempt */
cb350c1f1f867d Hari Bathini 2020-07-29 165 if ((*mem_ranges)->nr_ranges == (*mem_ranges)->max_nr_ranges)
cb350c1f1f867d Hari Bathini 2020-07-29 166 sort_memory_ranges(*mem_ranges, true);
cb350c1f1f867d Hari Bathini 2020-07-29 167 }
cb350c1f1f867d Hari Bathini 2020-07-29 168
cb350c1f1f867d Hari Bathini 2020-07-29 169 /* Reallocate memory ranges if there is no space to split ranges */
cb350c1f1f867d Hari Bathini 2020-07-29 170 tmem = *mem_ranges;
cb350c1f1f867d Hari Bathini 2020-07-29 171 if (tmem && (tmem->nr_ranges == tmem->max_nr_ranges)) {
cb350c1f1f867d Hari Bathini 2020-07-29 172 tmem = realloc_mem_ranges(mem_ranges);
cb350c1f1f867d Hari Bathini 2020-07-29 173 if (!tmem)
cb350c1f1f867d Hari Bathini 2020-07-29 174 goto out;
cb350c1f1f867d Hari Bathini 2020-07-29 175 }
cb350c1f1f867d Hari Bathini 2020-07-29 176
cb350c1f1f867d Hari Bathini 2020-07-29 177 /* Exclude crashkernel region */
cb350c1f1f867d Hari Bathini 2020-07-29 178 ret = crash_exclude_mem_range(tmem, crashk_res.start, crashk_res.end);
cb350c1f1f867d Hari Bathini 2020-07-29 179 if (ret)
cb350c1f1f867d Hari Bathini 2020-07-29 180 goto out;
cb350c1f1f867d Hari Bathini 2020-07-29 181
cb350c1f1f867d Hari Bathini 2020-07-29 182 /*
cb350c1f1f867d Hari Bathini 2020-07-29 183 * FIXME: For now, stay in parity with kexec-tools but if RTAS/OPAL
cb350c1f1f867d Hari Bathini 2020-07-29 184 * regions are exported to save their context at the time of
cb350c1f1f867d Hari Bathini 2020-07-29 185 * crash, they should actually be backed up just like the
cb350c1f1f867d Hari Bathini 2020-07-29 186 * first 64K bytes of memory.
cb350c1f1f867d Hari Bathini 2020-07-29 187 */
cb350c1f1f867d Hari Bathini 2020-07-29 188 ret = add_rtas_mem_range(mem_ranges);
cb350c1f1f867d Hari Bathini 2020-07-29 189 if (ret)
cb350c1f1f867d Hari Bathini 2020-07-29 190 goto out;
cb350c1f1f867d Hari Bathini 2020-07-29 191
cb350c1f1f867d Hari Bathini 2020-07-29 192 ret = add_opal_mem_range(mem_ranges);
cb350c1f1f867d Hari Bathini 2020-07-29 193 if (ret)
cb350c1f1f867d Hari Bathini 2020-07-29 194 goto out;
cb350c1f1f867d Hari Bathini 2020-07-29 195
cb350c1f1f867d Hari Bathini 2020-07-29 196 /* create a separate program header for the backup region */
cb350c1f1f867d Hari Bathini 2020-07-29 197 ret = add_mem_range(mem_ranges, BACKUP_SRC_START, BACKUP_SRC_SIZE);
cb350c1f1f867d Hari Bathini 2020-07-29 198 if (ret)
cb350c1f1f867d Hari Bathini 2020-07-29 199 goto out;
cb350c1f1f867d Hari Bathini 2020-07-29 200
cb350c1f1f867d Hari Bathini 2020-07-29 201 sort_memory_ranges(*mem_ranges, false);
cb350c1f1f867d Hari Bathini 2020-07-29 202 out:
cb350c1f1f867d Hari Bathini 2020-07-29 203 if (ret)
cb350c1f1f867d Hari Bathini 2020-07-29 204 pr_err("Failed to setup crash memory ranges\n");
cb350c1f1f867d Hari Bathini 2020-07-29 205 return ret;
cb350c1f1f867d Hari Bathini 2020-07-29 206 }
cb350c1f1f867d Hari Bathini 2020-07-29 207
:::::: The code at line 145 was first introduced by commit
:::::: cb350c1f1f867db16725f1bb06be033ece19e998 powerpc/kexec_file: Prepare elfcore header for crashing kernel
:::::: TO: Hari Bathini <hbathini(a)linux.ibm.com>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[rppt:memblock/iterators-cleanup/v3 10/17] arch/powerpc/kexec/file_load_64.c:354:40: error: macro "for_each_mem_range" passed 8 arguments, but takes just 3
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git memblock/iterators-cleanup/v3
head: f0d593460d044672ca2ea065efc283e30dd23ef1
commit: 3efd016ce3025d16da91568f97de6f0006281657 [10/17] memblock: reduce number of parameters in for_each_mem_range()
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-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 3efd016ce3025d16da91568f97de6f0006281657
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>):
arch/powerpc/kexec/file_load_64.c: In function '__locate_mem_hole_bottom_up':
>> arch/powerpc/kexec/file_load_64.c:354:40: error: macro "for_each_mem_range" passed 8 arguments, but takes just 3
354 | MEMBLOCK_NONE, &start, &end, NULL) {
| ^
In file included from arch/powerpc/kexec/file_load_64.c:21:
include/linux/memblock.h:211: note: macro "for_each_mem_range" defined here
211 | #define for_each_mem_range(i, p_start, p_end) \
|
>> arch/powerpc/kexec/file_load_64.c:353:2: error: 'for_each_mem_range' undeclared (first use in this function); did you mean 'crash_mem_range'?
353 | for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
| ^~~~~~~~~~~~~~~~~~
| crash_mem_range
arch/powerpc/kexec/file_load_64.c:353:2: note: each undeclared identifier is reported only once for each function it appears in
>> arch/powerpc/kexec/file_load_64.c:353:20: error: expected ';' before '{' token
353 | for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
| ^
| ;
354 | MEMBLOCK_NONE, &start, &end, NULL) {
| ~
>> arch/powerpc/kexec/file_load_64.c:351:6: error: unused variable 'i' [-Werror=unused-variable]
351 | u64 i;
| ^
>> arch/powerpc/kexec/file_load_64.c:350:21: error: unused variable 'end' [-Werror=unused-variable]
350 | phys_addr_t start, end;
| ^~~
>> arch/powerpc/kexec/file_load_64.c:350:14: error: unused variable 'start' [-Werror=unused-variable]
350 | phys_addr_t start, end;
| ^~~~~
>> arch/powerpc/kexec/file_load_64.c:349:6: error: unused variable 'ret' [-Werror=unused-variable]
349 | int ret = -EADDRNOTAVAIL;
| ^~~
arch/powerpc/kexec/file_load_64.c:385:1: error: no return statement in function returning non-void [-Werror=return-type]
385 | }
| ^
cc1: all warnings being treated as errors
vim +/for_each_mem_range +354 arch/powerpc/kexec/file_load_64.c
b8e55a3e5c2088 Hari Bathini 2020-07-29 335
b8e55a3e5c2088 Hari Bathini 2020-07-29 336 /**
b8e55a3e5c2088 Hari Bathini 2020-07-29 337 * __locate_mem_hole_bottom_up - Looks bottom up for a large enough memory hole
b8e55a3e5c2088 Hari Bathini 2020-07-29 338 * in the memory regions between buf_min & buf_max
b8e55a3e5c2088 Hari Bathini 2020-07-29 339 * for the buffer. If found, sets kbuf->mem.
b8e55a3e5c2088 Hari Bathini 2020-07-29 340 * @kbuf: Buffer contents and memory parameters.
b8e55a3e5c2088 Hari Bathini 2020-07-29 341 * @buf_min: Minimum address for the buffer.
b8e55a3e5c2088 Hari Bathini 2020-07-29 342 * @buf_max: Maximum address for the buffer.
b8e55a3e5c2088 Hari Bathini 2020-07-29 343 *
b8e55a3e5c2088 Hari Bathini 2020-07-29 344 * Returns 0 on success, negative errno on error.
b8e55a3e5c2088 Hari Bathini 2020-07-29 345 */
b8e55a3e5c2088 Hari Bathini 2020-07-29 346 static int __locate_mem_hole_bottom_up(struct kexec_buf *kbuf,
b8e55a3e5c2088 Hari Bathini 2020-07-29 347 u64 buf_min, u64 buf_max)
b8e55a3e5c2088 Hari Bathini 2020-07-29 348 {
b8e55a3e5c2088 Hari Bathini 2020-07-29 @349 int ret = -EADDRNOTAVAIL;
b8e55a3e5c2088 Hari Bathini 2020-07-29 @350 phys_addr_t start, end;
b8e55a3e5c2088 Hari Bathini 2020-07-29 @351 u64 i;
b8e55a3e5c2088 Hari Bathini 2020-07-29 352
b8e55a3e5c2088 Hari Bathini 2020-07-29 @353 for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE,
b8e55a3e5c2088 Hari Bathini 2020-07-29 @354 MEMBLOCK_NONE, &start, &end, NULL) {
b8e55a3e5c2088 Hari Bathini 2020-07-29 355 /*
b8e55a3e5c2088 Hari Bathini 2020-07-29 356 * memblock uses [start, end) convention while it is
b8e55a3e5c2088 Hari Bathini 2020-07-29 357 * [start, end] here. Fix the off-by-one to have the
b8e55a3e5c2088 Hari Bathini 2020-07-29 358 * same convention.
b8e55a3e5c2088 Hari Bathini 2020-07-29 359 */
b8e55a3e5c2088 Hari Bathini 2020-07-29 360 end -= 1;
b8e55a3e5c2088 Hari Bathini 2020-07-29 361
b8e55a3e5c2088 Hari Bathini 2020-07-29 362 if (end < buf_min)
b8e55a3e5c2088 Hari Bathini 2020-07-29 363 continue;
b8e55a3e5c2088 Hari Bathini 2020-07-29 364
b8e55a3e5c2088 Hari Bathini 2020-07-29 365 /* Memory hole not found */
b8e55a3e5c2088 Hari Bathini 2020-07-29 366 if (start > buf_max)
b8e55a3e5c2088 Hari Bathini 2020-07-29 367 break;
b8e55a3e5c2088 Hari Bathini 2020-07-29 368
b8e55a3e5c2088 Hari Bathini 2020-07-29 369 /* Adjust memory region based on the given range */
b8e55a3e5c2088 Hari Bathini 2020-07-29 370 if (start < buf_min)
b8e55a3e5c2088 Hari Bathini 2020-07-29 371 start = buf_min;
b8e55a3e5c2088 Hari Bathini 2020-07-29 372 if (end > buf_max)
b8e55a3e5c2088 Hari Bathini 2020-07-29 373 end = buf_max;
b8e55a3e5c2088 Hari Bathini 2020-07-29 374
b8e55a3e5c2088 Hari Bathini 2020-07-29 375 start = ALIGN(start, kbuf->buf_align);
b8e55a3e5c2088 Hari Bathini 2020-07-29 376 if (start < end && (end - start + 1) >= kbuf->memsz) {
b8e55a3e5c2088 Hari Bathini 2020-07-29 377 /* Suitable memory range found. Set kbuf->mem */
b8e55a3e5c2088 Hari Bathini 2020-07-29 378 kbuf->mem = start;
b8e55a3e5c2088 Hari Bathini 2020-07-29 379 ret = 0;
b8e55a3e5c2088 Hari Bathini 2020-07-29 380 break;
b8e55a3e5c2088 Hari Bathini 2020-07-29 381 }
b8e55a3e5c2088 Hari Bathini 2020-07-29 382 }
b8e55a3e5c2088 Hari Bathini 2020-07-29 383
b8e55a3e5c2088 Hari Bathini 2020-07-29 384 return ret;
b8e55a3e5c2088 Hari Bathini 2020-07-29 385 }
b8e55a3e5c2088 Hari Bathini 2020-07-29 386
:::::: The code at line 354 was first introduced by commit
:::::: b8e55a3e5c208862eacded5aad822184f89f85d9 powerpc/kexec_file: Avoid stomping memory used by special regions
:::::: TO: Hari Bathini <hbathini(a)linux.ibm.com>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
net/netfilter/xt_CT.c:99:22: sparse: sparse: incorrect type in assignment (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 06a81c1c7db9bd5de0bd38cd5acc44bb22b99150
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 7 weeks ago
config: i386-randconfig-s002-20200810 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-118-ge1578773-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
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 >>)
>> net/netfilter/xt_CT.c:99:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct nf_conntrack_helper [noderef] __rcu *helper @@ got struct nf_conntrack_helper *[assigned] helper @@
>> net/netfilter/xt_CT.c:99:22: sparse: expected struct nf_conntrack_helper [noderef] __rcu *helper
net/netfilter/xt_CT.c:99:22: sparse: got struct nf_conntrack_helper *[assigned] helper
>> net/netfilter/xt_CT.c:213:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct nf_conntrack_helper *helper @@ got struct nf_conntrack_helper [noderef] __rcu *helper @@
net/netfilter/xt_CT.c:213:45: sparse: expected struct nf_conntrack_helper *helper
>> net/netfilter/xt_CT.c:213:45: sparse: got struct nf_conntrack_helper [noderef] __rcu *helper
net/netfilter/xt_CT.c:276:53: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct nf_conntrack_helper *helper @@ got struct nf_conntrack_helper [noderef] __rcu *helper @@
net/netfilter/xt_CT.c:276:53: sparse: expected struct nf_conntrack_helper *helper
net/netfilter/xt_CT.c:276:53: sparse: got struct nf_conntrack_helper [noderef] __rcu *helper
vim +99 net/netfilter/xt_CT.c
84f3bb9ae9db90 Patrick McHardy 2010-02-03 71
236df005614bea Pablo Neira Ayuso 2012-08-28 72 static int
236df005614bea Pablo Neira Ayuso 2012-08-28 73 xt_ct_set_helper(struct nf_conn *ct, const char *helper_name,
236df005614bea Pablo Neira Ayuso 2012-08-28 74 const struct xt_tgchk_param *par)
236df005614bea Pablo Neira Ayuso 2012-08-28 75 {
236df005614bea Pablo Neira Ayuso 2012-08-28 76 struct nf_conntrack_helper *helper;
236df005614bea Pablo Neira Ayuso 2012-08-28 77 struct nf_conn_help *help;
236df005614bea Pablo Neira Ayuso 2012-08-28 78 u8 proto;
236df005614bea Pablo Neira Ayuso 2012-08-28 79
236df005614bea Pablo Neira Ayuso 2012-08-28 80 proto = xt_ct_find_proto(par);
236df005614bea Pablo Neira Ayuso 2012-08-28 81 if (!proto) {
11f7aee2326f37 Florian Westphal 2018-02-09 82 pr_info_ratelimited("You must specify a L4 protocol and not use inversions on it\n");
236df005614bea Pablo Neira Ayuso 2012-08-28 83 return -ENOENT;
236df005614bea Pablo Neira Ayuso 2012-08-28 84 }
236df005614bea Pablo Neira Ayuso 2012-08-28 85
236df005614bea Pablo Neira Ayuso 2012-08-28 86 helper = nf_conntrack_helper_try_module_get(helper_name, par->family,
236df005614bea Pablo Neira Ayuso 2012-08-28 87 proto);
236df005614bea Pablo Neira Ayuso 2012-08-28 88 if (helper == NULL) {
11f7aee2326f37 Florian Westphal 2018-02-09 89 pr_info_ratelimited("No such helper \"%s\"\n", helper_name);
236df005614bea Pablo Neira Ayuso 2012-08-28 90 return -ENOENT;
236df005614bea Pablo Neira Ayuso 2012-08-28 91 }
236df005614bea Pablo Neira Ayuso 2012-08-28 92
440534d3c56be0 Gao Feng 2018-07-09 93 help = nf_ct_helper_ext_add(ct, GFP_KERNEL);
236df005614bea Pablo Neira Ayuso 2012-08-28 94 if (help == NULL) {
d91fc59cd77c71 Liping Zhang 2017-05-07 95 nf_conntrack_helper_put(helper);
236df005614bea Pablo Neira Ayuso 2012-08-28 96 return -ENOMEM;
236df005614bea Pablo Neira Ayuso 2012-08-28 97 }
236df005614bea Pablo Neira Ayuso 2012-08-28 98
236df005614bea Pablo Neira Ayuso 2012-08-28 @99 help->helper = helper;
236df005614bea Pablo Neira Ayuso 2012-08-28 100 return 0;
236df005614bea Pablo Neira Ayuso 2012-08-28 101 }
236df005614bea Pablo Neira Ayuso 2012-08-28 102
236df005614bea Pablo Neira Ayuso 2012-08-28 103 static int
236df005614bea Pablo Neira Ayuso 2012-08-28 104 xt_ct_set_timeout(struct nf_conn *ct, const struct xt_tgchk_param *par,
236df005614bea Pablo Neira Ayuso 2012-08-28 105 const char *timeout_name)
236df005614bea Pablo Neira Ayuso 2012-08-28 106 {
236df005614bea Pablo Neira Ayuso 2012-08-28 107 #ifdef CONFIG_NF_CONNTRACK_TIMEOUT
b3480fe059ac91 Florian Westphal 2017-08-12 108 const struct nf_conntrack_l4proto *l4proto;
0153d5a810ab33 Pablo Neira Ayuso 2012-10-11 109 u8 proto;
236df005614bea Pablo Neira Ayuso 2012-08-28 110
0153d5a810ab33 Pablo Neira Ayuso 2012-10-11 111 proto = xt_ct_find_proto(par);
0153d5a810ab33 Pablo Neira Ayuso 2012-10-11 112 if (!proto) {
717700d183d65b Yi-Hung Wei 2019-03-26 113 pr_info_ratelimited("You must specify a L4 protocol and not "
717700d183d65b Yi-Hung Wei 2019-03-26 114 "use inversions on it");
717700d183d65b Yi-Hung Wei 2019-03-26 115 return -EINVAL;
236df005614bea Pablo Neira Ayuso 2012-08-28 116 }
4a60dc748d121b Florian Westphal 2019-01-15 117 l4proto = nf_ct_l4proto_find(proto);
717700d183d65b Yi-Hung Wei 2019-03-26 118 return nf_ct_set_timeout(par->net, ct, par->family, l4proto->l4proto,
717700d183d65b Yi-Hung Wei 2019-03-26 119 timeout_name);
403d89ad9cc076 Pablo Neira Ayuso 2015-10-05 120
236df005614bea Pablo Neira Ayuso 2012-08-28 121 #else
236df005614bea Pablo Neira Ayuso 2012-08-28 122 return -EOPNOTSUPP;
236df005614bea Pablo Neira Ayuso 2012-08-28 123 #endif
236df005614bea Pablo Neira Ayuso 2012-08-28 124 }
236df005614bea Pablo Neira Ayuso 2012-08-28 125
deedb59039f111 Daniel Borkmann 2015-08-14 126 static u16 xt_ct_flags_to_dir(const struct xt_ct_target_info_v1 *info)
deedb59039f111 Daniel Borkmann 2015-08-14 127 {
deedb59039f111 Daniel Borkmann 2015-08-14 128 switch (info->flags & (XT_CT_ZONE_DIR_ORIG |
deedb59039f111 Daniel Borkmann 2015-08-14 129 XT_CT_ZONE_DIR_REPL)) {
deedb59039f111 Daniel Borkmann 2015-08-14 130 case XT_CT_ZONE_DIR_ORIG:
deedb59039f111 Daniel Borkmann 2015-08-14 131 return NF_CT_ZONE_DIR_ORIG;
deedb59039f111 Daniel Borkmann 2015-08-14 132 case XT_CT_ZONE_DIR_REPL:
deedb59039f111 Daniel Borkmann 2015-08-14 133 return NF_CT_ZONE_DIR_REPL;
deedb59039f111 Daniel Borkmann 2015-08-14 134 default:
deedb59039f111 Daniel Borkmann 2015-08-14 135 return NF_CT_DEFAULT_ZONE_DIR;
deedb59039f111 Daniel Borkmann 2015-08-14 136 }
deedb59039f111 Daniel Borkmann 2015-08-14 137 }
deedb59039f111 Daniel Borkmann 2015-08-14 138
d52ed4379a8264 Pablo Neira Ayuso 2013-01-30 139 static int xt_ct_tg_check(const struct xt_tgchk_param *par,
d52ed4379a8264 Pablo Neira Ayuso 2013-01-30 140 struct xt_ct_target_info_v1 *info)
24de58f4651652 Pablo Neira Ayuso 2012-02-29 141 {
308ac9143ee220 Daniel Borkmann 2015-08-08 142 struct nf_conntrack_zone zone;
470acf55a02171 Gao Feng 2017-04-14 143 struct nf_conn_help *help;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 144 struct nf_conn *ct;
4610476d89d537 Pablo Neira Ayuso 2013-01-10 145 int ret = -EOPNOTSUPP;
236df005614bea Pablo Neira Ayuso 2012-08-28 146
24de58f4651652 Pablo Neira Ayuso 2012-02-29 147 if (info->flags & XT_CT_NOTRACK) {
27e7190efd5b2f Eric Dumazet 2013-05-22 148 ct = NULL;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 149 goto out;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 150 }
24de58f4651652 Pablo Neira Ayuso 2012-02-29 151
24de58f4651652 Pablo Neira Ayuso 2012-02-29 152 #ifndef CONFIG_NF_CONNTRACK_ZONES
deedb59039f111 Daniel Borkmann 2015-08-14 153 if (info->zone || info->flags & (XT_CT_ZONE_DIR_ORIG |
5e8018fc61423e Daniel Borkmann 2015-08-14 154 XT_CT_ZONE_DIR_REPL |
5e8018fc61423e Daniel Borkmann 2015-08-14 155 XT_CT_ZONE_MARK))
24de58f4651652 Pablo Neira Ayuso 2012-02-29 156 goto err1;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 157 #endif
24de58f4651652 Pablo Neira Ayuso 2012-02-29 158
ecb2421b5ddf48 Florian Westphal 2016-11-15 159 ret = nf_ct_netns_get(par->net, par->family);
24de58f4651652 Pablo Neira Ayuso 2012-02-29 160 if (ret < 0)
24de58f4651652 Pablo Neira Ayuso 2012-02-29 161 goto err1;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 162
308ac9143ee220 Daniel Borkmann 2015-08-08 163 memset(&zone, 0, sizeof(zone));
308ac9143ee220 Daniel Borkmann 2015-08-08 164 zone.id = info->zone;
deedb59039f111 Daniel Borkmann 2015-08-14 165 zone.dir = xt_ct_flags_to_dir(info);
5e8018fc61423e Daniel Borkmann 2015-08-14 166 if (info->flags & XT_CT_ZONE_MARK)
5e8018fc61423e Daniel Borkmann 2015-08-14 167 zone.flags |= NF_CT_FLAG_MARK;
308ac9143ee220 Daniel Borkmann 2015-08-08 168
308ac9143ee220 Daniel Borkmann 2015-08-08 169 ct = nf_ct_tmpl_alloc(par->net, &zone, GFP_KERNEL);
1a727c63612fc5 Dan Carpenter 2015-07-28 170 if (!ct) {
1a727c63612fc5 Dan Carpenter 2015-07-28 171 ret = -ENOMEM;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 172 goto err2;
1a727c63612fc5 Dan Carpenter 2015-07-28 173 }
24de58f4651652 Pablo Neira Ayuso 2012-02-29 174
24de58f4651652 Pablo Neira Ayuso 2012-02-29 175 ret = 0;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 176 if ((info->ct_events || info->exp_events) &&
24de58f4651652 Pablo Neira Ayuso 2012-02-29 177 !nf_ct_ecache_ext_add(ct, info->ct_events, info->exp_events,
14abfa161d256c Eric Leblond 2014-01-02 178 GFP_KERNEL)) {
14abfa161d256c Eric Leblond 2014-01-02 179 ret = -EINVAL;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 180 goto err3;
14abfa161d256c Eric Leblond 2014-01-02 181 }
24de58f4651652 Pablo Neira Ayuso 2012-02-29 182
24de58f4651652 Pablo Neira Ayuso 2012-02-29 183 if (info->helper[0]) {
8f4d19aacb64f2 Gao Feng 2018-05-30 184 if (strnlen(info->helper, sizeof(info->helper)) == sizeof(info->helper)) {
8f4d19aacb64f2 Gao Feng 2018-05-30 185 ret = -ENAMETOOLONG;
8f4d19aacb64f2 Gao Feng 2018-05-30 186 goto err3;
8f4d19aacb64f2 Gao Feng 2018-05-30 187 }
8f4d19aacb64f2 Gao Feng 2018-05-30 188
236df005614bea Pablo Neira Ayuso 2012-08-28 189 ret = xt_ct_set_helper(ct, info->helper, par);
236df005614bea Pablo Neira Ayuso 2012-08-28 190 if (ret < 0)
24de58f4651652 Pablo Neira Ayuso 2012-02-29 191 goto err3;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 192 }
1afc56794e0322 Pablo Neira Ayuso 2012-06-07 193
6cf51852486af3 Pablo Neira Ayuso 2012-04-27 194 if (info->timeout[0]) {
8f4d19aacb64f2 Gao Feng 2018-05-30 195 if (strnlen(info->timeout, sizeof(info->timeout)) == sizeof(info->timeout)) {
8f4d19aacb64f2 Gao Feng 2018-05-30 196 ret = -ENAMETOOLONG;
8f4d19aacb64f2 Gao Feng 2018-05-30 197 goto err4;
8f4d19aacb64f2 Gao Feng 2018-05-30 198 }
8f4d19aacb64f2 Gao Feng 2018-05-30 199
236df005614bea Pablo Neira Ayuso 2012-08-28 200 ret = xt_ct_set_timeout(ct, par, info->timeout);
236df005614bea Pablo Neira Ayuso 2012-08-28 201 if (ret < 0)
470acf55a02171 Gao Feng 2017-04-14 202 goto err4;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 203 }
0838aa7fcfcd87 Pablo Neira Ayuso 2015-07-13 204 __set_bit(IPS_CONFIRMED_BIT, &ct->status);
0838aa7fcfcd87 Pablo Neira Ayuso 2015-07-13 205 nf_conntrack_get(&ct->ct_general);
24de58f4651652 Pablo Neira Ayuso 2012-02-29 206 out:
24de58f4651652 Pablo Neira Ayuso 2012-02-29 207 info->ct = ct;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 208 return 0;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 209
470acf55a02171 Gao Feng 2017-04-14 210 err4:
470acf55a02171 Gao Feng 2017-04-14 211 help = nfct_help(ct);
470acf55a02171 Gao Feng 2017-04-14 212 if (help)
d91fc59cd77c71 Liping Zhang 2017-05-07 @213 nf_conntrack_helper_put(help->helper);
24de58f4651652 Pablo Neira Ayuso 2012-02-29 214 err3:
9cf94eab8b309e Daniel Borkmann 2015-08-31 215 nf_ct_tmpl_free(ct);
24de58f4651652 Pablo Neira Ayuso 2012-02-29 216 err2:
ecb2421b5ddf48 Florian Westphal 2016-11-15 217 nf_ct_netns_put(par->net, par->family);
24de58f4651652 Pablo Neira Ayuso 2012-02-29 218 err1:
24de58f4651652 Pablo Neira Ayuso 2012-02-29 219 return ret;
24de58f4651652 Pablo Neira Ayuso 2012-02-29 220 }
24de58f4651652 Pablo Neira Ayuso 2012-02-29 221
:::::: The code at line 99 was first introduced by commit
:::::: 236df005614bea6a2f9afa9867e3bdfc206c6291 netfilter: xt_CT: refactorize xt_ct_tg_check
:::::: TO: Pablo Neira Ayuso <pablo(a)netfilter.org>
:::::: CC: Pablo Neira Ayuso <pablo(a)netfilter.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[hp-parisc:for-next 1/2] WARNING: modpost: vmlinux.o(.text+0x2392318): Section mismatch in reference from the function devfreq_remove_device() to the variable .init.text:.LBB192
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git for-next
head: f70f346189c1ae4e29ab01b4448f3617bf7636d3
commit: b295201537db0c28b04bf4a111704914e71200e5 [1/2] parisc/kernel/ftrace: Remove function callback casts
config: riscv-randconfig-r004-20200809 (attached as .config)
compiler: riscv32-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 b295201537db0c28b04bf4a111704914e71200e5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
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 >>, old ones prefixed by <<):
>> WARNING: modpost: vmlinux.o(.text+0x2392318): Section mismatch in reference from the function devfreq_remove_device() to the variable .init.text:.LBB192
The function devfreq_remove_device() references
the variable __init .LBB192.
This is often because devfreq_remove_device lacks a __init
annotation or the annotation of .LBB192 is wrong.
--
>> WARNING: modpost: vmlinux.o(.text+0x239f894): Section mismatch in reference from the function iio_device_free() to the variable .init.text:.LBB228
The function iio_device_free() references
the variable __init .LBB228.
This is often because iio_device_free lacks a __init
annotation or the annotation of .LBB228 is wrong.
--
>> WARNING: modpost: vmlinux.o(__ex_table+0xd88): Section mismatch in reference from the (unknown reference) (unknown) to the variable .debug_str:.LASF389
FATAL: modpost: The relocation at __ex_table+0xd88 references
section ".debug_str" which is not executable, IOW
it is not possible for the kernel to fault
at that address. Something is seriously wrong
and should be fixed.
The below error/warnings are from parent commit:
<< WARNING: modpost: vmlinux.o(.text+0x2392328): Section mismatch in reference from the function devfreq_remove_device() to the variable .init.text:.LBE192
<< WARNING: modpost: vmlinux.o(.text+0x239f8a4): Section mismatch in reference from the function iio_device_free() to the variable .init.text:.LBE228
<< WARNING: modpost: vmlinux.o(.text+0x239f8a8): Section mismatch in reference from the function iio_device_free() to the variable .init.text:.L0
<< WARNING: modpost: vmlinux.o(__ex_table+0xd88): Section mismatch in reference from the (unknown reference) (unknown) to the variable .debug_str:.LASF390
<< WARNING: modpost: vmlinux.o(.text+0x2392328): Section mismatch in reference from the function devfreq_remove_device() to the variable .init.text:.LBE192
<< WARNING: modpost: vmlinux.o(.text+0x239f8a4): Section mismatch in reference from the function iio_device_free() to the variable .init.text:.LBE228
<< WARNING: modpost: vmlinux.o(.text+0x239f8a8): Section mismatch in reference from the function iio_device_free() to the variable .init.text:.L0
<< WARNING: modpost: vmlinux.o(__ex_table+0xd88): Section mismatch in reference from the (unknown reference) (unknown) to the variable .debug_str:.LASF390
<< WARNING: modpost: vmlinux.o(.text+0x2392328): Section mismatch in reference from the function devfreq_remove_device() to the variable .init.text:.LBE192
<< WARNING: modpost: vmlinux.o(.text+0x239f8a4): Section mismatch in reference from the function iio_device_free() to the variable .init.text:.LBE228
<< WARNING: modpost: vmlinux.o(.text+0x239f8a8): Section mismatch in reference from the function iio_device_free() to the variable .init.text:.L0
<< WARNING: modpost: vmlinux.o(__ex_table+0xd88): Section mismatch in reference from the (unknown reference) (unknown) to the variable .debug_str:.LASF390
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[PATCH] mmc: block: fix memdup.cocci warnings
by Julia Lawall
From: kernel test robot <lkp(a)intel.com>
Use kmemdup rather than duplicating its implementation
Generated by: scripts/coccinelle/api/memdup.cocci
Fixes: 68083eebfb0a ("mmc: block: register RPMB partition with the RPMB subsystem")
CC: Tomas Winkler <tomas.winkler(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: Julia Lawall <julia.lawall(a)inria.fr>
---
tree: https://github.com/intel/linux-intel-lts.git 5.4/preempt-rt
head: 64f494c08613ebb24a83b69223e7f90e8b7ce956
commit: 68083eebfb0a008e9bec30cefb2260f0543ed5ec [97/9103] mmc: block: register RPMB partition with the RPMB subsystem
:::::: branch date: 4 days ago
:::::: commit date: 9 months ago
block.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1270,11 +1270,10 @@ static int mmc_blk_rpmb_set_dev_id(struc
{
char *id;
- id = kmalloc(sizeof(card->raw_cid), GFP_KERNEL);
+ id = kmemdup(card->raw_cid, sizeof(card->raw_cid), GFP_KERNEL);
if (!id)
return -ENOMEM;
- memcpy(id, card->raw_cid, sizeof(card->raw_cid));
ops->dev_id = id;
ops->dev_id_len = sizeof(card->raw_cid);
2 years, 1 month
Re: [PATCH 4/4] habanalabs: set max power according to card type
by kernel test robot
Hi Oded,
I love your patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on linus/master next-20200807]
[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/Oded-Gabbay/habanalabs-verify-us...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 47ec5303d73ea344e84f46660fff693c57641386
config: x86_64-randconfig-s022-20200809 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-118-ge1578773-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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 >>)
>> drivers/misc/habanalabs/gaudi/gaudi.c:6025:34: sparse: sparse: restricted __le32 degrades to integer
drivers/misc/habanalabs/gaudi/gaudi.c:1807:26: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000)
drivers/misc/habanalabs/gaudi/gaudi.c:1811:25: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000)
drivers/misc/habanalabs/gaudi/gaudi.c:1815:26: sparse: sparse: cast truncates bits from constant value (7ffc494000 becomes fc494000)
drivers/misc/habanalabs/gaudi/gaudi.c:1819:25: sparse: sparse: cast truncates bits from constant value (7ffc492000 becomes fc492000)
drivers/misc/habanalabs/gaudi/gaudi.c:1858:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/gaudi/gaudi.c:1896:9: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/gaudi/gaudi.c:1969:23: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000)
drivers/misc/habanalabs/gaudi/gaudi.c:1973:22: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000)
drivers/misc/habanalabs/gaudi/gaudi.c:2006:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/gaudi/gaudi.c:2079:23: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000)
drivers/misc/habanalabs/gaudi/gaudi.c:2083:22: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000)
drivers/misc/habanalabs/gaudi/gaudi.c:2118:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/gaudi/gaudi.c:2193:23: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000)
drivers/misc/habanalabs/gaudi/gaudi.c:2197:22: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000)
drivers/misc/habanalabs/gaudi/gaudi.c:2233:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/gaudi/gaudi.c:2728:27: sparse: sparse: cast truncates bits from constant value (7ff0000000 becomes f0000000)
drivers/misc/habanalabs/gaudi/gaudi.c:6209:9: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000)
vim +6025 drivers/misc/habanalabs/gaudi/gaudi.c
6005
6006 static int gaudi_armcp_info_get(struct hl_device *hdev)
6007 {
6008 struct gaudi_device *gaudi = hdev->asic_specific;
6009 struct asic_fixed_properties *prop = &hdev->asic_prop;
6010 int rc;
6011
6012 if (!(gaudi->hw_cap_initialized & HW_CAP_CPU_Q))
6013 return 0;
6014
6015 rc = hl_fw_armcp_info_get(hdev);
6016 if (rc)
6017 return rc;
6018
6019 if (!strlen(prop->armcp_info.card_name))
6020 strncpy(prop->armcp_info.card_name, GAUDI_DEFAULT_CARD_NAME,
6021 CARD_NAME_MAX_LEN);
6022
6023 if (prop->armcp_info.card_type == armcp_card_type_pci)
6024 prop->max_power_default = MAX_POWER_DEFAULT_PCI;
> 6025 else if (prop->armcp_info.card_type == armcp_card_type_pmc)
6026 prop->max_power_default = MAX_POWER_DEFAULT_PMC;
6027
6028 hdev->max_power = prop->max_power_default;
6029
6030 return 0;
6031 }
6032
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[linux-cip:linux-4.19.y-cip 11/17] include/drm/drm_of.h:95:5: warning: no previous prototype for 'drm_of_lvds_get_dual_link_pixel_order'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git linux-4.19.y-cip
head: 72750517bc5f1718ce3cb3fa75d4cadc05d27eee
commit: cf532369d40146ffdd35f9d9a4558237c8773846 [11/17] drm: of: Add drm_of_lvds_get_dual_link_pixel_order
config: parisc-randconfig-r001-20200809 (attached as .config)
compiler: hppa-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 cf532369d40146ffdd35f9d9a4558237c8773846
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
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 >>):
In file included from drivers/gpu/drm/i2c/tda998x_drv.c:31:
>> include/drm/drm_of.h:95:5: warning: no previous prototype for 'drm_of_lvds_get_dual_link_pixel_order' [-Wmissing-prototypes]
95 | int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i2c/tda998x_drv.c:1050:5: warning: no previous prototype for 'tda998x_audio_digital_mute' [-Wmissing-prototypes]
1050 | int tda998x_audio_digital_mute(struct device *dev, void *data, bool enable)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/drm_of_lvds_get_dual_link_pixel_order +95 include/drm/drm_of.h
94
> 95 int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1,
96 const struct device_node *port2)
97 {
98 return -EINVAL;
99 }
100 #endif
101
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month