public inbox for [email protected]
 help / color / mirror / Atom feed
* [ammarfaizi2-block:paulmck/linux-rcu/dave.2022.06.02a 56/78] kernel/rcu/tasks.h:1239:8: error: variable has incomplete type 'typeof (({
@ 2022-06-02 22:15 kernel test robot
  2022-06-02 23:52 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-06-02 22:15 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: llvm, kbuild-all, GNU/Weeb Mailing List, linux-kernel

tree:   https://github.com/ammarfaizi2/linux-block paulmck/linux-rcu/dave.2022.06.02a
head:   2efc5c4abe4cc1259378f7c1678a93540559673c
commit: cda3200416cdef7f25546cd6249fb411c8c32079 [56/78] rcu-tasks: Merge state into .b.need_qs and atomically update
config: arm-buildonly-randconfig-r004-20220531 (https://download.01.org/0day-ci/archive/20220603/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project b364c76683f8ef241025a9556300778c07b590c2)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/ammarfaizi2/linux-block/commit/cda3200416cdef7f25546cd6249fb411c8c32079
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block paulmck/linux-rcu/dave.2022.06.02a
        git checkout cda3200416cdef7f25546cd6249fb411c8c32079
        # 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=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

   In file included from kernel/rcu/update.c:606:
   kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
           ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
           arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
           __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic.h:73:9: note: expanded from macro '__atomic_op_fence'
           typeof(op##_relaxed(args)) __ret;                               \
                  ^~~~~~~~~~~~~~~~~~
   <scratch space>:39:1: note: expanded from here
   arch_cmpxchg_relaxed
   ^
   arch/arm/include/asm/cmpxchg.h:212:26: note: expanded from macro 'arch_cmpxchg_relaxed'
                                         (unsigned long)(o),               \
                                                        ^~~
   In file included from kernel/rcu/update.c:606:
   kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
           ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
           arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
           __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic.h:73:9: note: expanded from macro '__atomic_op_fence'
           typeof(op##_relaxed(args)) __ret;                               \
                  ^~~~~~~~~~~~~~~~~~
   <scratch space>:39:1: note: expanded from here
   arch_cmpxchg_relaxed
   ^
   arch/arm/include/asm/cmpxchg.h:213:26: note: expanded from macro 'arch_cmpxchg_relaxed'
                                         (unsigned long)(n),               \
                                                        ^~~
   In file included from kernel/rcu/update.c:606:
>> kernel/rcu/tasks.h:1239:8: error: variable has incomplete type 'typeof (({
   }))' (aka 'void')
   include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
           arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
           ^
   include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
           __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
           ^
   include/linux/atomic.h:73:29: note: expanded from macro '__atomic_op_fence'
           typeof(op##_relaxed(args)) __ret;                               \
                                      ^
   In file included from kernel/rcu/update.c:606:
   kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
           ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
           arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
           __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic.h:75:10: note: expanded from macro '__atomic_op_fence'
           __ret = op##_relaxed(args);                                     \
                   ^~~~~~~~~~~~~~~~~~
   <scratch space>:40:1: note: expanded from here
   arch_cmpxchg_relaxed
   ^
   arch/arm/include/asm/cmpxchg.h:212:26: note: expanded from macro 'arch_cmpxchg_relaxed'
                                         (unsigned long)(o),               \
                                                        ^~~
   In file included from kernel/rcu/update.c:606:
   kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
           ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
           arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
           __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic.h:75:10: note: expanded from macro '__atomic_op_fence'
           __ret = op##_relaxed(args);                                     \
                   ^~~~~~~~~~~~~~~~~~
   <scratch space>:40:1: note: expanded from here
   arch_cmpxchg_relaxed
   ^
   arch/arm/include/asm/cmpxchg.h:213:26: note: expanded from macro 'arch_cmpxchg_relaxed'
                                         (unsigned long)(n),               \
                                                        ^~~
   5 errors generated.


vim +1239 kernel/rcu/tasks.h

  1224	
  1225	/*
  1226	 * Do a cmpxchg() on ->trc_reader_special.b.need_qs, allowing for
  1227	 * the four-byte operand-size restriction of some platforms.
  1228	 * Returns the old value, which is often ignored.
  1229	 */
  1230	u8 rcu_trc_cmpxchg_need_qs(struct task_struct *t, u8 old, u8 new)
  1231	{
  1232		union rcu_special ret;
  1233		union rcu_special trs_old = READ_ONCE(t->trc_reader_special);
  1234		union rcu_special trs_new = trs_old;
  1235	
  1236		if (trs_old.b.need_qs != old)
  1237			return trs_old.b.need_qs;
  1238		trs_new.b.need_qs = new;
> 1239		ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
  1240		return ret.b.need_qs;
  1241	}
  1242	EXPORT_SYMBOL_GPL(rcu_trc_cmpxchg_need_qs);
  1243	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ammarfaizi2-block:paulmck/linux-rcu/dave.2022.06.02a 56/78] kernel/rcu/tasks.h:1239:8: error: variable has incomplete type 'typeof (({
  2022-06-02 22:15 [ammarfaizi2-block:paulmck/linux-rcu/dave.2022.06.02a 56/78] kernel/rcu/tasks.h:1239:8: error: variable has incomplete type 'typeof (({ kernel test robot
@ 2022-06-02 23:52 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2022-06-02 23:52 UTC (permalink / raw)
  To: kernel test robot
  Cc: llvm, kbuild-all, GNU/Weeb Mailing List, linux-kernel,
	linux-arm-kernel, dinguyen

On Fri, Jun 03, 2022 at 06:15:47AM +0800, kernel test robot wrote:
> tree:   https://github.com/ammarfaizi2/linux-block paulmck/linux-rcu/dave.2022.06.02a
> head:   2efc5c4abe4cc1259378f7c1678a93540559673c
> commit: cda3200416cdef7f25546cd6249fb411c8c32079 [56/78] rcu-tasks: Merge state into .b.need_qs and atomically update
> config: arm-buildonly-randconfig-r004-20220531 (https://download.01.org/0day-ci/archive/20220603/[email protected]/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project b364c76683f8ef241025a9556300778c07b590c2)
> 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 arm cross compiling tool for clang build
>         # apt-get install binutils-arm-linux-gnueabi
>         # https://github.com/ammarfaizi2/linux-block/commit/cda3200416cdef7f25546cd6249fb411c8c32079
>         git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
>         git fetch --no-tags ammarfaizi2-block paulmck/linux-rcu/dave.2022.06.02a
>         git checkout cda3200416cdef7f25546cd6249fb411c8c32079
>         # 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=arm SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <[email protected]>

OK, I finally get it.  The NIOS2 and ARM CPUs' implementations of
cmpxchg are not type-generic, are they?

OK, I will fix this, though the type-checking is rather nice.

Adding some NIOS2 and ARM people/lists on CC for their thoughts.

							Thanx, Paul

> All errors (new ones prefixed by >>):
> 
>    In file included from kernel/rcu/update.c:606:
>    kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
>            ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
>            arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
>            __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic.h:73:9: note: expanded from macro '__atomic_op_fence'
>            typeof(op##_relaxed(args)) __ret;                               \
>                   ^~~~~~~~~~~~~~~~~~
>    <scratch space>:39:1: note: expanded from here
>    arch_cmpxchg_relaxed
>    ^
>    arch/arm/include/asm/cmpxchg.h:212:26: note: expanded from macro 'arch_cmpxchg_relaxed'
>                                          (unsigned long)(o),               \
>                                                         ^~~
>    In file included from kernel/rcu/update.c:606:
>    kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
>            ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
>            arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
>            __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic.h:73:9: note: expanded from macro '__atomic_op_fence'
>            typeof(op##_relaxed(args)) __ret;                               \
>                   ^~~~~~~~~~~~~~~~~~
>    <scratch space>:39:1: note: expanded from here
>    arch_cmpxchg_relaxed
>    ^
>    arch/arm/include/asm/cmpxchg.h:213:26: note: expanded from macro 'arch_cmpxchg_relaxed'
>                                          (unsigned long)(n),               \
>                                                         ^~~
>    In file included from kernel/rcu/update.c:606:
> >> kernel/rcu/tasks.h:1239:8: error: variable has incomplete type 'typeof (({
>    }))' (aka 'void')
>    include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
>            arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
>            ^
>    include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
>            __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
>            ^
>    include/linux/atomic.h:73:29: note: expanded from macro '__atomic_op_fence'
>            typeof(op##_relaxed(args)) __ret;                               \
>                                       ^
>    In file included from kernel/rcu/update.c:606:
>    kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
>            ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
>            arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
>            __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic.h:75:10: note: expanded from macro '__atomic_op_fence'
>            __ret = op##_relaxed(args);                                     \
>                    ^~~~~~~~~~~~~~~~~~
>    <scratch space>:40:1: note: expanded from here
>    arch_cmpxchg_relaxed
>    ^
>    arch/arm/include/asm/cmpxchg.h:212:26: note: expanded from macro 'arch_cmpxchg_relaxed'
>                                          (unsigned long)(o),               \
>                                                         ^~~
>    In file included from kernel/rcu/update.c:606:
>    kernel/rcu/tasks.h:1239:8: error: operand of type 'union rcu_special' where arithmetic or pointer type is required
>            ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-instrumented.h:1916:2: note: expanded from macro 'cmpxchg'
>            arch_cmpxchg(__ai_ptr, __VA_ARGS__); \
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic/atomic-arch-fallback.h:52:2: note: expanded from macro 'arch_cmpxchg'
>            __atomic_op_fence(arch_cmpxchg, __VA_ARGS__)
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/atomic.h:75:10: note: expanded from macro '__atomic_op_fence'
>            __ret = op##_relaxed(args);                                     \
>                    ^~~~~~~~~~~~~~~~~~
>    <scratch space>:40:1: note: expanded from here
>    arch_cmpxchg_relaxed
>    ^
>    arch/arm/include/asm/cmpxchg.h:213:26: note: expanded from macro 'arch_cmpxchg_relaxed'
>                                          (unsigned long)(n),               \
>                                                         ^~~
>    5 errors generated.
> 
> 
> vim +1239 kernel/rcu/tasks.h
> 
>   1224	
>   1225	/*
>   1226	 * Do a cmpxchg() on ->trc_reader_special.b.need_qs, allowing for
>   1227	 * the four-byte operand-size restriction of some platforms.
>   1228	 * Returns the old value, which is often ignored.
>   1229	 */
>   1230	u8 rcu_trc_cmpxchg_need_qs(struct task_struct *t, u8 old, u8 new)
>   1231	{
>   1232		union rcu_special ret;
>   1233		union rcu_special trs_old = READ_ONCE(t->trc_reader_special);
>   1234		union rcu_special trs_new = trs_old;
>   1235	
>   1236		if (trs_old.b.need_qs != old)
>   1237			return trs_old.b.need_qs;
>   1238		trs_new.b.need_qs = new;
> > 1239		ret = cmpxchg(&t->trc_reader_special, trs_old, trs_new);
>   1240		return ret.b.need_qs;
>   1241	}
>   1242	EXPORT_SYMBOL_GPL(rcu_trc_cmpxchg_need_qs);
>   1243	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://01.org/lkp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-02 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-02 22:15 [ammarfaizi2-block:paulmck/linux-rcu/dave.2022.06.02a 56/78] kernel/rcu/tasks.h:1239:8: error: variable has incomplete type 'typeof (({ kernel test robot
2022-06-02 23:52 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox