[linux-next:master 4752/5235] kernel/kcsan/kcsan_test.c:592:35: error: implicit declaration of function 'clear_bit_unlock_is_negative_byte'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5d02ef4b57f6e7d4dcba14d40cf05373a146a605
commit: 8165da98aa7b69bd9f374a75467c06e5e232d15b [4752/5235] kcsan: test: Add test cases for memory barrier instrumentation
config: s390-randconfig-r023-20211206 (https://download.01.org/0day-ci/archive/20211207/202112070117.78ld7W01-lkp@xxxxxxxxx/config)
compiler: s390-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8165da98aa7b69bd9f374a75467c06e5e232d15b
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 8165da98aa7b69bd9f374a75467c06e5e232d15b
        # 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=s390 SHELL=/bin/bash kernel/kcsan/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   kernel/kcsan/kcsan_test.c: In function 'test_barrier_nothreads':
>> kernel/kcsan/kcsan_test.c:592:35: error: implicit declaration of function 'clear_bit_unlock_is_negative_byte' [-Werror=implicit-function-declaration]
     592 |         KCSAN_EXPECT_READ_BARRIER(clear_bit_unlock_is_negative_byte(0, &test_var), true);
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/kcsan/kcsan_test.c:537:17: note: in definition of macro '__KCSAN_EXPECT_BARRIER'
     537 |                 barrier;                                                                        \
         |                 ^~~~~~~
   kernel/kcsan/kcsan_test.c:592:9: note: in expansion of macro 'KCSAN_EXPECT_READ_BARRIER'
     592 |         KCSAN_EXPECT_READ_BARRIER(clear_bit_unlock_is_negative_byte(0, &test_var), true);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/kcsan/kcsan_test.c: In function 'test_atomic_builtins':
   kernel/kcsan/kcsan_test.c:1233:17: warning: 'atomic_thread_fence' is not supported with '-fsanitize=thread' [-Wtsan]
    1233 |                 __atomic_thread_fence(__ATOMIC_SEQ_CST);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/clear_bit_unlock_is_negative_byte +592 kernel/kcsan/kcsan_test.c

   545	
   546		/* Force creating a valid entry in reorder_access first. */
   547		test_var = 0;
   548		while (test_var++ < 1000000 && reorder_access->size != sizeof(test_var))
   549			__kcsan_check_read(&test_var, sizeof(test_var));
   550		KUNIT_ASSERT_EQ(test, reorder_access->size, sizeof(test_var));
   551	
   552		kcsan_nestable_atomic_begin(); /* No watchpoints in called functions. */
   553	
   554		KCSAN_EXPECT_READ_BARRIER(mb(), true);
   555		KCSAN_EXPECT_READ_BARRIER(wmb(), false);
   556		KCSAN_EXPECT_READ_BARRIER(rmb(), true);
   557		KCSAN_EXPECT_READ_BARRIER(smp_mb(), true);
   558		KCSAN_EXPECT_READ_BARRIER(smp_wmb(), false);
   559		KCSAN_EXPECT_READ_BARRIER(smp_rmb(), true);
   560		KCSAN_EXPECT_READ_BARRIER(dma_wmb(), false);
   561		KCSAN_EXPECT_READ_BARRIER(dma_rmb(), true);
   562		KCSAN_EXPECT_READ_BARRIER(smp_mb__before_atomic(), true);
   563		KCSAN_EXPECT_READ_BARRIER(smp_mb__after_atomic(), true);
   564		KCSAN_EXPECT_READ_BARRIER(smp_mb__after_spinlock(), true);
   565		KCSAN_EXPECT_READ_BARRIER(smp_store_mb(test_var, 0), true);
   566		KCSAN_EXPECT_READ_BARRIER(smp_load_acquire(&test_var), false);
   567		KCSAN_EXPECT_READ_BARRIER(smp_store_release(&test_var, 0), true);
   568		KCSAN_EXPECT_READ_BARRIER(xchg(&test_var, 0), true);
   569		KCSAN_EXPECT_READ_BARRIER(xchg_release(&test_var, 0), true);
   570		KCSAN_EXPECT_READ_BARRIER(xchg_relaxed(&test_var, 0), false);
   571		KCSAN_EXPECT_READ_BARRIER(cmpxchg(&test_var, 0,  0), true);
   572		KCSAN_EXPECT_READ_BARRIER(cmpxchg_release(&test_var, 0,  0), true);
   573		KCSAN_EXPECT_READ_BARRIER(cmpxchg_relaxed(&test_var, 0,  0), false);
   574		KCSAN_EXPECT_READ_BARRIER(atomic_read(&dummy), false);
   575		KCSAN_EXPECT_READ_BARRIER(atomic_read_acquire(&dummy), false);
   576		KCSAN_EXPECT_READ_BARRIER(atomic_set(&dummy, 0), false);
   577		KCSAN_EXPECT_READ_BARRIER(atomic_set_release(&dummy, 0), true);
   578		KCSAN_EXPECT_READ_BARRIER(atomic_add(1, &dummy), false);
   579		KCSAN_EXPECT_READ_BARRIER(atomic_add_return(1, &dummy), true);
   580		KCSAN_EXPECT_READ_BARRIER(atomic_add_return_acquire(1, &dummy), false);
   581		KCSAN_EXPECT_READ_BARRIER(atomic_add_return_release(1, &dummy), true);
   582		KCSAN_EXPECT_READ_BARRIER(atomic_add_return_relaxed(1, &dummy), false);
   583		KCSAN_EXPECT_READ_BARRIER(atomic_fetch_add(1, &dummy), true);
   584		KCSAN_EXPECT_READ_BARRIER(atomic_fetch_add_acquire(1, &dummy), false);
   585		KCSAN_EXPECT_READ_BARRIER(atomic_fetch_add_release(1, &dummy), true);
   586		KCSAN_EXPECT_READ_BARRIER(atomic_fetch_add_relaxed(1, &dummy), false);
   587		KCSAN_EXPECT_READ_BARRIER(test_and_set_bit(0, &test_var), true);
   588		KCSAN_EXPECT_READ_BARRIER(test_and_clear_bit(0, &test_var), true);
   589		KCSAN_EXPECT_READ_BARRIER(test_and_change_bit(0, &test_var), true);
   590		KCSAN_EXPECT_READ_BARRIER(clear_bit_unlock(0, &test_var), true);
   591		KCSAN_EXPECT_READ_BARRIER(__clear_bit_unlock(0, &test_var), true);
 > 592		KCSAN_EXPECT_READ_BARRIER(clear_bit_unlock_is_negative_byte(0, &test_var), true);
   593		KCSAN_EXPECT_READ_BARRIER(arch_spin_lock(&arch_spinlock), false);
   594		KCSAN_EXPECT_READ_BARRIER(arch_spin_unlock(&arch_spinlock), true);
   595		KCSAN_EXPECT_READ_BARRIER(spin_lock(&spinlock), false);
   596		KCSAN_EXPECT_READ_BARRIER(spin_unlock(&spinlock), true);
   597		KCSAN_EXPECT_READ_BARRIER(mutex_lock(&mutex), false);
   598		KCSAN_EXPECT_READ_BARRIER(mutex_unlock(&mutex), true);
   599	
   600		KCSAN_EXPECT_WRITE_BARRIER(mb(), true);
   601		KCSAN_EXPECT_WRITE_BARRIER(wmb(), true);
   602		KCSAN_EXPECT_WRITE_BARRIER(rmb(), false);
   603		KCSAN_EXPECT_WRITE_BARRIER(smp_mb(), true);
   604		KCSAN_EXPECT_WRITE_BARRIER(smp_wmb(), true);
   605		KCSAN_EXPECT_WRITE_BARRIER(smp_rmb(), false);
   606		KCSAN_EXPECT_WRITE_BARRIER(dma_wmb(), true);
   607		KCSAN_EXPECT_WRITE_BARRIER(dma_rmb(), false);
   608		KCSAN_EXPECT_WRITE_BARRIER(smp_mb__before_atomic(), true);
   609		KCSAN_EXPECT_WRITE_BARRIER(smp_mb__after_atomic(), true);
   610		KCSAN_EXPECT_WRITE_BARRIER(smp_mb__after_spinlock(), true);
   611		KCSAN_EXPECT_WRITE_BARRIER(smp_store_mb(test_var, 0), true);
   612		KCSAN_EXPECT_WRITE_BARRIER(smp_load_acquire(&test_var), false);
   613		KCSAN_EXPECT_WRITE_BARRIER(smp_store_release(&test_var, 0), true);
   614		KCSAN_EXPECT_WRITE_BARRIER(xchg(&test_var, 0), true);
   615		KCSAN_EXPECT_WRITE_BARRIER(xchg_release(&test_var, 0), true);
   616		KCSAN_EXPECT_WRITE_BARRIER(xchg_relaxed(&test_var, 0), false);
   617		KCSAN_EXPECT_WRITE_BARRIER(cmpxchg(&test_var, 0,  0), true);
   618		KCSAN_EXPECT_WRITE_BARRIER(cmpxchg_release(&test_var, 0,  0), true);
   619		KCSAN_EXPECT_WRITE_BARRIER(cmpxchg_relaxed(&test_var, 0,  0), false);
   620		KCSAN_EXPECT_WRITE_BARRIER(atomic_read(&dummy), false);
   621		KCSAN_EXPECT_WRITE_BARRIER(atomic_read_acquire(&dummy), false);
   622		KCSAN_EXPECT_WRITE_BARRIER(atomic_set(&dummy, 0), false);
   623		KCSAN_EXPECT_WRITE_BARRIER(atomic_set_release(&dummy, 0), true);
   624		KCSAN_EXPECT_WRITE_BARRIER(atomic_add(1, &dummy), false);
   625		KCSAN_EXPECT_WRITE_BARRIER(atomic_add_return(1, &dummy), true);
   626		KCSAN_EXPECT_WRITE_BARRIER(atomic_add_return_acquire(1, &dummy), false);
   627		KCSAN_EXPECT_WRITE_BARRIER(atomic_add_return_release(1, &dummy), true);
   628		KCSAN_EXPECT_WRITE_BARRIER(atomic_add_return_relaxed(1, &dummy), false);
   629		KCSAN_EXPECT_WRITE_BARRIER(atomic_fetch_add(1, &dummy), true);
   630		KCSAN_EXPECT_WRITE_BARRIER(atomic_fetch_add_acquire(1, &dummy), false);
   631		KCSAN_EXPECT_WRITE_BARRIER(atomic_fetch_add_release(1, &dummy), true);
   632		KCSAN_EXPECT_WRITE_BARRIER(atomic_fetch_add_relaxed(1, &dummy), false);
   633		KCSAN_EXPECT_WRITE_BARRIER(test_and_set_bit(0, &test_var), true);
   634		KCSAN_EXPECT_WRITE_BARRIER(test_and_clear_bit(0, &test_var), true);
   635		KCSAN_EXPECT_WRITE_BARRIER(test_and_change_bit(0, &test_var), true);
   636		KCSAN_EXPECT_WRITE_BARRIER(clear_bit_unlock(0, &test_var), true);
   637		KCSAN_EXPECT_WRITE_BARRIER(__clear_bit_unlock(0, &test_var), true);
   638		KCSAN_EXPECT_WRITE_BARRIER(clear_bit_unlock_is_negative_byte(0, &test_var), true);
   639		KCSAN_EXPECT_WRITE_BARRIER(arch_spin_lock(&arch_spinlock), false);
   640		KCSAN_EXPECT_WRITE_BARRIER(arch_spin_unlock(&arch_spinlock), true);
   641		KCSAN_EXPECT_WRITE_BARRIER(spin_lock(&spinlock), false);
   642		KCSAN_EXPECT_WRITE_BARRIER(spin_unlock(&spinlock), true);
   643		KCSAN_EXPECT_WRITE_BARRIER(mutex_lock(&mutex), false);
   644		KCSAN_EXPECT_WRITE_BARRIER(mutex_unlock(&mutex), true);
   645	
   646		KCSAN_EXPECT_RW_BARRIER(mb(), true);
   647		KCSAN_EXPECT_RW_BARRIER(wmb(), true);
   648		KCSAN_EXPECT_RW_BARRIER(rmb(), true);
   649		KCSAN_EXPECT_RW_BARRIER(smp_mb(), true);
   650		KCSAN_EXPECT_RW_BARRIER(smp_wmb(), true);
   651		KCSAN_EXPECT_RW_BARRIER(smp_rmb(), true);
   652		KCSAN_EXPECT_RW_BARRIER(dma_wmb(), true);
   653		KCSAN_EXPECT_RW_BARRIER(dma_rmb(), true);
   654		KCSAN_EXPECT_RW_BARRIER(smp_mb__before_atomic(), true);
   655		KCSAN_EXPECT_RW_BARRIER(smp_mb__after_atomic(), true);
   656		KCSAN_EXPECT_RW_BARRIER(smp_mb__after_spinlock(), true);
   657		KCSAN_EXPECT_RW_BARRIER(smp_store_mb(test_var, 0), true);
   658		KCSAN_EXPECT_RW_BARRIER(smp_load_acquire(&test_var), false);
   659		KCSAN_EXPECT_RW_BARRIER(smp_store_release(&test_var, 0), true);
   660		KCSAN_EXPECT_RW_BARRIER(xchg(&test_var, 0), true);
   661		KCSAN_EXPECT_RW_BARRIER(xchg_release(&test_var, 0), true);
   662		KCSAN_EXPECT_RW_BARRIER(xchg_relaxed(&test_var, 0), false);
   663		KCSAN_EXPECT_RW_BARRIER(cmpxchg(&test_var, 0,  0), true);
   664		KCSAN_EXPECT_RW_BARRIER(cmpxchg_release(&test_var, 0,  0), true);
   665		KCSAN_EXPECT_RW_BARRIER(cmpxchg_relaxed(&test_var, 0,  0), false);
   666		KCSAN_EXPECT_RW_BARRIER(atomic_read(&dummy), false);
   667		KCSAN_EXPECT_RW_BARRIER(atomic_read_acquire(&dummy), false);
   668		KCSAN_EXPECT_RW_BARRIER(atomic_set(&dummy, 0), false);
   669		KCSAN_EXPECT_RW_BARRIER(atomic_set_release(&dummy, 0), true);
   670		KCSAN_EXPECT_RW_BARRIER(atomic_add(1, &dummy), false);
   671		KCSAN_EXPECT_RW_BARRIER(atomic_add_return(1, &dummy), true);
   672		KCSAN_EXPECT_RW_BARRIER(atomic_add_return_acquire(1, &dummy), false);
   673		KCSAN_EXPECT_RW_BARRIER(atomic_add_return_release(1, &dummy), true);
   674		KCSAN_EXPECT_RW_BARRIER(atomic_add_return_relaxed(1, &dummy), false);
   675		KCSAN_EXPECT_RW_BARRIER(atomic_fetch_add(1, &dummy), true);
   676		KCSAN_EXPECT_RW_BARRIER(atomic_fetch_add_acquire(1, &dummy), false);
   677		KCSAN_EXPECT_RW_BARRIER(atomic_fetch_add_release(1, &dummy), true);
   678		KCSAN_EXPECT_RW_BARRIER(atomic_fetch_add_relaxed(1, &dummy), false);
   679		KCSAN_EXPECT_RW_BARRIER(test_and_set_bit(0, &test_var), true);
   680		KCSAN_EXPECT_RW_BARRIER(test_and_clear_bit(0, &test_var), true);
   681		KCSAN_EXPECT_RW_BARRIER(test_and_change_bit(0, &test_var), true);
   682		KCSAN_EXPECT_RW_BARRIER(clear_bit_unlock(0, &test_var), true);
   683		KCSAN_EXPECT_RW_BARRIER(__clear_bit_unlock(0, &test_var), true);
   684		KCSAN_EXPECT_RW_BARRIER(clear_bit_unlock_is_negative_byte(0, &test_var), true);
   685		KCSAN_EXPECT_RW_BARRIER(arch_spin_lock(&arch_spinlock), false);
   686		KCSAN_EXPECT_RW_BARRIER(arch_spin_unlock(&arch_spinlock), true);
   687		KCSAN_EXPECT_RW_BARRIER(spin_lock(&spinlock), false);
   688		KCSAN_EXPECT_RW_BARRIER(spin_unlock(&spinlock), true);
   689		KCSAN_EXPECT_RW_BARRIER(mutex_lock(&mutex), false);
   690		KCSAN_EXPECT_RW_BARRIER(mutex_unlock(&mutex), true);
   691	
   692		kcsan_nestable_atomic_end();
   693	}
   694	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux