Re: [PATCH v5 13/13] SIW addition to kernel build environment

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

 



Hi Bernard,

I love your patch! Yet something to improve:

[auto build test ERROR on rdma/for-next]
[also build test ERROR on next-20190221]
[cannot apply to v5.0-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Bernard-Metzler/SIW-Request-for-Comments/20190221-220427
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=m68k 

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

   In file included from include/asm-generic/percpu.h:7,
                    from ./arch/m68k/include/generated/asm/percpu.h:1,
                    from include/linux/percpu.h:13,
                    from include/linux/netdevice.h:36,
                    from drivers/infiniband/sw/siw/siw_main.c:42:
   include/linux/percpu-defs.h:91:33: warning: '__pcpu_unique_use_cnt' initialized and declared 'extern'
     extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;  \
                                    ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
     DEFINE_PER_CPU_SECTION(type, name, "")
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:92:26: error: redefinition of '__pcpu_unique_use_cnt'
     __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;   \
                             ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
     DEFINE_PER_CPU_SECTION(type, name, "")
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:91:33: note: previous definition of '__pcpu_unique_use_cnt' was here
     extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;  \
                                    ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
     DEFINE_PER_CPU_SECTION(type, name, "")
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:249:33: warning: 'use_cnt' initialized and declared 'extern'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
                                    ^~~~~~~
   include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
     extern __PCPU_ATTRS(sec) __typeof__(type) name;   \
                                               ^~~~
   drivers/infiniband/sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
>> drivers/infiniband/sw/siw/siw_main.c:249:33: error: redefinition of 'use_cnt'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
                                    ^~~~~~~
   include/linux/percpu-defs.h:94:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
     __PCPU_ATTRS(sec) __weak __typeof__(type) name
                                               ^~~~
   drivers/infiniband/sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:249:33: note: previous definition of 'use_cnt' was here
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
                                    ^~~~~~~
   include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
     extern __PCPU_ATTRS(sec) __typeof__(type) name;   \
                                               ^~~~
   drivers/infiniband/sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
>> drivers/infiniband/sw/siw/siw_main.c:416:3: error: 'const struct ib_device_ops' has no member named 'dealloc_driver'; did you mean 'dealloc_fmr'?
     .dealloc_driver = siw_device_cleanup,
      ^~~~~~~~~~~~~~
      dealloc_fmr
>> drivers/infiniband/sw/siw/siw_main.c:416:20: error: initialization of 'void (*)(struct ib_qp *)' from incompatible pointer type 'void (*)(struct ib_device *)' [-Werror=incompatible-pointer-types]
     .dealloc_driver = siw_device_cleanup,
                       ^~~~~~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:416:20: note: (near initialization for 'siw_device_ops.drain_sq')
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_device_create':
>> drivers/infiniband/sw/siw/siw_main.c:514:7: error: implicit declaration of function 'ib_device_set_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     rv = ib_device_set_netdev(base_dev, netdev, 1);
          ^~~~~~~~~~~~~~~~~~~~
          ib_device_try_get
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_netdev_event':
>> drivers/infiniband/sw/siw/siw_main.c:615:13: error: implicit declaration of function 'ib_device_get_by_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
                ^~~~~~~~~~~~~~~~~~~~~~~
                ib_device_try_get
>> drivers/infiniband/sw/siw/siw_main.c:615:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
>> drivers/infiniband/sw/siw/siw_main.c:647:3: error: implicit declaration of function 'ib_unregister_device_queued'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration]
      ib_unregister_device_queued(&sdev->base_dev);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ib_unregister_device
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_newlink':
   drivers/infiniband/sw/siw/siw_main.c:679:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
   drivers/infiniband/sw/siw/siw_main.c: At top level:
