tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 
rcu/urgent
head:   239341154165cec3676955bab4cc1d61852257ed
commit: 239341154165cec3676955bab4cc1d61852257ed [1/1] rcu: Fixup noinstr 
warnings
config: s390-randconfig-r025-20200624 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 
8911a35180c6777188fefe0954a2451a2b91deaf)
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 s390 cross compiling tool for clang build
        # apt-get install binutils-s390-linux-gnu
        git checkout 239341154165cec3676955bab4cc1d61852257ed
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 

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

All errors (new ones prefixed by >>):

   include/uapi/linux/swab.h:19:12: note: expanded from macro 
'___constant_swab32'
           (((__u32)(x) & (__u32)0x000000ffUL) << 24) |            \
                     ^
   In file included from kernel/rcu/tree.c:50:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:21:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro 
'__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:20:12: note: expanded from macro 
'___constant_swab32'
           (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |            \
                     ^
   In file included from kernel/rcu/tree.c:50:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:21:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro 
'__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:21:12: note: expanded from macro 
'___constant_swab32'
           (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |            \
                     ^
   In file included from kernel/rcu/tree.c:50:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:21:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro 
'__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:22:12: note: expanded from macro 
'___constant_swab32'
           (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
                     ^
   In file included from kernel/rcu/tree.c:50:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:21:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro 
'__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
           __fswab32(x))
                     ^
   In file included from kernel/rcu/tree.c:50:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:21:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:46: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
                                            ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:46: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
                                            ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a 
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> kernel/rcu/tree.c:253:8: error: implicit declaration of function 
>> 'arch_atomic_add_return' [-Werror,-Wimplicit-function-declaration]
           seq = arch_atomic_add_return(RCU_DYNTICK_CTRL_CTR, &rdp->dynticks);
                 ^
   kernel/rcu/tree.c:253:8: note: did you mean 'atomic_add_return'?
   arch/s390/include/asm/atomic.h:37:19: note: 'atomic_add_return' declared here
   static inline int atomic_add_return(int i, atomic_t *v)
                     ^
   kernel/rcu/tree.c:277:8: error: implicit declaration of function 
'arch_atomic_add_return' [-Werror,-Wimplicit-function-declaration]
           seq = arch_atomic_add_return(RCU_DYNTICK_CTRL_CTR, &rdp->dynticks);
                 ^
>> kernel/rcu/tree.c:283:3: error: implicit declaration of function 
>> 'arch_atomic_andnot' [-Werror,-Wimplicit-function-declaration]
                   arch_atomic_andnot(RCU_DYNTICK_CTRL_MASK, &rdp->dynticks);
                   ^
   kernel/rcu/tree.c:283:3: note: did you mean 'atomic_andnot'?
   include/linux/atomic-fallback.h:652:1: note: 'atomic_andnot' declared here
   atomic_andnot(int i, atomic_t *v)
   ^
>> kernel/rcu/tree.c:316:11: error: implicit declaration of function 
>> 'arch_atomic_read' [-Werror,-Wimplicit-function-declaration]
           return !(arch_atomic_read(&rdp->dynticks) & RCU_DYNTICK_CTRL_CTR);
                    ^
   kernel/rcu/tree.c:316:11: note: did you mean 'atomic_read'?
   arch/s390/include/asm/atomic.h:20:19: note: 'atomic_read' declared here
   static inline int atomic_read(const atomic_t *v)
                     ^
   20 warnings and 4 errors generated.

vim +/arch_atomic_add_return +253 kernel/rcu/tree.c

   235  
   236  /*
   237   * Record entry into an extended quiescent state.  This is only to be
   238   * called when not already in an extended quiescent state, that is,
   239   * RCU is watching prior to the call to this function and is no longer
   240   * watching upon return.
   241   */
   242  static noinstr void rcu_dynticks_eqs_enter(void)
   243  {
   244          struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
   245          int seq;
   246  
   247          /*
   248           * CPUs seeing atomic_add_return() must see prior RCU read-side
   249           * critical sections, and we also must force ordering with the
   250           * next idle sojourn.
   251           */
   252          rcu_dynticks_task_trace_enter();  // Before ->dynticks update!
 > 253          seq = arch_atomic_add_return(RCU_DYNTICK_CTRL_CTR, 
 > &rdp->dynticks);
   254          // RCU is no longer watching.  Better be in extended quiescent 
state!
   255          WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
   256                       (seq & RCU_DYNTICK_CTRL_CTR));
   257          /* Better not have special action (TLB flush) pending! */
   258          WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
   259                       (seq & RCU_DYNTICK_CTRL_MASK));
   260  }
   261  
   262  /*
   263   * Record exit from an extended quiescent state.  This is only to be
   264   * called from an extended quiescent state, that is, RCU is not watching
   265   * prior to the call to this function and is watching upon return.
   266   */
   267  static noinstr void rcu_dynticks_eqs_exit(void)
   268  {
   269          struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
   270          int seq;
   271  
   272          /*
   273           * CPUs seeing atomic_add_return() must see prior idle sojourns,
   274           * and we also must force ordering with the next RCU read-side
   275           * critical section.
   276           */
   277          seq = arch_atomic_add_return(RCU_DYNTICK_CTRL_CTR, 
&rdp->dynticks);
   278          // RCU is now watching.  Better not be in an extended quiescent 
state!
   279          rcu_dynticks_task_trace_exit();  // After ->dynticks update!
   280          WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
   281                       !(seq & RCU_DYNTICK_CTRL_CTR));
   282          if (seq & RCU_DYNTICK_CTRL_MASK) {
 > 283                  arch_atomic_andnot(RCU_DYNTICK_CTRL_MASK, 
 > &rdp->dynticks);
   284                  smp_mb__after_atomic(); /* _exit after clearing mask. */
   285          }
   286  }
   287  
   288  /*
   289   * Reset the current CPU's ->dynticks counter to indicate that the
   290   * newly onlined CPU is no longer in an extended quiescent state.
   291   * This will either leave the counter unchanged, or increment it
   292   * to the next non-quiescent value.
   293   *
   294   * The non-atomic test/increment sequence works because the upper bits
   295   * of the ->dynticks counter are manipulated only by the corresponding 
CPU,
   296   * or when the corresponding CPU is offline.
   297   */
   298  static void rcu_dynticks_eqs_online(void)
   299  {
   300          struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
   301  
   302          if (atomic_read(&rdp->dynticks) & RCU_DYNTICK_CTRL_CTR)
   303                  return;
   304          atomic_add(RCU_DYNTICK_CTRL_CTR, &rdp->dynticks);
   305  }
   306  
   307  /*
   308   * Is the current CPU in an extended quiescent state?
   309   *
   310   * No ordering, as we are sampling CPU-local information.
   311   */
   312  static __always_inline bool rcu_dynticks_curr_cpu_in_eqs(void)
   313  {
   314          struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
   315  
 > 316          return !(arch_atomic_read(&rdp->dynticks) & 
 > RCU_DYNTICK_CTRL_CTR);
   317  }
   318  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

Reply via email to