[linux-next:master 3881/10945] kernel/kcsan/kcsan_test.c:945:17: warning: 'atomic_thread_fence' is not supported with '-fsanitize=thread'

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

 



Hi Ilya,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5e63226c72287bc6c6724d4fc7e157af0e3d7908
commit: e37b3dd063a1a68e28a7cfaf77c84c472112e330 [3881/10945] s390: enable KCSAN
config: s390-buildonly-randconfig-r005-20210829 (attached as .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=e37b3dd063a1a68e28a7cfaf77c84c472112e330
        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 e37b3dd063a1a68e28a7cfaf77c84c472112e330
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390 

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

All warnings (new ones prefixed by >>):

   kernel/kcsan/kcsan_test.c: In function 'test_atomic_builtins':
>> kernel/kcsan/kcsan_test.c:945:17: warning: 'atomic_thread_fence' is not supported with '-fsanitize=thread' [-Wtsan]
     945 |                 __atomic_thread_fence(__ATOMIC_SEQ_CST);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +945 kernel/kcsan/kcsan_test.c

1fe84fd4a4027a kernel/kcsan/kcsan-test.c Marco Elver 2020-05-05  901  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  902  /*
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  903   * Test atomic builtins work and required instrumentation functions exist. We
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  904   * also test that KCSAN understands they're atomic by racing with them via
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  905   * test_kernel_atomic_builtins(), and expect no reports.
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  906   *
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  907   * The atomic builtins _SHOULD NOT_ be used in normal kernel code!
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  908   */
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  909  static void test_atomic_builtins(struct kunit *test)
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  910  {
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  911  	bool match_never = false;
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  912  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  913  	begin_test_checks(test_kernel_atomic_builtins, test_kernel_atomic_builtins);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  914  	do {
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  915  		long tmp;
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  916  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  917  		kcsan_enable_current();
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  918  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  919  		__atomic_store_n(&test_var, 42L, __ATOMIC_RELAXED);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  920  		KUNIT_EXPECT_EQ(test, 42L, __atomic_load_n(&test_var, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  921  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  922  		KUNIT_EXPECT_EQ(test, 42L, __atomic_exchange_n(&test_var, 20, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  923  		KUNIT_EXPECT_EQ(test, 20L, test_var);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  924  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  925  		tmp = 20L;
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  926  		KUNIT_EXPECT_TRUE(test, __atomic_compare_exchange_n(&test_var, &tmp, 30L,
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  927  								    0, __ATOMIC_RELAXED,
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  928  								    __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  929  		KUNIT_EXPECT_EQ(test, tmp, 20L);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  930  		KUNIT_EXPECT_EQ(test, test_var, 30L);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  931  		KUNIT_EXPECT_FALSE(test, __atomic_compare_exchange_n(&test_var, &tmp, 40L,
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  932  								     1, __ATOMIC_RELAXED,
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  933  								     __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  934  		KUNIT_EXPECT_EQ(test, tmp, 30L);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  935  		KUNIT_EXPECT_EQ(test, test_var, 30L);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  936  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  937  		KUNIT_EXPECT_EQ(test, 30L, __atomic_fetch_add(&test_var, 1, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  938  		KUNIT_EXPECT_EQ(test, 31L, __atomic_fetch_sub(&test_var, 1, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  939  		KUNIT_EXPECT_EQ(test, 30L, __atomic_fetch_and(&test_var, 0xf, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  940  		KUNIT_EXPECT_EQ(test, 14L, __atomic_fetch_xor(&test_var, 0xf, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  941  		KUNIT_EXPECT_EQ(test, 1L, __atomic_fetch_or(&test_var, 0xf0, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  942  		KUNIT_EXPECT_EQ(test, 241L, __atomic_fetch_nand(&test_var, 0xf, __ATOMIC_RELAXED));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  943  		KUNIT_EXPECT_EQ(test, -2L, test_var);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  944  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03 @945  		__atomic_thread_fence(__ATOMIC_SEQ_CST);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  946  		__atomic_signal_fence(__ATOMIC_SEQ_CST);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  947  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  948  		kcsan_disable_current();
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  949  
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  950  		match_never = report_available();
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  951  	} while (!end_test_checks(match_never));
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  952  	KUNIT_EXPECT_FALSE(test, match_never);
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  953  }
f9ea6319313547 kernel/kcsan/kcsan-test.c Marco Elver 2020-07-03  954  

:::::: The code at line 945 was first introduced by commit
:::::: f9ea63193135473ed6b6ff06f016eb6248100041 kcsan: Add atomic builtin test case

:::::: TO: Marco Elver <elver@xxxxxxxxxx>
:::::: CC: Paul E. McKenney <paulmck@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[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