>> drivers/infiniband/sw/siw/siw_main.c:711:15: error: variable 'siw_link_ops' has initializer but incomplete type
    static struct rdma_link_ops siw_link_ops = {
                  ^~~~~~~~~~~~~
>> drivers/infiniband/sw/siw/siw_main.c:712:3: error: 'struct rdma_link_ops' has no member named 'type'
     .type = "siw",
      ^~~~
   drivers/infiniband/sw/siw/siw_main.c:712:10: warning: excess elements in struct initializer
     .type = "siw",
             ^~~~~
   drivers/infiniband/sw/siw/siw_main.c:712:10: note: (near initialization for 'siw_link_ops')
>> drivers/infiniband/sw/siw/siw_main.c:713:3: error: 'struct rdma_link_ops' has no member named 'newlink'
     .newlink = siw_newlink,
      ^~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:713:13: warning: excess elements in struct initializer
     .newlink = siw_newlink,
                ^~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:713:13: note: (near initialization for 'siw_link_ops')
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_init_module':
>> drivers/infiniband/sw/siw/siw_main.c:763:2: error: implicit declaration of function 'rdma_link_register'; did you mean 'rdma_nl_register'? [-Werror=implicit-function-declaration]
     rdma_link_register(&siw_link_ops);
     ^~~~~~~~~~~~~~~~~~
     rdma_nl_register
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_exit_module':
>> drivers/infiniband/sw/siw/siw_main.c:797:2: error: implicit declaration of function 'rdma_link_unregister'; did you mean 'rdma_nl_unregister'? [-Werror=implicit-function-declaration]
     rdma_link_unregister(&siw_link_ops);
     ^~~~~~~~~~~~~~~~~~~~
     rdma_nl_unregister
>> drivers/infiniband/sw/siw/siw_main.c:798:2: error: implicit declaration of function 'ib_unregister_driver'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration]
     ib_unregister_driver(RDMA_DRIVER_SIW);
     ^~~~~~~~~~~~~~~~~~~~
     ib_unregister_device
   drivers/infiniband/sw/siw/siw_main.c: At top level:
>> drivers/infiniband/sw/siw/siw_main.c:813:24: error: expected declaration specifiers or '...' before string constant
    MODULE_ALIAS_RDMA_LINK("siw");
                           ^~~~~
