linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 5136/13299] include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'}
@ 2023-10-18 10:59 kernel test robot
  2023-10-18 11:38 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-10-18 10:59 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: oe-kbuild-all, Linux Memory Management List, Paolo Abeni, David Ahern

Hi Eric,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2dac75696c6da3c848daa118a729827541c89d33
commit: fa17a6d8a5bd0cd7565b613cb804242cd0f6b7ab [5136/13299] ipv6: lockless IPV6_ADDR_PREFERENCES implementation
config: alpha-defconfig (https://download.01.org/0day-ci/archive/20231018/202310181854.pKtHd7fD-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231018/202310181854.pKtHd7fD-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310181854.pKtHd7fD-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/alpha/include/asm/rwonce.h:33,
                    from include/linux/compiler.h:246,
                    from include/linux/string.h:5,
                    from net/sunrpc/xprtsock.c:23:
   In function 'ip6_sock_set_addr_preferences',
       inlined from 'xs_tcp_finish_connecting' at net/sunrpc/xprtsock.c:2325:4,
       inlined from 'xs_tcp_setup_socket' at net/sunrpc/xprtsock.c:2405:11:
>> include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
      44 | #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
         |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |                                        ^~~
   include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
    1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
         |         ^~~~~~~~~~
   include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
      50 |         __READ_ONCE(x);                                                 \
         |         ^~~~~~~~~~~
   include/net/ipv6.h:1366:21: note: in expansion of macro 'READ_ONCE'
    1366 |                    (READ_ONCE(inet6_sk(sk)->srcprefs) & prefmask) | pref);
         |                     ^~~~~~~~~
   In function 'xs_tcp_setup_socket':
   cc1: note: source object is likely at address zero
   In function 'ip6_sock_set_addr_preferences',
       inlined from 'xs_tcp_finish_connecting' at net/sunrpc/xprtsock.c:2325:4,
       inlined from 'xs_tcp_setup_socket' at net/sunrpc/xprtsock.c:2405:11:
   include/asm-generic/rwonce.h:55:37: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   include/asm-generic/rwonce.h:61:9: note: in expansion of macro '__WRITE_ONCE'
      61 |         __WRITE_ONCE(x, val);                                           \
         |         ^~~~~~~~~~~~
   include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
    1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
         |         ^~~~~~~~~~
   In function 'xs_tcp_setup_socket':
   cc1: note: source object is likely at address zero
   In function 'ip6_sock_set_addr_preferences',
       inlined from 'xs_tcp_tls_finish_connecting' at net/sunrpc/xprtsock.c:2478:4:
>> include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
      44 | #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
         |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |                                        ^~~
   include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
    1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
         |         ^~~~~~~~~~
   include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
      50 |         __READ_ONCE(x);                                                 \
         |         ^~~~~~~~~~~
   include/net/ipv6.h:1366:21: note: in expansion of macro 'READ_ONCE'
    1366 |                    (READ_ONCE(inet6_sk(sk)->srcprefs) & prefmask) | pref);
         |                     ^~~~~~~~~
   In function 'xs_tcp_tls_finish_connecting':
   cc1: note: source object is likely at address zero
   In function 'ip6_sock_set_addr_preferences',
       inlined from 'xs_tcp_tls_finish_connecting' at net/sunrpc/xprtsock.c:2478:4:
   include/asm-generic/rwonce.h:55:37: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
      55 |         *(volatile typeof(x) *)&(x) = (val);                            \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   include/asm-generic/rwonce.h:61:9: note: in expansion of macro '__WRITE_ONCE'
      61 |         __WRITE_ONCE(x, val);                                           \
         |         ^~~~~~~~~~~~
   include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
    1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
         |         ^~~~~~~~~~
   In function 'xs_tcp_tls_finish_connecting':
   cc1: note: source object is likely at address zero


vim +44 include/asm-generic/rwonce.h

