[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202206282121.lzE1UnoA-lkp@intel.com>
Date: Tue, 28 Jun 2022 21:18:27 +0800
From: kernel test robot <lkp@...el.com>
To: Kees Cook <keescook@...omium.org>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: arch/mips/bcm47xx/prom.c:89:8: error: no matching function for call
to 'memcmp'
Hi Kees,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 941e3e7912696b9fbe3586083a7c2e102cee7a87
commit: 281d0c962752fb40866dd8d4cade68656f34bd1f fortify: Add Clang support
date: 5 months ago
config: mips-randconfig-c004-20220627
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 016342e319fd31e41cf5ed16a6140a8ea2de74dd)
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 mips cross compiling tool for clang build
# apt-get install binutils-mipsel-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=281d0c962752fb40866dd8d4cade68656f34bd1f
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 281d0c962752fb40866dd8d4cade68656f34bd1f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
>> arch/mips/bcm47xx/prom.c:89:8: error: no matching function for call to 'memcmp'
if (!memcmp(prom_init, prom_init + mem, 32))
^~~~~~
include/linux/string.h:156:12: note: candidate function not viable: no known conversion from 'void (void)' to 'const void *' for 1st argument
extern int memcmp(const void *,const void *,__kernel_size_t);
^
include/linux/fortify-string.h:391:5: note: candidate function not viable: no known conversion from 'void (void)' to 'const void *const' for 1st argument
int memcmp(const void * const POS0 p, const void * const POS0 q, __kernel_size_t size)
^
1 error generated.
vim +/memcmp +89 arch/mips/bcm47xx/prom.c
6ee1d93455384c Rafał Miłecki 2014-07-17 55
25e5fb97419f73 Aurelien Jarno 2007-09-25 56 static __init void prom_init_mem(void)
1c0c13eb935c95 Aurelien Jarno 2007-09-25 57 {
1c0c13eb935c95 Aurelien Jarno 2007-09-25 58 unsigned long mem;
aec92225513538 Hauke Mehrtens 2010-07-27 59 unsigned long max;
c47cc20ca53e79 Hauke Mehrtens 2012-10-03 60 unsigned long off;
d3dce3d676373b Hauke Mehrtens 2012-10-03 61 struct cpuinfo_mips *c = ¤t_cpu_data;
1c0c13eb935c95 Aurelien Jarno 2007-09-25 62
25e5fb97419f73 Aurelien Jarno 2007-09-25 63 /* Figure out memory size by finding aliases.
25e5fb97419f73 Aurelien Jarno 2007-09-25 64 *
25e5fb97419f73 Aurelien Jarno 2007-09-25 65 * We should theoretically use the mapping from CFE using cfe_enummem().
25e5fb97419f73 Aurelien Jarno 2007-09-25 66 * However as the BCM47XX is mostly used on low-memory systems, we
25e5fb97419f73 Aurelien Jarno 2007-09-25 67 * want to reuse the memory used by CFE (around 4MB). That means cfe_*
25e5fb97419f73 Aurelien Jarno 2007-09-25 68 * functions stop to work at some point during the boot, we should only
25e5fb97419f73 Aurelien Jarno 2007-09-25 69 * call them at the beginning of the boot.
aec92225513538 Hauke Mehrtens 2010-07-27 70 *
aec92225513538 Hauke Mehrtens 2010-07-27 71 * BCM47XX uses 128MB for addressing the ram, if the system contains
aec92225513538 Hauke Mehrtens 2010-07-27 72 * less that that amount of ram it remaps the ram more often into the
aec92225513538 Hauke Mehrtens 2010-07-27 73 * available space.
25e5fb97419f73 Aurelien Jarno 2007-09-25 74 */
96a8123e5f9658 Rafał Miłecki 2014-04-19 75
96a8123e5f9658 Rafał Miłecki 2014-04-19 76 /* Physical address, without mapping to any kernel segment */
96a8123e5f9658 Rafał Miłecki 2014-04-19 77 off = CPHYSADDR((unsigned long)prom_init);
96a8123e5f9658 Rafał Miłecki 2014-04-19 78
96a8123e5f9658 Rafał Miłecki 2014-04-19 79 /* Accessing memory after 128 MiB will cause an exception */
96a8123e5f9658 Rafał Miłecki 2014-04-19 80 max = 128 << 20;
96a8123e5f9658 Rafał Miłecki 2014-04-19 81
96a8123e5f9658 Rafał Miłecki 2014-04-19 82 for (mem = 1 << 20; mem < max; mem += 1 << 20) {
96a8123e5f9658 Rafał Miłecki 2014-04-19 83 /* Loop condition may be not enough, off may be over 1 MiB */
96a8123e5f9658 Rafał Miłecki 2014-04-19 84 if (off + mem >= max) {
96a8123e5f9658 Rafał Miłecki 2014-04-19 85 mem = max;
d548ca6b0784a9 Rafał Miłecki 2014-12-10 86 pr_debug("Assume 128MB RAM\n");
aec92225513538 Hauke Mehrtens 2010-07-27 87 break;
aec92225513538 Hauke Mehrtens 2010-07-27 88 }
c47cc20ca53e79 Hauke Mehrtens 2012-10-03 @89 if (!memcmp(prom_init, prom_init + mem, 32))
1c0c13eb935c95 Aurelien Jarno 2007-09-25 90 break;
1c0c13eb935c95 Aurelien Jarno 2007-09-25 91 }
6ee1d93455384c Rafał Miłecki 2014-07-17 92 lowmem = mem;
1c0c13eb935c95 Aurelien Jarno 2007-09-25 93
d3dce3d676373b Hauke Mehrtens 2012-10-03 94 /* Ignoring the last page when ddr size is 128M. Cached
d3dce3d676373b Hauke Mehrtens 2012-10-03 95 * accesses to last page is causing the processor to prefetch
d3dce3d676373b Hauke Mehrtens 2012-10-03 96 * using address above 128M stepping out of the ddr address
d3dce3d676373b Hauke Mehrtens 2012-10-03 97 * space.
d3dce3d676373b Hauke Mehrtens 2012-10-03 98 */
d3dce3d676373b Hauke Mehrtens 2012-10-03 99 if (c->cputype == CPU_74K && (mem == (128 << 20)))
d3dce3d676373b Hauke Mehrtens 2012-10-03 100 mem -= 0x1000;
e7ae8d174eec0b Thomas Bogendoerfer 2020-10-09 101 memblock_add(0, mem);
1c0c13eb935c95 Aurelien Jarno 2007-09-25 102 }
1c0c13eb935c95 Aurelien Jarno 2007-09-25 103
:::::: The code at line 89 was first introduced by commit
:::::: c47cc20ca53e792938556aa29103fa889ce0d858 MIPS: BCM47XX: improve memory size detection
:::::: TO: Hauke Mehrtens <hauke@...ke-m.de>
:::::: CC: John Crispin <blogic@...nwrt.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (158382 bytes)
Powered by blists - more mailing lists