Hi Tetsuo,
FYI, the error/warning still remains.
tree:
https://android.googlesource.com/kernel/common android-3.18
head: a406f39320f095aa4628bb50aba12da25d5d0943
commit: d8d7791979c3d6045b0904ddf8e17970401a5a80 [12862/16064] /dev/mem: Bail out upon
SIGKILL.
config: x86_64-randconfig-a016-20200824 (attached as .config)
compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
reproduce (this is a W=1 build):
git checkout d8d7791979c3d6045b0904ddf8e17970401a5a80
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
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/char/mem.c: In function 'read_kmem':
> drivers/char/mem.c:457:8: error: implicit declaration of function
'should_stop_iteration' [-Werror=implicit-function-declaration]
if
(should_stop_iteration()) {
^
cc1: some warnings being treated as errors
git remote add android-common
https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android-3.18
git checkout d8d7791979c3d6045b0904ddf8e17970401a5a80
vim +/should_stop_iteration +457 drivers/char/mem.c
408
409 #ifdef CONFIG_DEVKMEM
410 /*
411 * This function reads the *virtual* memory as seen by the kernel.
412 */
413 static ssize_t read_kmem(struct file *file, char __user *buf,
414 size_t count, loff_t *ppos)
415 {
416 unsigned long p = *ppos;
417 ssize_t low_count, read, sz;
418 char *kbuf; /* k-addr because vread() takes vmlist_lock rwlock */
419 int err = 0;
420
421 read = 0;
422 if (p < (unsigned long) high_memory) {
423 low_count = count;
424 if (count > (unsigned long)high_memory - p)
425 low_count = (unsigned long)high_memory - p;
426
427 #ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED
428 /* we don't have page 0 mapped on sparc and m68k.. */
429 if (p < PAGE_SIZE && low_count > 0) {
430 sz = size_inside_page(p, low_count);
431 if (clear_user(buf, sz))
432 return -EFAULT;
433 buf += sz;
434 p += sz;
435 read += sz;
436 low_count -= sz;
437 count -= sz;
438 }
439 #endif
440 while (low_count > 0) {
441 sz = size_inside_page(p, low_count);
442
443 /*
444 * On ia64 if a page has been mapped somewhere as
445 * uncached, then it must also be accessed uncached
446 * by the kernel or data corruption may occur
447 */
448 kbuf = xlate_dev_kmem_ptr((char *)p);
449
450 if (copy_to_user(buf, kbuf, sz))
451 return -EFAULT;
452 buf += sz;
453 p += sz;
454 read += sz;
455 low_count -= sz;
456 count -= sz;
457 if (should_stop_iteration()) {
458 count = 0;
459 break;
460 }
461 }
462 }
463
464 if (count > 0) {
465 kbuf = (char *)__get_free_page(GFP_KERNEL);
466 if (!kbuf)
467 return -ENOMEM;
468 while (count > 0) {
469 sz = size_inside_page(p, count);
470 if (!is_vmalloc_or_module_addr((void *)p)) {
471 err = -ENXIO;
472 break;
473 }
474 sz = vread(kbuf, (char *)p, sz);
475 if (!sz)
476 break;
477 if (copy_to_user(buf, kbuf, sz)) {
478 err = -EFAULT;
479 break;
480 }
481 count -= sz;
482 buf += sz;
483 read += sz;
484 p += sz;
485 if (should_stop_iteration())
486 break;
487 }
488 free_page((unsigned long)kbuf);
489 }
490 *ppos = p;
491 return read ? read : err;
492 }
493
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org