e506ea451254ab Will Deacon 2019-10-15  28  
e506ea451254ab Will Deacon 2019-10-15  29  /*
e506ea451254ab Will Deacon 2019-10-15  30   * Yes, this permits 64-bit accesses on 32-bit architectures. These will
e506ea451254ab Will Deacon 2019-10-15  31   * actually be atomic in some cases (namely Armv7 + LPAE), but for others we
e506ea451254ab Will Deacon 2019-10-15  32   * rely on the access being split into 2x32-bit accesses for a 32-bit quantity
e506ea451254ab Will Deacon 2019-10-15  33   * (e.g. a virtual address) and a strong prevailing wind.
e506ea451254ab Will Deacon 2019-10-15  34   */
e506ea451254ab Will Deacon 2019-10-15  35  #define compiletime_assert_rwonce_type(t)					\
e506ea451254ab Will Deacon 2019-10-15  36  	compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),	\
e506ea451254ab Will Deacon 2019-10-15  37  		"Unsupported access size for {READ,WRITE}_ONCE().")
e506ea451254ab Will Deacon 2019-10-15  38  
e506ea451254ab Will Deacon 2019-10-15  39  /*
e506ea451254ab Will Deacon 2019-10-15  40   * Use __READ_ONCE() instead of READ_ONCE() if you do not require any
3c9184109e78ea Will Deacon 2019-10-30  41   * atomicity. Note that this may result in tears!
e506ea451254ab Will Deacon 2019-10-15  42   */
b78b331a3f5c07 Will Deacon 2019-10-15  43  #ifndef __READ_ONCE
e506ea451254ab Will Deacon 2019-10-15 @44  #define __READ_ONCE(x)	(*(const volatile __unqual_scalar_typeof(x) *)&(x))
b78b331a3f5c07 Will Deacon 2019-10-15  45  #endif
e506ea451254ab Will Deacon 2019-10-15  46  

:::::: The code at line 44 was first introduced by commit
:::::: e506ea451254ab17e0bf918ca36232fec2a9b10c compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h

:::::: TO: Will Deacon <will@kernel.org>
:::::: CC: Will Deacon <will@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [linux-next:master 5136/13299] include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'}
  2023-10-18 10:59 [linux-next:master 5136/13299] include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} kernel test robot