>> drivers/infiniband/sw/siw/siw_main.c:711:29: error: storage size of 'siw_link_ops' isn't known
    static struct rdma_link_ops siw_link_ops = {
                                ^~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_query_device':
>> drivers/infiniband/sw/siw/siw_verbs.c:238:8: error: 'IB_DEVICE_ALLOW_USER_UNREG' undeclared (first use in this function); did you mean 'IB_DEVICE_SG_GAPS_REG'?
         | IB_DEVICE_ALLOW_USER_UNREG;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
           IB_DEVICE_SG_GAPS_REG
   drivers/infiniband/sw/siw/siw_verbs.c:238:8: note: each undeclared identifier is reported only once for each function it appears in
   drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_copy_inline_sgl':
   drivers/infiniband/sw/siw/siw_verbs.c:767:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     sqe->sge[0].laddr = (u64)kbuf;
                         ^
   drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_post_send':
   drivers/infiniband/sw/siw/siw_verbs.c:935:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       sqe->base_mr = (uint64_t)reg_wr(wr)->mr;
                      ^
   In file included from include/linux/printk.h:331,
                    from include/linux/kernel.h:14,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from include/linux/uaccess.h:5,
                    from drivers/infiniband/sw/siw/siw_verbs.c:42:
   drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_map_mr_sg':
   drivers/infiniband/sw/siw/siw_verbs.c:1550:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       OBJ_ID(&mr->mem), i, pble->size, (void *)pble->addr,
                                        ^
   include/linux/dynamic_debug.h:136:9: note: in definition of macro 'dynamic_dev_dbg'
          ##__VA_ARGS__);  \
            ^~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_debug.h:47:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(&(ddev)->base_dev.dev, "cpu%2d %s: " fmt, smp_processor_id(),\
     ^~~~~~~
   drivers/infiniband/sw/siw/siw_verbs.c:1548:3: note: in expansion of macro 'siw_dbg'
      siw_dbg(mr->mem.hdr.sdev,
      ^~~~~~~
--
   In file included from include/asm-generic/percpu.h:7,
                    from ./arch/m68k/include/generated/asm/percpu.h:1,
                    from include/linux/percpu.h:13,
                    from include/linux/netdevice.h:36,
                    from drivers/infiniband//sw/siw/siw_main.c:42:
   include/linux/percpu-defs.h:91:33: warning: '__pcpu_unique_use_cnt' initialized and declared 'extern'
     extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;  \
                                    ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
     DEFINE_PER_CPU_SECTION(type, name, "")
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:92:26: error: redefinition of '__pcpu_unique_use_cnt'
     __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;   \
                             ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
     DEFINE_PER_CPU_SECTION(type, name, "")
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:91:33: note: previous definition of '__pcpu_unique_use_cnt' was here
     extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;  \
                                    ^~~~~~~~~~~~~~
   include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
     DEFINE_PER_CPU_SECTION(type, name, "")
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:249:33: warning: 'use_cnt' initialized and declared 'extern'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
                                    ^~~~~~~
   include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
     extern __PCPU_ATTRS(sec) __typeof__(type) name;   \
                                               ^~~~
   drivers/infiniband//sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:249:33: error: redefinition of 'use_cnt'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
                                    ^~~~~~~
   include/linux/percpu-defs.h:94:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
     __PCPU_ATTRS(sec) __weak __typeof__(type) name
                                               ^~~~
   drivers/infiniband//sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:249:33: note: previous definition of 'use_cnt' was here
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
                                    ^~~~~~~
   include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
     extern __PCPU_ATTRS(sec) __typeof__(type) name;   \
                                               ^~~~
   drivers/infiniband//sw/siw/siw_main.c:249:8: note: in expansion of macro 'DEFINE_PER_CPU'
    static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
           ^~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:416:3: error: 'const struct ib_device_ops' has no member named 'dealloc_driver'; did you mean 'dealloc_fmr'?
     .dealloc_driver = siw_device_cleanup,
      ^~~~~~~~~~~~~~
      dealloc_fmr
   drivers/infiniband//sw/siw/siw_main.c:416:20: error: initialization of 'void (*)(struct ib_qp *)' from incompatible pointer type 'void (*)(struct ib_device *)' [-Werror=incompatible-pointer-types]
     .dealloc_driver = siw_device_cleanup,
                       ^~~~~~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:416:20: note: (near initialization for 'siw_device_ops.drain_sq')
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_device_create':
   drivers/infiniband//sw/siw/siw_main.c:514:7: error: implicit declaration of function 'ib_device_set_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     rv = ib_device_set_netdev(base_dev, netdev, 1);
          ^~~~~~~~~~~~~~~~~~~~
          ib_device_try_get
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_netdev_event':
   drivers/infiniband//sw/siw/siw_main.c:615:13: error: implicit declaration of function 'ib_device_get_by_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
                ^~~~~~~~~~~~~~~~~~~~~~~
                ib_device_try_get
   drivers/infiniband//sw/siw/siw_main.c:615:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
   drivers/infiniband//sw/siw/siw_main.c:647:3: error: implicit declaration of function 'ib_unregister_device_queued'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration]
      ib_unregister_device_queued(&sdev->base_dev);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ib_unregister_device
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_newlink':
   drivers/infiniband//sw/siw/siw_main.c:679:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
   drivers/infiniband//sw/siw/siw_main.c: At top level:
   drivers/infiniband//sw/siw/siw_main.c:711:15: error: variable 'siw_link_ops' has initializer but incomplete type
    static struct rdma_link_ops siw_link_ops = {
                  ^~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:712:3: error: 'struct rdma_link_ops' has no member named 'type'
     .type = "siw",
      ^~~~
   drivers/infiniband//sw/siw/siw_main.c:712:10: warning: excess elements in struct initializer
     .type = "siw",
             ^~~~~
   drivers/infiniband//sw/siw/siw_main.c:712:10: note: (near initialization for 'siw_link_ops')
   drivers/infiniband//sw/siw/siw_main.c:713:3: error: 'struct rdma_link_ops' has no member named 'newlink'
     .newlink = siw_newlink,
      ^~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:713:13: warning: excess elements in struct initializer
     .newlink = siw_newlink,
                ^~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:713:13: note: (near initialization for 'siw_link_ops')
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_init_module':
   drivers/infiniband//sw/siw/siw_main.c:763:2: error: implicit declaration of function 'rdma_link_register'; did you mean 'rdma_nl_register'? [-Werror=implicit-function-declaration]
     rdma_link_register(&siw_link_ops);
     ^~~~~~~~~~~~~~~~~~
     rdma_nl_register
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_exit_module':
   drivers/infiniband//sw/siw/siw_main.c:797:2: error: implicit declaration of function 'rdma_link_unregister'; did you mean 'rdma_nl_unregister'? [-Werror=implicit-function-declaration]
     rdma_link_unregister(&siw_link_ops);
     ^~~~~~~~~~~~~~~~~~~~

vim +/__pcpu_unique_use_cnt +92 include/linux/percpu-defs.h

62fde541 Tejun Heo          2014-06-17   37  
5028eaa9 David Howells      2009-04-21   38  /*
5028eaa9 David Howells      2009-04-21   39   * Base implementations of per-CPU variable declarations and definitions, where
5028eaa9 David Howells      2009-04-21   40   * the section in which the variable is to be placed is provided by the
7c756e6e Tejun Heo          2009-06-24   41   * 'sec' argument.  This may be used to affect the parameters governing the
5028eaa9 David Howells      2009-04-21   42   * variable's storage.
5028eaa9 David Howells      2009-04-21   43   *
5028eaa9 David Howells      2009-04-21   44   * NOTE!  The sections for the DECLARE and for the DEFINE must match, lest
5028eaa9 David Howells      2009-04-21   45   * linkage errors occur due the compiler generating the wrong code to access
5028eaa9 David Howells      2009-04-21   46   * that section.
5028eaa9 David Howells      2009-04-21   47   */
7c756e6e Tejun Heo          2009-06-24   48  #define __PCPU_ATTRS(sec)						\
e0fdb0e0 Rusty Russell      2009-10-29   49  	__percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))	\
7c756e6e Tejun Heo          2009-06-24   50  	PER_CPU_ATTRIBUTES
7c756e6e Tejun Heo          2009-06-24   51  
7c756e6e Tejun Heo          2009-06-24   52  #define __PCPU_DUMMY_ATTRS						\
7c756e6e Tejun Heo          2009-06-24   53  	__attribute__((section(".discard"), unused))
7c756e6e Tejun Heo          2009-06-24   54  
7c756e6e Tejun Heo          2009-06-24   55  /*
7c756e6e Tejun Heo          2009-06-24   56   * s390 and alpha modules require percpu variables to be defined as
7c756e6e Tejun Heo          2009-06-24   57   * weak to force the compiler to generate GOT based external
7c756e6e Tejun Heo          2009-06-24   58   * references for them.  This is necessary because percpu sections
7c756e6e Tejun Heo          2009-06-24   59   * will be located outside of the usually addressable area.
7c756e6e Tejun Heo          2009-06-24   60   *
7c756e6e Tejun Heo          2009-06-24   61   * This definition puts the following two extra restrictions when
7c756e6e Tejun Heo          2009-06-24   62   * defining percpu variables.
7c756e6e Tejun Heo          2009-06-24   63   *
7c756e6e Tejun Heo          2009-06-24   64   * 1. The symbol must be globally unique, even the static ones.
7c756e6e Tejun Heo          2009-06-24   65   * 2. Static percpu variables cannot be defined inside a function.
7c756e6e Tejun Heo          2009-06-24   66   *
7c756e6e Tejun Heo          2009-06-24   67   * Archs which need weak percpu definitions should define
7c756e6e Tejun Heo          2009-06-24   68   * ARCH_NEEDS_WEAK_PER_CPU in asm/percpu.h when necessary.
7c756e6e Tejun Heo          2009-06-24   69   *
7c756e6e Tejun Heo          2009-06-24   70   * To ensure that the generic code observes the above two
7c756e6e Tejun Heo          2009-06-24   71   * restrictions, if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is set weak
7c756e6e Tejun Heo          2009-06-24   72   * definition is used for all cases.
7c756e6e Tejun Heo          2009-06-24   73   */
7c756e6e Tejun Heo          2009-06-24   74  #if defined(ARCH_NEEDS_WEAK_PER_CPU) || defined(CONFIG_DEBUG_FORCE_WEAK_PER_CPU)
7c756e6e Tejun Heo          2009-06-24   75  /*
7c756e6e Tejun Heo          2009-06-24   76   * __pcpu_scope_* dummy variable is used to enforce scope.  It
7c756e6e Tejun Heo          2009-06-24   77   * receives the static modifier when it's used in front of
7c756e6e Tejun Heo          2009-06-24   78   * DEFINE_PER_CPU() and will trigger build failure if
7c756e6e Tejun Heo          2009-06-24   79   * DECLARE_PER_CPU() is used for the same variable.
7c756e6e Tejun Heo          2009-06-24   80   *
7c756e6e Tejun Heo          2009-06-24   81   * __pcpu_unique_* dummy variable is used to enforce symbol uniqueness
7c756e6e Tejun Heo          2009-06-24   82   * such that hidden weak symbol collision, which will cause unrelated
7c756e6e Tejun Heo          2009-06-24   83   * variables to share the same address, can be detected during build.
7c756e6e Tejun Heo          2009-06-24   84   */
7c756e6e Tejun Heo          2009-06-24   85  #define DECLARE_PER_CPU_SECTION(type, name, sec)			\
7c756e6e Tejun Heo          2009-06-24   86  	extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name;		\
dd17c8f7 Rusty Russell      2009-10-29   87  	extern __PCPU_ATTRS(sec) __typeof__(type) name
7c756e6e Tejun Heo          2009-06-24   88  
7c756e6e Tejun Heo          2009-06-24   89  #define DEFINE_PER_CPU_SECTION(type, name, sec)				\
7c756e6e Tejun Heo          2009-06-24   90  	__PCPU_DUMMY_ATTRS char __pcpu_scope_##name;			\
0f5e4816 Tejun Heo          2009-10-29  @91  	extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;		\
7c756e6e Tejun Heo          2009-06-24  @92  	__PCPU_DUMMY_ATTRS char __pcpu_unique_##name;			\
b1a0fbfd Tejun Heo          2013-12-04   93  	extern __PCPU_ATTRS(sec) __typeof__(type) name;			\
69a60bc7 Alexander Pateenok 2018-10-30   94  	__PCPU_ATTRS(sec) __weak __typeof__(type) name
7c756e6e Tejun Heo          2009-06-24   95  #else
7c756e6e Tejun Heo          2009-06-24   96  /*
7c756e6e Tejun Heo          2009-06-24   97   * Normal declaration and definition macros.
7c756e6e Tejun Heo          2009-06-24   98   */
7c756e6e Tejun Heo          2009-06-24   99  #define DECLARE_PER_CPU_SECTION(type, name, sec)			\
dd17c8f7 Rusty Russell      2009-10-29  100  	extern __PCPU_ATTRS(sec) __typeof__(type) name
7c756e6e Tejun Heo          2009-06-24  101  

:::::: The code at line 92 was first introduced by commit
:::::: 7c756e6e19e71f0327760d8955f7077118ebb2b1 percpu: implement optional weak percpu definitions

:::::: TO: Tejun Heo <tj@xxxxxxxxxx>
:::::: CC: Tejun Heo <tj@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux