All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [arm-perf:rwonce/cleanup 4/4] include/linux/compiler.h:314:38: error: call to '__compiletime_assert_323' declared with attribute error: Incompatible pointer type for {READ, WRITE}_ONCE().
@ 2019-12-18 23:23 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-12-18 23:23 UTC (permalink / raw
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 17203 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git rwonce/cleanup
head:   e919b6024098f436246d3ca35cfeccbffc2fb292
commit: e919b6024098f436246d3ca35cfeccbffc2fb292 [4/4] READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses
config: m68k-multi_defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout e919b6024098f436246d3ca35cfeccbffc2fb292
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:11:0,
                    from mm/gup.c:2:
   mm/gup.c: In function 'follow_pmd_mask.isra.52':
>> include/linux/compiler.h:314:38: error: call to '__compiletime_assert_323' declared with attribute error: Incompatible pointer type for {READ,WRITE}_ONCE().
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:295:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:314:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:327:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
     ^~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:220:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
     compiletime_assert_rwonce_type(x);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:224:22: note: in expansion of macro 'READ_ONCE_NOCHECK'
    #define READ_ONCE(x) READ_ONCE_NOCHECK(x)
                         ^~~~~~~~~~~~~~~~~
>> mm/gup.c:323:11: note: in expansion of macro 'READ_ONCE'
     pmdval = READ_ONCE(*pmd);
              ^~~~~~~~~
   include/linux/compiler.h:314:38: error: call to '__compiletime_assert_348' declared with attribute error: Incompatible pointer type for {READ,WRITE}_ONCE().
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:295:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:314:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:327:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
     ^~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:220:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
     compiletime_assert_rwonce_type(x);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:224:22: note: in expansion of macro 'READ_ONCE_NOCHECK'
    #define READ_ONCE(x) READ_ONCE_NOCHECK(x)
                         ^~~~~~~~~~~~~~~~~
   mm/gup.c:348:12: note: in expansion of macro 'READ_ONCE'
      pmdval = READ_ONCE(*pmd);
               ^~~~~~~~~
--
   In file included from include/asm-generic/bug.h:5:0,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:9,
                    from mm/page_vma_mapped.c:2:
   mm/page_vma_mapped.c: In function 'page_vma_mapped_walk':
   include/linux/compiler.h:314:38: error: call to '__compiletime_assert_182' declared with attribute error: Incompatible pointer type for {READ,WRITE}_ONCE().
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:295:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:314:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:327:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
     ^~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:220:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
     compiletime_assert_rwonce_type(x);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:224:22: note: in expansion of macro 'READ_ONCE_NOCHECK'
    #define READ_ONCE(x) READ_ONCE_NOCHECK(x)
                         ^~~~~~~~~~~~~~~~~
>> mm/page_vma_mapped.c:182:9: note: in expansion of macro 'READ_ONCE'
     pmde = READ_ONCE(*pvmw->pmd);
            ^~~~~~~~~
--
   In file included from include/linux/kernel.h:11:0,
                    from include/linux/list.h:9,
                    from fs/userfaultfd.c:13:
   fs/userfaultfd.c: In function 'userfaultfd_must_wait.isra.23':
   include/linux/compiler.h:314:38: error: call to '__compiletime_assert_309' declared with attribute error: Incompatible pointer type for {READ,WRITE}_ONCE().
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:295:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:314:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:327:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
     ^~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:220:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
     compiletime_assert_rwonce_type(x);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/compiler.h:224:22: note: in expansion of macro 'READ_ONCE_NOCHECK'
    #define READ_ONCE(x) READ_ONCE_NOCHECK(x)
                         ^~~~~~~~~~~~~~~~~
>> fs/userfaultfd.c:309:9: note: in expansion of macro 'READ_ONCE'
     _pmd = READ_ONCE(*pmd);
            ^~~~~~~~~

vim +/__compiletime_assert_323 +314 include/linux/compiler.h

e919b6024098f4 Will Deacon           2019-12-13  213  
60faf05c854a87 Will Deacon           2019-12-16  214  /*
60faf05c854a87 Will Deacon           2019-12-16  215   * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need
60faf05c854a87 Will Deacon           2019-12-16  216   * to hide memory access from KASAN.
60faf05c854a87 Will Deacon           2019-12-16  217   */
60faf05c854a87 Will Deacon           2019-12-16  218  #define READ_ONCE_NOCHECK(x)						\
d976441f44bc5d Andrey Ryabinin       2015-10-19  219  ({									\
e919b6024098f4 Will Deacon           2019-12-13 @220  	compiletime_assert_rwonce_type(x);				\
e919b6024098f4 Will Deacon           2019-12-13  221  	__READ_ONCE_SCALAR(x);						\
d976441f44bc5d Andrey Ryabinin       2015-10-19  222  })
d976441f44bc5d Andrey Ryabinin       2015-10-19  223  
60faf05c854a87 Will Deacon           2019-12-16 @224  #define READ_ONCE(x)	READ_ONCE_NOCHECK(x)
60faf05c854a87 Will Deacon           2019-12-16  225  
e919b6024098f4 Will Deacon           2019-12-13  226  #define __WRITE_ONCE(x, val)				\
60faf05c854a87 Will Deacon           2019-12-16  227  do {							\
60faf05c854a87 Will Deacon           2019-12-16  228  	*(volatile typeof(x) *)&(x) = (val);		\
60faf05c854a87 Will Deacon           2019-12-16  229  } while (0)
60faf05c854a87 Will Deacon           2019-12-16  230  
e919b6024098f4 Will Deacon           2019-12-13  231  #define WRITE_ONCE(x, val)				\
e919b6024098f4 Will Deacon           2019-12-13  232  do {							\
e919b6024098f4 Will Deacon           2019-12-13  233  	compiletime_assert_rwonce_type(x);		\
e919b6024098f4 Will Deacon           2019-12-13  234  	__WRITE_ONCE(x, val);				\
e919b6024098f4 Will Deacon           2019-12-13  235  } while (0)
e919b6024098f4 Will Deacon           2019-12-13  236  
60faf05c854a87 Will Deacon           2019-12-16  237  #ifdef CONFIG_KASAN
d976441f44bc5d Andrey Ryabinin       2015-10-19  238  /*
60faf05c854a87 Will Deacon           2019-12-16  239   * We can't declare function 'inline' because __no_sanitize_address conflicts
60faf05c854a87 Will Deacon           2019-12-16  240   * with inlining. Attempt to inline it may cause a build failure.
60faf05c854a87 Will Deacon           2019-12-16  241   *     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
60faf05c854a87 Will Deacon           2019-12-16  242   * '__maybe_unused' allows us to avoid defined-but-not-used warnings.
d976441f44bc5d Andrey Ryabinin       2015-10-19  243   */
60faf05c854a87 Will Deacon           2019-12-16  244  # define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused
60faf05c854a87 Will Deacon           2019-12-16  245  #else
60faf05c854a87 Will Deacon           2019-12-16  246  # define __no_kasan_or_inline __always_inline
60faf05c854a87 Will Deacon           2019-12-16  247  #endif
230fa253df6352 Christian Borntraeger 2014-11-25  248  
7f1e541fc8d57a Andrey Ryabinin       2018-02-01  249  static __no_kasan_or_inline
7f1e541fc8d57a Andrey Ryabinin       2018-02-01  250  unsigned long read_word_at_a_time(const void *addr)
7f1e541fc8d57a Andrey Ryabinin       2018-02-01  251  {
7f1e541fc8d57a Andrey Ryabinin       2018-02-01  252  	kasan_check_read(addr, 1);
7f1e541fc8d57a Andrey Ryabinin       2018-02-01  253  	return *(unsigned long *)addr;
7f1e541fc8d57a Andrey Ryabinin       2018-02-01  254  }
7f1e541fc8d57a Andrey Ryabinin       2018-02-01  255  
^1da177e4c3f41 Linus Torvalds        2005-04-16  256  #endif /* __KERNEL__ */
^1da177e4c3f41 Linus Torvalds        2005-04-16  257  
7290d58095712a Ard Biesheuvel        2018-08-21  258  /*
7290d58095712a Ard Biesheuvel        2018-08-21  259   * Force the compiler to emit 'sym' as a symbol, so that we can reference
7290d58095712a Ard Biesheuvel        2018-08-21  260   * it from inline assembler. Necessary in case 'sym' could be inlined
7290d58095712a Ard Biesheuvel        2018-08-21  261   * otherwise, or eliminated entirely due to lack of references that are
7290d58095712a Ard Biesheuvel        2018-08-21  262   * visible to the compiler.
7290d58095712a Ard Biesheuvel        2018-08-21  263   */
7290d58095712a Ard Biesheuvel        2018-08-21  264  #define __ADDRESSABLE(sym) \
bfafddd8de426d Nick Desaulniers      2019-08-28  265  	static void * __section(.discard.addressable) __used \
7290d58095712a Ard Biesheuvel        2018-08-21  266  		__PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
7290d58095712a Ard Biesheuvel        2018-08-21  267  
7290d58095712a Ard Biesheuvel        2018-08-21  268  /**
7290d58095712a Ard Biesheuvel        2018-08-21  269   * offset_to_ptr - convert a relative memory offset to an absolute pointer
7290d58095712a Ard Biesheuvel        2018-08-21  270   * @off:	the address of the 32-bit offset value
7290d58095712a Ard Biesheuvel        2018-08-21  271   */
7290d58095712a Ard Biesheuvel        2018-08-21  272  static inline void *offset_to_ptr(const int *off)
7290d58095712a Ard Biesheuvel        2018-08-21  273  {
7290d58095712a Ard Biesheuvel        2018-08-21  274  	return (void *)((unsigned long)off + *off);
7290d58095712a Ard Biesheuvel        2018-08-21  275  }
7290d58095712a Ard Biesheuvel        2018-08-21  276  
^1da177e4c3f41 Linus Torvalds        2005-04-16  277  #endif /* __ASSEMBLY__ */
^1da177e4c3f41 Linus Torvalds        2005-04-16  278  
9f0cf4adb6aa0b Arjan van de Ven      2009-09-26  279  /* Compile time object size, -1 for unknown */
9f0cf4adb6aa0b Arjan van de Ven      2009-09-26  280  #ifndef __compiletime_object_size
9f0cf4adb6aa0b Arjan van de Ven      2009-09-26  281  # define __compiletime_object_size(obj) -1
9f0cf4adb6aa0b Arjan van de Ven      2009-09-26  282  #endif
4a3127693001c6 Arjan van de Ven      2009-09-30  283  #ifndef __compiletime_warning
4a3127693001c6 Arjan van de Ven      2009-09-30  284  # define __compiletime_warning(message)
4a3127693001c6 Arjan van de Ven      2009-09-30  285  #endif
63312b6a6faae3 Arjan van de Ven      2009-10-02  286  #ifndef __compiletime_error
63312b6a6faae3 Arjan van de Ven      2009-10-02  287  # define __compiletime_error(message)
63312b6a6faae3 Arjan van de Ven      2009-10-02  288  #endif
c361d3e54364d1 Daniel Santos         2013-02-21  289  
c03567a8e8d5cf Joe Stringer          2017-08-31  290  #ifdef __OPTIMIZE__
9a8ab1c39970a4 Daniel Santos         2013-02-21  291  # define __compiletime_assert(condition, msg, prefix, suffix)		\
9a8ab1c39970a4 Daniel Santos         2013-02-21  292  	do {								\
9a8ab1c39970a4 Daniel Santos         2013-02-21  293  		extern void prefix ## suffix(void) __compiletime_error(msg); \
81b45683487a51 Masahiro Yamada       2018-08-26  294  		if (!(condition))					\
9a8ab1c39970a4 Daniel Santos         2013-02-21 @295  			prefix ## suffix();				\
9a8ab1c39970a4 Daniel Santos         2013-02-21  296  	} while (0)
c03567a8e8d5cf Joe Stringer          2017-08-31  297  #else
c03567a8e8d5cf Joe Stringer          2017-08-31  298  # define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0)
c03567a8e8d5cf Joe Stringer          2017-08-31  299  #endif
9a8ab1c39970a4 Daniel Santos         2013-02-21  300  
9a8ab1c39970a4 Daniel Santos         2013-02-21  301  #define _compiletime_assert(condition, msg, prefix, suffix) \
9a8ab1c39970a4 Daniel Santos         2013-02-21  302  	__compiletime_assert(condition, msg, prefix, suffix)
9a8ab1c39970a4 Daniel Santos         2013-02-21  303  
9a8ab1c39970a4 Daniel Santos         2013-02-21  304  /**
9a8ab1c39970a4 Daniel Santos         2013-02-21  305   * compiletime_assert - break build and emit msg if condition is false
9a8ab1c39970a4 Daniel Santos         2013-02-21  306   * @condition: a compile-time constant condition to check
9a8ab1c39970a4 Daniel Santos         2013-02-21  307   * @msg:       a message to emit if condition is false
9a8ab1c39970a4 Daniel Santos         2013-02-21  308   *
9a8ab1c39970a4 Daniel Santos         2013-02-21  309   * In tradition of POSIX assert, this macro will break the build if the
9a8ab1c39970a4 Daniel Santos         2013-02-21  310   * supplied condition is *false*, emitting the supplied error message if the
9a8ab1c39970a4 Daniel Santos         2013-02-21  311   * compiler has support to do so.
9a8ab1c39970a4 Daniel Santos         2013-02-21  312   */
9a8ab1c39970a4 Daniel Santos         2013-02-21  313  #define compiletime_assert(condition, msg) \
9a8ab1c39970a4 Daniel Santos         2013-02-21 @314  	_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
9a8ab1c39970a4 Daniel Santos         2013-02-21  315  
47933ad41a86a4 Peter Zijlstra        2013-11-06  316  #define compiletime_assert_atomic_type(t)				\
47933ad41a86a4 Peter Zijlstra        2013-11-06  317  	compiletime_assert(__native_word(t),				\
47933ad41a86a4 Peter Zijlstra        2013-11-06  318  		"Need native word sized stores/loads for atomicity.")
47933ad41a86a4 Peter Zijlstra        2013-11-06  319  
e919b6024098f4 Will Deacon           2019-12-13  320  /*
e919b6024098f4 Will Deacon           2019-12-13  321   * Yes, this permits 64-bit accesses on 32-bit architectures. These will
e919b6024098f4 Will Deacon           2019-12-13  322   * actually be atomic in many cases (namely x86), but for others we rely on
e919b6024098f4 Will Deacon           2019-12-13  323   * the access being split into 2x32-bit accesses for a 32-bit quantity (e.g.
e919b6024098f4 Will Deacon           2019-12-13  324   * a virtual address) and a strong prevailing wind.
e919b6024098f4 Will Deacon           2019-12-13  325   */
e919b6024098f4 Will Deacon           2019-12-13  326  #define compiletime_assert_rwonce_type(t)					\
e919b6024098f4 Will Deacon           2019-12-13 @327  	compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),	\
e919b6024098f4 Will Deacon           2019-12-13  328  		"Incompatible pointer type for {READ,WRITE}_ONCE().")
e919b6024098f4 Will Deacon           2019-12-13  329  

:::::: The code at line 314 was first introduced by commit
:::::: 9a8ab1c39970a4938a72d94e6fd13be88a797590 bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG

:::::: TO: Daniel Santos <daniel.santos@pobox.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 16752 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-18 23:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-18 23:23 [arm-perf:rwonce/cleanup 4/4] include/linux/compiler.h:314:38: error: call to '__compiletime_assert_323' declared with attribute error: Incompatible pointer type for {READ, WRITE}_ONCE() kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.