@ 2023-10-18 11:38 ` Eric Dumazet
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2023-10-18 11:38 UTC (permalink / raw)
  To: kernel test robot
  Cc: oe-kbuild-all, Linux Memory Management List, Paolo Abeni, David Ahern

On Wed, Oct 18, 2023 at 1:01 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Eric,
>
> FYI, the error/warning still remains.
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   2dac75696c6da3c848daa118a729827541c89d33
> commit: fa17a6d8a5bd0cd7565b613cb804242cd0f6b7ab [5136/13299] ipv6: lockless IPV6_ADDR_PREFERENCES implementation
> config: alpha-defconfig (https://download.01.org/0day-ci/archive/20231018/202310181854.pKtHd7fD-lkp@intel.com/config)
> compiler: alpha-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231018/202310181854.pKtHd7fD-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202310181854.pKtHd7fD-lkp@intel.com/
>

I have no idea why this compiler is not happy.

I would probably contact a compiler maintainer perhaps ?


> All warnings (new ones prefixed by >>):
>
>    In file included from arch/alpha/include/asm/rwonce.h:33,
>                     from include/linux/compiler.h:246,
>                     from include/linux/string.h:5,
>                     from net/sunrpc/xprtsock.c:23:
>    In function 'ip6_sock_set_addr_preferences',
>        inlined from 'xs_tcp_finish_connecting' at net/sunrpc/xprtsock.c:2325:4,
>        inlined from 'xs_tcp_setup_socket' at net/sunrpc/xprtsock.c:2405:11:
> >> include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
>       44 | #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
>          |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
>       55 |         *(volatile typeof(x) *)&(x) = (val);                            \
>          |                                        ^~~
>    include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
>     1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
>          |         ^~~~~~~~~~
>    include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
>       50 |         __READ_ONCE(x);                                                 \
>          |         ^~~~~~~~~~~
>    include/net/ipv6.h:1366:21: note: in expansion of macro 'READ_ONCE'
>     1366 |                    (READ_ONCE(inet6_sk(sk)->srcprefs) & prefmask) | pref);
>          |                     ^~~~~~~~~
>    In function 'xs_tcp_setup_socket':
>    cc1: note: source object is likely at address zero
>    In function 'ip6_sock_set_addr_preferences',
>        inlined from 'xs_tcp_finish_connecting' at net/sunrpc/xprtsock.c:2325:4,
>        inlined from 'xs_tcp_setup_socket' at net/sunrpc/xprtsock.c:2405:11:
>    include/asm-generic/rwonce.h:55:37: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
>       55 |         *(volatile typeof(x) *)&(x) = (val);                            \
>          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
>    include/asm-generic/rwonce.h:61:9: note: in expansion of macro '__WRITE_ONCE'
>       61 |         __WRITE_ONCE(x, val);                                           \
>          |         ^~~~~~~~~~~~
>    include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
>     1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
>          |         ^~~~~~~~~~
>    In function 'xs_tcp_setup_socket':
>    cc1: note: source object is likely at address zero
>    In function 'ip6_sock_set_addr_preferences',
>        inlined from 'xs_tcp_tls_finish_connecting' at net/sunrpc/xprtsock.c:2478:4:
> >> include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
>       44 | #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
>          |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
>       55 |         *(volatile typeof(x) *)&(x) = (val);                            \
>          |                                        ^~~
>    include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
>     1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
>          |         ^~~~~~~~~~
>    include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
>       50 |         __READ_ONCE(x);                                                 \
>          |         ^~~~~~~~~~~
>    include/net/ipv6.h:1366:21: note: in expansion of macro 'READ_ONCE'
>     1366 |                    (READ_ONCE(inet6_sk(sk)->srcprefs) & prefmask) | pref);
>          |                     ^~~~~~~~~
>    In function 'xs_tcp_tls_finish_connecting':
>    cc1: note: source object is likely at address zero
>    In function 'ip6_sock_set_addr_preferences',
>        inlined from 'xs_tcp_tls_finish_connecting' at net/sunrpc/xprtsock.c:2478:4:
>    include/asm-generic/rwonce.h:55:37: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} [-Warray-bounds=]
>       55 |         *(volatile typeof(x) *)&(x) = (val);                            \
>          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
>    include/asm-generic/rwonce.h:61:9: note: in expansion of macro '__WRITE_ONCE'
>       61 |         __WRITE_ONCE(x, val);                                           \
>          |         ^~~~~~~~~~~~
>    include/net/ipv6.h:1365:9: note: in expansion of macro 'WRITE_ONCE'
>     1365 |         WRITE_ONCE(inet6_sk(sk)->srcprefs,
>          |         ^~~~~~~~~~
>    In function 'xs_tcp_tls_finish_connecting':
>    cc1: note: source object is likely at address zero
>
>
> vim +44 include/asm-generic/rwonce.h
>
> e506ea451254ab Will Deacon 2019-10-15  28
> e506ea451254ab Will Deacon 2019-10-15  29  /*
> e506ea451254ab Will Deacon 2019-10-15  30   * Yes, this permits 64-bit accesses on 32-bit architectures. These will
> e506ea451254ab Will Deacon 2019-10-15  31   * actually be atomic in some cases (namely Armv7 + LPAE), but for others we
> e506ea451254ab Will Deacon 2019-10-15  32   * rely on the access being split into 2x32-bit accesses for a 32-bit quantity
> e506ea451254ab Will Deacon 2019-10-15  33   * (e.g. a virtual address) and a strong prevailing wind.
> e506ea451254ab Will Deacon 2019-10-15  34   */
> e506ea451254ab Will Deacon 2019-10-15  35  #define compiletime_assert_rwonce_type(t)                                    \
> e506ea451254ab Will Deacon 2019-10-15  36       compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
> e506ea451254ab Will Deacon 2019-10-15  37               "Unsupported access size for {READ,WRITE}_ONCE().")
> e506ea451254ab Will Deacon 2019-10-15  38
> e506ea451254ab Will Deacon 2019-10-15  39  /*
> e506ea451254ab Will Deacon 2019-10-15  40   * Use __READ_ONCE() instead of READ_ONCE() if you do not require any
> 3c9184109e78ea Will Deacon 2019-10-30  41   * atomicity. Note that this may result in tears!
> e506ea451254ab Will Deacon 2019-10-15  42   */
> b78b331a3f5c07 Will Deacon 2019-10-15  43  #ifndef __READ_ONCE
> e506ea451254ab Will Deacon 2019-10-15 @44  #define __READ_ONCE(x)       (*(const volatile __unqual_scalar_typeof(x) *)&(x))
> b78b331a3f5c07 Will Deacon 2019-10-15  45  #endif
> e506ea451254ab Will Deacon 2019-10-15  46
>
> :::::: The code at line 44 was first introduced by commit
> :::::: e506ea451254ab17e0bf918ca36232fec2a9b10c compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h
>
> :::::: TO: Will Deacon <will@kernel.org>
> :::::: CC: Will Deacon <will@kernel.org>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki


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

end of thread, other threads:[~2023-10-18 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18 10:59 [linux-next:master 5136/13299] include/asm-generic/rwonce.h:44:26: warning: array subscript 0 is outside array bounds of '__u8[0]' {aka 'unsigned char[]'} kernel test robot
2023-10-18 11:38 ` Eric Dumazet

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