[xlnx:release-2020.2.2_k26 9559/10480] drivers/fpga/fpga-mgr.c:828:2: error: implicit declaration of function 'set_dma_ops'
by kernel test robot
Hi Nava,
FYI, the error/warning still remains.
tree: https://github.com/Xilinx/linux-xlnx release-2020.2.2_k26
head: 4731ff5042ce76fc145bc2797faa2d91b090675e
commit: ed71785e2c3c3495e89c7b6c3a38699b59bf83d8 [9559/10480] fpga: support loading from a pre-allocated buffer
config: um-randconfig-r002-20210419 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/Xilinx/linux-xlnx/commit/ed71785e2c3c3495e89c7b6c3a386...
git remote add xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xlnx release-2020.2.2_k26
git checkout ed71785e2c3c3495e89c7b6c3a38699b59bf83d8
# save the attached .config to linux build tree
make W=1 W=1 ARCH=um
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
In file included from include/linux/file.h:9,
from include/linux/dma-buf.h:16,
from drivers/fpga/fpga-mgr.c:11:
include/asm-generic/fixmap.h: In function 'fix_to_virt':
include/asm-generic/fixmap.h:32:19: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
32 | BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
| ^~
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
330 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/asm-generic/fixmap.h:32:2: note: in expansion of macro 'BUILD_BUG_ON'
32 | BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
| ^~~~~~~~~~~~
drivers/fpga/fpga-mgr.c: In function 'fpga_mgr_create':
>> drivers/fpga/fpga-mgr.c:828:2: error: implicit declaration of function 'set_dma_ops' [-Werror=implicit-function-declaration]
828 | set_dma_ops(&mgr->dev, get_dma_ops(dev));
| ^~~~~~~~~~~
>> drivers/fpga/fpga-mgr.c:828:25: error: implicit declaration of function 'get_dma_ops'; did you mean 'get_dma_buf'? [-Werror=implicit-function-declaration]
828 | set_dma_ops(&mgr->dev, get_dma_ops(dev));
| ^~~~~~~~~~~
| get_dma_buf
cc1: some warnings being treated as errors
vim +/set_dma_ops +828 drivers/fpga/fpga-mgr.c
773
774 /**
775 * fpga_mgr_create - create and initialize a FPGA manager struct
776 * @dev: fpga manager device from pdev
777 * @name: fpga manager name
778 * @mops: pointer to structure of fpga manager ops
779 * @priv: fpga manager private data
780 *
781 * The caller of this function is responsible for freeing the struct with
782 * fpga_mgr_free(). Using devm_fpga_mgr_create() instead is recommended.
783 *
784 * Return: pointer to struct fpga_manager or NULL
785 */
786 struct fpga_manager *fpga_mgr_create(struct device *dev, const char *name,
787 const struct fpga_manager_ops *mops,
788 void *priv)
789 {
790 struct fpga_manager *mgr;
791 int id, ret;
792
793 if (!mops || !mops->write_complete || !mops->state ||
794 !mops->write_init || (!mops->write && !mops->write_sg)) {
795 dev_err(dev, "Attempt to register without fpga_manager_ops\n");
796 return NULL;
797 }
798
799 if (!name || !strlen(name)) {
800 dev_err(dev, "Attempt to register with no name!\n");
801 return NULL;
802 }
803
804 mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
805 if (!mgr)
806 return NULL;
807
808 id = ida_simple_get(&fpga_mgr_ida, 0, 0, GFP_KERNEL);
809 if (id < 0) {
810 ret = id;
811 goto error_kfree;
812 }
813
814 mutex_init(&mgr->ref_mutex);
815
816 mgr->name = name;
817 mgr->mops = mops;
818 mgr->priv = priv;
819
820 device_initialize(&mgr->dev);
821 mgr->dev.class = fpga_mgr_class;
822 mgr->dev.groups = mops->groups;
823 mgr->dev.parent = dev;
824 mgr->dev.of_node = dev->of_node;
825 mgr->dev.id = id;
826
827 /* Make device dma capable by inheriting from parent's */
> 828 set_dma_ops(&mgr->dev, get_dma_ops(dev));
829 ret = dma_coerce_mask_and_coherent(&mgr->dev, dma_get_mask(dev));
830 if (ret) {
831 dev_warn(dev,
832 "Failed to set DMA mask %llx. Trying to continue... %x\n",
833 dma_get_mask(dev), ret);
834 }
835
836 ret = dev_set_name(&mgr->dev, "fpga%d", id);
837 if (ret)
838 goto error_device;
839
840 mgr->miscdev.minor = MISC_DYNAMIC_MINOR;
841 mgr->miscdev.name = kobject_name(&mgr->dev.kobj);
842 mgr->miscdev.fops = &fpga_fops;
843 ret = misc_register(&mgr->miscdev);
844 if (ret) {
845 pr_err("fpga: failed to register misc device.\n");
846 goto error_device;
847 }
848
849 return mgr;
850
851 error_device:
852 ida_simple_remove(&fpga_mgr_ida, id);
853 error_kfree:
854 kfree(mgr);
855
856 return NULL;
857 }
858 EXPORT_SYMBOL_GPL(fpga_mgr_create);
859
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove function
by kernel test robot
Hi "Fabio,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/0day-ci/linux/commits/Fabio-M-De-Francesco/staging-rtl...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 1b9e18de8d43bf798622cc365f99b41f180b446f
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/499674dec8e01774889806d098bf9a127...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Fabio-M-De-Francesco/staging-rtl8192u-Remove-function/20210412-024938
git checkout 499674dec8e01774889806d098bf9a12731930ee
# save the attached .config to linux build tree
make W=1 W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/staging/rtl8192u/r819xU_cmdpkt.c: In function 'cmpk_message_handle_rx':
>> drivers/staging/rtl8192u/r819xU_cmdpkt.c:477:4: error: implicit declaration of function 'cmpk_handle_query_config_rx' [-Werror=implicit-function-declaration]
477 | cmpk_handle_query_config_rx(dev, pcmd_buff);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/cmpk_handle_query_config_rx +477 drivers/staging/rtl8192u/r819xU_cmdpkt.c
8fc8598e61f6f3 Jerry Chuang 2009-11-03 409
8fc8598e61f6f3 Jerry Chuang 2009-11-03 410 /*-----------------------------------------------------------------------------
8fc8598e61f6f3 Jerry Chuang 2009-11-03 411 * Function: cmpk_message_handle_rx()
8fc8598e61f6f3 Jerry Chuang 2009-11-03 412 *
8fc8598e61f6f3 Jerry Chuang 2009-11-03 413 * Overview: In the function, we will capture different RX command packet
8fc8598e61f6f3 Jerry Chuang 2009-11-03 414 * info. Every RX command packet element has different message
8fc8598e61f6f3 Jerry Chuang 2009-11-03 415 * length and meaning in content. We only support three type of RX
8fc8598e61f6f3 Jerry Chuang 2009-11-03 416 * command packet now. Please refer to document
8fc8598e61f6f3 Jerry Chuang 2009-11-03 417 * ws-06-0063-rtl8190-command-packet-specification.
8fc8598e61f6f3 Jerry Chuang 2009-11-03 418 *
8fc8598e61f6f3 Jerry Chuang 2009-11-03 419 * Input: NONE
8fc8598e61f6f3 Jerry Chuang 2009-11-03 420 *
8fc8598e61f6f3 Jerry Chuang 2009-11-03 421 * Output: NONE
8fc8598e61f6f3 Jerry Chuang 2009-11-03 422 *
8fc8598e61f6f3 Jerry Chuang 2009-11-03 423 * Return: NONE
8fc8598e61f6f3 Jerry Chuang 2009-11-03 424 *
8fc8598e61f6f3 Jerry Chuang 2009-11-03 425 * Revised History:
8fc8598e61f6f3 Jerry Chuang 2009-11-03 426 * When Who Remark
8fc8598e61f6f3 Jerry Chuang 2009-11-03 427 * 05/06/2008 amy Create Version 0 porting from windows code.
8fc8598e61f6f3 Jerry Chuang 2009-11-03 428 *
70cd55d6755ee8 Derek Robson 2017-02-16 429 *---------------------------------------------------------------------------
70cd55d6755ee8 Derek Robson 2017-02-16 430 */
a115ee4175c3eb Teodora Baluta 2013-10-16 431 u32 cmpk_message_handle_rx(struct net_device *dev,
8fc8598e61f6f3 Jerry Chuang 2009-11-03 432 struct ieee80211_rx_stats *pstats)
8fc8598e61f6f3 Jerry Chuang 2009-11-03 433 {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 434 int total_length;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 435 u8 cmd_length, exe_cnt = 0;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 436 u8 element_id;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 437 u8 *pcmd_buff;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 438
dc109dc597d7f4 simran singhal 2017-03-04 439 /* 0. Check inpt arguments. It is a command queue message or
70cd55d6755ee8 Derek Robson 2017-02-16 440 * pointer is null.
70cd55d6755ee8 Derek Robson 2017-02-16 441 */
d6628e8cbe2047 Michael Straube 2020-09-19 442 if (!pstats)
8fc8598e61f6f3 Jerry Chuang 2009-11-03 443 return 0; /* This is not a command packet. */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 444
8fc8598e61f6f3 Jerry Chuang 2009-11-03 445 /* 1. Read received command packet message length from RFD. */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 446 total_length = pstats->Length;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 447
8fc8598e61f6f3 Jerry Chuang 2009-11-03 448 /* 2. Read virtual address from RFD. */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 449 pcmd_buff = pstats->virtual_address;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 450
589b3d06fd1597 Justin P. Mattock 2012-04-30 451 /* 3. Read command packet element id and length. */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 452 element_id = pcmd_buff[0];
8fc8598e61f6f3 Jerry Chuang 2009-11-03 453
589b3d06fd1597 Justin P. Mattock 2012-04-30 454 /* 4. Check every received command packet content according to different
70cd55d6755ee8 Derek Robson 2017-02-16 455 * element type. Because FW may aggregate RX command packet to
70cd55d6755ee8 Derek Robson 2017-02-16 456 * minimize transmit time between DRV and FW.
70cd55d6755ee8 Derek Robson 2017-02-16 457 */
6df9f669de3da5 Xenia Ragiadakou 2013-06-26 458 /* Add a counter to prevent the lock in the loop from being held too
70cd55d6755ee8 Derek Robson 2017-02-16 459 * long
70cd55d6755ee8 Derek Robson 2017-02-16 460 */
05cdf47ac3374f Xenia Ragiadakou 2013-06-26 461 while (total_length > 0 && exe_cnt++ < 100) {
6df9f669de3da5 Xenia Ragiadakou 2013-06-26 462 /* We support aggregation of different cmd in the same packet */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 463 element_id = pcmd_buff[0];
8fc8598e61f6f3 Jerry Chuang 2009-11-03 464
05cdf47ac3374f Xenia Ragiadakou 2013-06-26 465 switch (element_id) {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 466 case RX_TX_FEEDBACK:
8fc8598e61f6f3 Jerry Chuang 2009-11-03 467 cmpk_handle_tx_feedback(dev, pcmd_buff);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 468 cmd_length = CMPK_RX_TX_FB_SIZE;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 469 break;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 470
8fc8598e61f6f3 Jerry Chuang 2009-11-03 471 case RX_INTERRUPT_STATUS:
8fc8598e61f6f3 Jerry Chuang 2009-11-03 472 cmpk_handle_interrupt_status(dev, pcmd_buff);
17a16b769466e2 John Whitmore 2018-07-29 473 cmd_length = sizeof(struct cmd_pkt_interrupt_status);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 474 break;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 475
8fc8598e61f6f3 Jerry Chuang 2009-11-03 476 case BOTH_QUERY_CONFIG:
8fc8598e61f6f3 Jerry Chuang 2009-11-03 @477 cmpk_handle_query_config_rx(dev, pcmd_buff);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[kvm:queue 153/154] arch/x86/kvm/mmu/mmu.c:5443:39: error: 'struct kvm_arch' has no member named 'tdp_mmu_roots'
by kernel test robot
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head: 3afb84581509b8d28979d15b5d727366efb3c8e5
commit: 1336c692abad5a737dd6d18b30fae2e2183f73f7 [153/154] KVM: x86/mmu: Fast invalidation for TDP MMU
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=1336c692abad5a...
git remote add kvm https://git.kernel.org/pub/scm/virt/kvm/kvm.git
git fetch --no-tags kvm queue
git checkout 1336c692abad5a737dd6d18b30fae2e2183f73f7
# save the attached .config to linux build tree
make W=1 W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/cpumask.h:10,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from arch/x86/kvm/irq.h:13,
from arch/x86/kvm/mmu/mmu.c:18:
arch/x86/kvm/mmu/mmu.c: In function 'kvm_mmu_zap_all_fast':
>> arch/x86/kvm/mmu/mmu.c:5443:39: error: 'struct kvm_arch' has no member named 'tdp_mmu_roots'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^
include/linux/kernel.h:708:26: note: in definition of macro 'container_of'
708 | void *__mptr = (void *)(ptr); \
| ^~~
include/linux/list.h:522:2: note: in expansion of macro 'list_entry'
522 | list_entry((ptr)->next, type, member)
| ^~~~~~~~~~
include/linux/list.h:628:13: note: in expansion of macro 'list_first_entry'
628 | for (pos = list_first_entry(head, typeof(*pos), member); \
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/mmu/mmu.c:5443:3: note: in expansion of macro 'list_for_each_entry'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
>> arch/x86/kvm/mmu/mmu.c:5443:39: error: 'struct kvm_arch' has no member named 'tdp_mmu_roots'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^
include/linux/compiler_types.h:300:9: note: in definition of macro '__compiletime_assert'
300 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:320:2: note: in expansion of macro '_compiletime_assert'
320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:709:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
709 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~~~~~~~~~~~~~~~
include/linux/kernel.h:709:20: note: in expansion of macro '__same_type'
709 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~~~~~~~~~~
include/linux/list.h:511:2: note: in expansion of macro 'container_of'
511 | container_of(ptr, type, member)
| ^~~~~~~~~~~~
include/linux/list.h:522:2: note: in expansion of macro 'list_entry'
522 | list_entry((ptr)->next, type, member)
| ^~~~~~~~~~
include/linux/list.h:628:13: note: in expansion of macro 'list_first_entry'
628 | for (pos = list_first_entry(head, typeof(*pos), member); \
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/mmu/mmu.c:5443:3: note: in expansion of macro 'list_for_each_entry'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^~~~~~~~~~~~~~~~~~~
>> arch/x86/kvm/mmu/mmu.c:5443:39: error: 'struct kvm_arch' has no member named 'tdp_mmu_roots'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^
include/linux/compiler_types.h:300:9: note: in definition of macro '__compiletime_assert'
300 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:320:2: note: in expansion of macro '_compiletime_assert'
320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:709:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
709 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~~~~~~~~~~~~~~~
include/linux/kernel.h:710:6: note: in expansion of macro '__same_type'
710 | !__same_type(*(ptr), void), \
| ^~~~~~~~~~~
include/linux/list.h:511:2: note: in expansion of macro 'container_of'
511 | container_of(ptr, type, member)
| ^~~~~~~~~~~~
include/linux/list.h:522:2: note: in expansion of macro 'list_entry'
522 | list_entry((ptr)->next, type, member)
| ^~~~~~~~~~
include/linux/list.h:628:13: note: in expansion of macro 'list_first_entry'
628 | for (pos = list_first_entry(head, typeof(*pos), member); \
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/mmu/mmu.c:5443:3: note: in expansion of macro 'list_for_each_entry'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^~~~~~~~~~~~~~~~~~~
In file included from include/linux/mm_types.h:8,
from arch/x86/kvm/irq.h:13,
from arch/x86/kvm/mmu/mmu.c:18:
>> arch/x86/kvm/mmu/mmu.c:5443:39: error: 'struct kvm_arch' has no member named 'tdp_mmu_roots'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^
include/linux/list.h:619:20: note: in definition of macro 'list_entry_is_head'
619 | (&pos->member == (head))
| ^~~~
arch/x86/kvm/mmu/mmu.c:5443:3: note: in expansion of macro 'list_for_each_entry'
5443 | list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
| ^~~~~~~~~~~~~~~~~~~
vim +5443 arch/x86/kvm/mmu/mmu.c
5398
5399 /*
5400 * Fast invalidate all shadow pages and use lock-break technique
5401 * to zap obsolete pages.
5402 *
5403 * It's required when memslot is being deleted or VM is being
5404 * destroyed, in these cases, we should ensure that KVM MMU does
5405 * not use any resource of the being-deleted slot or all slots
5406 * after calling the function.
5407 */
5408 static void kvm_mmu_zap_all_fast(struct kvm *kvm)
5409 {
5410 struct kvm_mmu_page *root;
5411
5412 lockdep_assert_held(&kvm->slots_lock);
5413
5414 write_lock(&kvm->mmu_lock);
5415 trace_kvm_mmu_zap_all_fast(kvm);
5416
5417 /*
5418 * Toggle mmu_valid_gen between '0' and '1'. Because slots_lock is
5419 * held for the entire duration of zapping obsolete pages, it's
5420 * impossible for there to be multiple invalid generations associated
5421 * with *valid* shadow pages at any given time, i.e. there is exactly
5422 * one valid generation and (at most) one invalid generation.
5423 */
5424 kvm->arch.mmu_valid_gen = kvm->arch.mmu_valid_gen ? 0 : 1;
5425
5426
5427 if (is_tdp_mmu_enabled(kvm)) {
5428 /*
5429 * Mark each TDP MMU root as invalid so that other threads
5430 * will drop their references and allow the root count to
5431 * go to 0.
5432 *
5433 * This has essentially the same effect for the TDP MMU
5434 * as updating mmu_valid_gen above does for the shadow
5435 * MMU.
5436 *
5437 * In order to ensure all threads see this change when
5438 * handling the MMU reload signal, this must happen in the
5439 * same critical section as kvm_reload_remote_mmus, and
5440 * before kvm_zap_obsolete_pages as kvm_zap_obsolete_pages
5441 * could drop the MMU lock and yield.
5442 */
> 5443 list_for_each_entry(root, &kvm->arch.tdp_mmu_roots, link)
5444 root->role.invalid = true;
5445 }
5446
5447 /*
5448 * Notify all vcpus to reload its shadow page table and flush TLB.
5449 * Then all vcpus will switch to new shadow page table with the new
5450 * mmu_valid_gen.
5451 *
5452 * Note: we need to do this under the protection of mmu_lock,
5453 * otherwise, vcpu would purge shadow page but miss tlb flush.
5454 */
5455 kvm_reload_remote_mmus(kvm);
5456
5457 kvm_zap_obsolete_pages(kvm);
5458
5459 write_unlock(&kvm->mmu_lock);
5460 }
5461
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[csky-linux:v5.12-rc4-riscv-atomic-arch-v3 4/5] include/linux/atomic-fallback.h:1434:1: error: static declaration of 'atomic64_add_return' follows non-static declaration
by kernel test robot
tree: https://github.com/c-sky/csky-linux v5.12-rc4-riscv-atomic-arch-v3
head: 516baf028b48129e1941ad764ef9a13271830bdc
commit: d985500eec5b9fa31462e5aa2b712b719d0de356 [4/5] locking/atomics: Fixup GENERIC_ATOMIC64 conflict with atomic-arch-fallback.h
config: sparc-randconfig-r025-20210419 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
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
# https://github.com/c-sky/csky-linux/commit/d985500eec5b9fa31462e5aa2b712b...
git remote add csky-linux https://github.com/c-sky/csky-linux
git fetch --no-tags csky-linux v5.12-rc4-riscv-atomic-arch-v3
git checkout d985500eec5b9fa31462e5aa2b712b719d0de356
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
>> include/linux/atomic-fallback.h:1434:1: error: static declaration of 'atomic64_add_return' follows non-static declaration
1434 | atomic64_add_return(s64 i, atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:27:12: note: previous declaration of 'atomic64_add_return' was here
27 | extern s64 atomic64_##op##_return(s64 a, atomic64_t *v);
| ^~~~~~~~~
include/asm-generic/atomic64.h:32:42: note: in expansion of macro 'ATOMIC64_OP_RETURN'
32 | #define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op)
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/atomic64.h:34:1: note: in expansion of macro 'ATOMIC64_OPS'
34 | ATOMIC64_OPS(add)
| ^~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
>> include/linux/atomic-fallback.h:1481:1: error: static declaration of 'atomic64_fetch_add' follows non-static declaration
1481 | atomic64_fetch_add(s64 i, atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:30:12: note: previous declaration of 'atomic64_fetch_add' was here
30 | extern s64 atomic64_fetch_##op(s64 a, atomic64_t *v);
| ^~~~~~~~~~~~~~~
include/asm-generic/atomic64.h:32:65: note: in expansion of macro 'ATOMIC64_FETCH_OP'
32 | #define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op)
| ^~~~~~~~~~~~~~~~~
include/asm-generic/atomic64.h:34:1: note: in expansion of macro 'ATOMIC64_OPS'
34 | ATOMIC64_OPS(add)
| ^~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:1594:1: error: redefinition of 'atomic64_inc'
1594 | atomic64_inc(atomic64_t *v)
| ^~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:75:1: note: previous definition of 'atomic64_inc' was here
75 | atomic64_inc(atomic64_t *v)
| ^~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:1615:1: error: redefinition of 'atomic64_inc_return'
1615 | atomic64_inc_return(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:81:1: note: previous definition of 'atomic64_inc_return' was here
81 | atomic64_inc_return(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:1701:1: error: redefinition of 'atomic64_fetch_inc'
1701 | atomic64_fetch_inc(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:87:1: note: previous definition of 'atomic64_fetch_inc' was here
87 | atomic64_fetch_inc(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:1777:1: error: redefinition of 'atomic64_dec'
1777 | atomic64_dec(atomic64_t *v)
| ^~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:93:1: note: previous definition of 'atomic64_dec' was here
93 | atomic64_dec(atomic64_t *v)
| ^~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:1798:1: error: redefinition of 'atomic64_dec_return'
1798 | atomic64_dec_return(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:99:1: note: previous definition of 'atomic64_dec_return' was here
99 | atomic64_dec_return(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:1884:1: error: redefinition of 'atomic64_fetch_dec'
1884 | atomic64_fetch_dec(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:105:1: note: previous definition of 'atomic64_fetch_dec' was here
105 | atomic64_fetch_dec(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
>> include/linux/atomic-fallback.h:2009:1: error: redefinition of 'atomic64_andnot'
2009 | atomic64_andnot(s64 i, atomic64_t *v)
| ^~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:111:1: note: previous definition of 'atomic64_andnot' was here
111 | atomic64_andnot(s64 i, atomic64_t *v)
| ^~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
>> include/linux/atomic-fallback.h:2030:1: error: redefinition of 'atomic64_fetch_andnot'
2030 | atomic64_fetch_andnot(s64 i, atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:117:1: note: previous definition of 'atomic64_fetch_andnot' was here
117 | atomic64_fetch_andnot(s64 i, atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
>> include/linux/atomic-fallback.h:2234:1: error: static declaration of 'atomic64_xchg' follows non-static declaration
2234 | atomic64_xchg(atomic64_t *v, s64 i)
| ^~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:67:12: note: previous declaration of 'atomic64_xchg' was here
67 | extern s64 atomic64_xchg(atomic64_t *v, s64 new);
| ^~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:2281:1: error: static declaration of 'atomic64_cmpxchg' follows non-static declaration
2281 | atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new)
| ^~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:63:12: note: previous declaration of 'atomic64_cmpxchg' was here
63 | extern s64 atomic64_cmpxchg(atomic64_t *v, s64 o, s64 n);
| ^~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:2409:1: error: conflicting types for 'atomic64_sub_and_test'
2409 | atomic64_sub_and_test(s64 i, atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:123:1: note: previous definition of 'atomic64_sub_and_test' was here
123 | atomic64_sub_and_test(int i, atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:2428:1: error: redefinition of 'atomic64_dec_and_test'
2428 | atomic64_dec_and_test(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/asm-generic/atomic64.h:129:1: note: previous definition of 'atomic64_dec_and_test' was here
129 | atomic64_dec_and_test(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:84,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_32.h:102,
from arch/sparc/include/asm/bitops.h:7,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:15,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/atomic-fallback.h:2447:1: error: redefinition of 'atomic64_inc_and_test'
2447 | atomic64_inc_and_test(atomic64_t *v)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from arch/sparc/include/asm/atomic_32.h:19,
from arch/sparc/include/asm/atomic.h:7,
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS || MCOUNT
Selected by
- LOCKDEP && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X86
vim +/atomic64_add_return +1434 include/linux/atomic-fallback.h
9fa45070a2e59a Mark Rutland 2018-09-04 1431
9fa45070a2e59a Mark Rutland 2018-09-04 1432 #ifndef atomic64_add_return
765dcd209947e7 Marco Elver 2019-11-26 1433 static __always_inline s64
9fa45070a2e59a Mark Rutland 2018-09-04 @1434 atomic64_add_return(s64 i, atomic64_t *v)
9fa45070a2e59a Mark Rutland 2018-09-04 1435 {
9fa45070a2e59a Mark Rutland 2018-09-04 1436 s64 ret;
9fa45070a2e59a Mark Rutland 2018-09-04 1437 __atomic_pre_full_fence();
9fa45070a2e59a Mark Rutland 2018-09-04 1438 ret = atomic64_add_return_relaxed(i, v);
9fa45070a2e59a Mark Rutland 2018-09-04 1439 __atomic_post_full_fence();
9fa45070a2e59a Mark Rutland 2018-09-04 1440 return ret;
9fa45070a2e59a Mark Rutland 2018-09-04 1441 }
9fa45070a2e59a Mark Rutland 2018-09-04 1442 #define atomic64_add_return atomic64_add_return
9fa45070a2e59a Mark Rutland 2018-09-04 1443 #endif
9fa45070a2e59a Mark Rutland 2018-09-04 1444
9fa45070a2e59a Mark Rutland 2018-09-04 1445 #endif /* atomic64_add_return_relaxed */
9fa45070a2e59a Mark Rutland 2018-09-04 1446
5faafd5685764e Peter Zijlstra 2020-06-25 1447 #define arch_atomic64_fetch_add atomic64_fetch_add
5faafd5685764e Peter Zijlstra 2020-06-25 1448 #define arch_atomic64_fetch_add_acquire atomic64_fetch_add_acquire
5faafd5685764e Peter Zijlstra 2020-06-25 1449 #define arch_atomic64_fetch_add_release atomic64_fetch_add_release
5faafd5685764e Peter Zijlstra 2020-06-25 1450 #define arch_atomic64_fetch_add_relaxed atomic64_fetch_add_relaxed
5faafd5685764e Peter Zijlstra 2020-06-25 1451
9fa45070a2e59a Mark Rutland 2018-09-04 1452 #ifndef atomic64_fetch_add_relaxed
9fa45070a2e59a Mark Rutland 2018-09-04 1453 #define atomic64_fetch_add_acquire atomic64_fetch_add
9fa45070a2e59a Mark Rutland 2018-09-04 1454 #define atomic64_fetch_add_release atomic64_fetch_add
9fa45070a2e59a Mark Rutland 2018-09-04 1455 #define atomic64_fetch_add_relaxed atomic64_fetch_add
9fa45070a2e59a Mark Rutland 2018-09-04 1456 #else /* atomic64_fetch_add_relaxed */
9fa45070a2e59a Mark Rutland 2018-09-04 1457
9fa45070a2e59a Mark Rutland 2018-09-04 1458 #ifndef atomic64_fetch_add_acquire
765dcd209947e7 Marco Elver 2019-11-26 1459 static __always_inline s64
9fa45070a2e59a Mark Rutland 2018-09-04 1460 atomic64_fetch_add_acquire(s64 i, atomic64_t *v)
9fa45070a2e59a Mark Rutland 2018-09-04 1461 {
9fa45070a2e59a Mark Rutland 2018-09-04 1462 s64 ret = atomic64_fetch_add_relaxed(i, v);
9fa45070a2e59a Mark Rutland 2018-09-04 1463 __atomic_acquire_fence();
9fa45070a2e59a Mark Rutland 2018-09-04 1464 return ret;
9fa45070a2e59a Mark Rutland 2018-09-04 1465 }
9fa45070a2e59a Mark Rutland 2018-09-04 1466 #define atomic64_fetch_add_acquire atomic64_fetch_add_acquire
9fa45070a2e59a Mark Rutland 2018-09-04 1467 #endif
9fa45070a2e59a Mark Rutland 2018-09-04 1468
9fa45070a2e59a Mark Rutland 2018-09-04 1469 #ifndef atomic64_fetch_add_release
765dcd209947e7 Marco Elver 2019-11-26 1470 static __always_inline s64
9fa45070a2e59a Mark Rutland 2018-09-04 1471 atomic64_fetch_add_release(s64 i, atomic64_t *v)
9fa45070a2e59a Mark Rutland 2018-09-04 1472 {
9fa45070a2e59a Mark Rutland 2018-09-04 1473 __atomic_release_fence();
9fa45070a2e59a Mark Rutland 2018-09-04 1474 return atomic64_fetch_add_relaxed(i, v);
9fa45070a2e59a Mark Rutland 2018-09-04 1475 }
9fa45070a2e59a Mark Rutland 2018-09-04 1476 #define atomic64_fetch_add_release atomic64_fetch_add_release
9fa45070a2e59a Mark Rutland 2018-09-04 1477 #endif
9fa45070a2e59a Mark Rutland 2018-09-04 1478
9fa45070a2e59a Mark Rutland 2018-09-04 1479 #ifndef atomic64_fetch_add
765dcd209947e7 Marco Elver 2019-11-26 1480 static __always_inline s64
9fa45070a2e59a Mark Rutland 2018-09-04 @1481 atomic64_fetch_add(s64 i, atomic64_t *v)
9fa45070a2e59a Mark Rutland 2018-09-04 1482 {
9fa45070a2e59a Mark Rutland 2018-09-04 1483 s64 ret;
9fa45070a2e59a Mark Rutland 2018-09-04 1484 __atomic_pre_full_fence();
9fa45070a2e59a Mark Rutland 2018-09-04 1485 ret = atomic64_fetch_add_relaxed(i, v);
9fa45070a2e59a Mark Rutland 2018-09-04 1486 __atomic_post_full_fence();
9fa45070a2e59a Mark Rutland 2018-09-04 1487 return ret;
9fa45070a2e59a Mark Rutland 2018-09-04 1488 }
9fa45070a2e59a Mark Rutland 2018-09-04 1489 #define atomic64_fetch_add atomic64_fetch_add
9fa45070a2e59a Mark Rutland 2018-09-04 1490 #endif
9fa45070a2e59a Mark Rutland 2018-09-04 1491
:::::: The code at line 1434 was first introduced by commit
:::::: 9fa45070a2e59a871e1cd3370173369f3a4f61e2 locking/atomics: Switch to generated fallbacks
:::::: TO: Mark Rutland <mark.rutland(a)arm.com>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[powerpc:next 231/236] arch/powerpc/kernel/fadump.c:731:28: error: use of undeclared identifier 'INTERRUPT_SYSTEM_RESET'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
head: cbd3d5ba46b68c033986a6087209930f001cbcca
commit: 7153d4bf0b373428d0393c001019da4d0483fddb [231/236] powerpc/traps: Enhance readability for trap types
config: powerpc-randconfig-r016-20210419 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 2b50f5a4343f8fb06acaa5c36355bcf58092c9cd)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/...
git remote add powerpc https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
git fetch --no-tags powerpc next
git checkout 7153d4bf0b373428d0393c001019da4d0483fddb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the powerpc/next HEAD cbd3d5ba46b68c033986a6087209930f001cbcca builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
>> arch/powerpc/kernel/fadump.c:731:28: error: use of undeclared identifier 'INTERRUPT_SYSTEM_RESET'
if (TRAP(&(fdh->regs)) == INTERRUPT_SYSTEM_RESET) {
^
arch/powerpc/kernel/fadump.c:1703:22: error: no previous prototype for function 'arch_reserved_kernel_pages' [-Werror,-Wmissing-prototypes]
unsigned long __init arch_reserved_kernel_pages(void)
^
arch/powerpc/kernel/fadump.c:1703:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
unsigned long __init arch_reserved_kernel_pages(void)
^
static
2 errors generated.
vim +/INTERRUPT_SYSTEM_RESET +731 arch/powerpc/kernel/fadump.c
679
680 void crash_fadump(struct pt_regs *regs, const char *str)
681 {
682 unsigned int msecs;
683 struct fadump_crash_info_header *fdh = NULL;
684 int old_cpu, this_cpu;
685 /* Do not include first CPU */
686 unsigned int ncpus = num_online_cpus() - 1;
687
688 if (!should_fadump_crash())
689 return;
690
691 /*
692 * old_cpu == -1 means this is the first CPU which has come here,
693 * go ahead and trigger fadump.
694 *
695 * old_cpu != -1 means some other CPU has already on it's way
696 * to trigger fadump, just keep looping here.
697 */
698 this_cpu = smp_processor_id();
699 old_cpu = cmpxchg(&crashing_cpu, -1, this_cpu);
700
701 if (old_cpu != -1) {
702 atomic_inc(&cpus_in_fadump);
703
704 /*
705 * We can't loop here indefinitely. Wait as long as fadump
706 * is in force. If we race with fadump un-registration this
707 * loop will break and then we go down to normal panic path
708 * and reboot. If fadump is in force the first crashing
709 * cpu will definitely trigger fadump.
710 */
711 while (fw_dump.dump_registered)
712 cpu_relax();
713 return;
714 }
715
716 fdh = __va(fw_dump.fadumphdr_addr);
717 fdh->crashing_cpu = crashing_cpu;
718 crash_save_vmcoreinfo();
719
720 if (regs)
721 fdh->regs = *regs;
722 else
723 ppc_save_regs(&fdh->regs);
724
725 fdh->online_mask = *cpu_online_mask;
726
727 /*
728 * If we came in via system reset, wait a while for the secondary
729 * CPUs to enter.
730 */
> 731 if (TRAP(&(fdh->regs)) == INTERRUPT_SYSTEM_RESET) {
732 msecs = CRASH_TIMEOUT;
733 while ((atomic_read(&cpus_in_fadump) < ncpus) && (--msecs > 0))
734 mdelay(1);
735 }
736
737 fw_dump.ops->fadump_trigger(fdh, str);
738 }
739
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[csky-linux:v5.12-rc4-riscv-atomic-arch-v3 4/5] lib/atomic64_test.c:177:2: error: implicit declaration of function 'atomic64_sub_return_acquire'
by kernel test robot
tree: https://github.com/c-sky/csky-linux v5.12-rc4-riscv-atomic-arch-v3
head: 516baf028b48129e1941ad764ef9a13271830bdc
commit: d985500eec5b9fa31462e5aa2b712b719d0de356 [4/5] locking/atomics: Fixup GENERIC_ATOMIC64 conflict with atomic-arch-fallback.h
config: powerpc64-randconfig-r022-20210419 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 2b50f5a4343f8fb06acaa5c36355bcf58092c9cd)
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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/c-sky/csky-linux/commit/d985500eec5b9fa31462e5aa2b712b...
git remote add csky-linux https://github.com/c-sky/csky-linux
git fetch --no-tags csky-linux v5.12-rc4-riscv-atomic-arch-v3
git checkout d985500eec5b9fa31462e5aa2b712b719d0de356
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> lib/atomic64_test.c:177:2: error: implicit declaration of function 'atomic64_sub_return_acquire' [-Werror,-Wimplicit-function-declaration]
RETURN_FAMILY_TEST(64, sub_return, -=, onestwos);
^
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
lib/atomic64_test.c:177:2: note: did you mean 'atomic_sub_return_acquire'?
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:285:1: note: 'atomic_sub_return_acquire' declared here
atomic_sub_return_acquire(int i, atomic_t *v)
^
>> lib/atomic64_test.c:177:2: error: implicit declaration of function 'atomic64_sub_return_release' [-Werror,-Wimplicit-function-declaration]
RETURN_FAMILY_TEST(64, sub_return, -=, onestwos);
^
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
lib/atomic64_test.c:177:2: note: did you mean 'atomic_sub_return_release'?
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:296:1: note: 'atomic_sub_return_release' declared here
atomic_sub_return_release(int i, atomic_t *v)
^
>> lib/atomic64_test.c:177:2: error: implicit declaration of function 'atomic64_sub_return_relaxed' [-Werror,-Wimplicit-function-declaration]
RETURN_FAMILY_TEST(64, sub_return, -=, onestwos);
^
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
lib/atomic64_test.c:177:2: note: did you mean 'atomic_sub_return_relaxed'?
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
arch/powerpc/include/asm/atomic.h:95:1: note: 'atomic_sub_return_relaxed' declared here
ATOMIC_OPS(sub, subf)
^
arch/powerpc/include/asm/atomic.h:91:2: note: expanded from macro 'ATOMIC_OPS'
ATOMIC_OP_RETURN_RELAXED(op, asm_op) \
^
arch/powerpc/include/asm/atomic.h:56:19: note: expanded from macro 'ATOMIC_OP_RETURN_RELAXED'
static inline int atomic_##op##_return_relaxed(int a, atomic_t *v) \
^
<scratch space>:88:1: note: expanded from here
atomic_sub_return_relaxed
^
lib/atomic64_test.c:178:2: error: implicit declaration of function 'atomic64_sub_return_acquire' [-Werror,-Wimplicit-function-declaration]
RETURN_FAMILY_TEST(64, sub_return, -=, -one);
^
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
lib/atomic64_test.c:178:2: error: implicit declaration of function 'atomic64_sub_return_release' [-Werror,-Wimplicit-function-declaration]
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
lib/atomic64_test.c:178:2: error: implicit declaration of function 'atomic64_sub_return_relaxed' [-Werror,-Wimplicit-function-declaration]
lib/atomic64_test.c:64:14: note: expanded from macro 'RETURN_FAMILY_TEST'
FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
^
>> lib/atomic64_test.c:182:2: error: implicit declaration of function 'atomic64_fetch_sub_acquire' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_sub, -=, onestwos);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:182:2: note: did you mean 'atomic_fetch_sub_acquire'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:332:1: note: 'atomic_fetch_sub_acquire' declared here
atomic_fetch_sub_acquire(int i, atomic_t *v)
^
>> lib/atomic64_test.c:182:2: error: implicit declaration of function 'atomic64_fetch_sub_release' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_sub, -=, onestwos);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:182:2: note: did you mean 'atomic_fetch_sub_release'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:343:1: note: 'atomic_fetch_sub_release' declared here
atomic_fetch_sub_release(int i, atomic_t *v)
^
>> lib/atomic64_test.c:182:2: error: implicit declaration of function 'atomic64_fetch_sub_relaxed' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_sub, -=, onestwos);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:182:2: note: did you mean 'atomic_fetch_sub_relaxed'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
arch/powerpc/include/asm/atomic.h:95:1: note: 'atomic_fetch_sub_relaxed' declared here
ATOMIC_OPS(sub, subf)
^
arch/powerpc/include/asm/atomic.h:92:2: note: expanded from macro 'ATOMIC_OPS'
ATOMIC_FETCH_OP_RELAXED(op, asm_op)
^
arch/powerpc/include/asm/atomic.h:73:19: note: expanded from macro 'ATOMIC_FETCH_OP_RELAXED'
static inline int atomic_fetch_##op##_relaxed(int a, atomic_t *v) \
^
<scratch space>:92:1: note: expanded from here
atomic_fetch_sub_relaxed
^
lib/atomic64_test.c:183:2: error: implicit declaration of function 'atomic64_fetch_sub_acquire' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_sub, -=, -one);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:183:2: error: implicit declaration of function 'atomic64_fetch_sub_release' [-Werror,-Wimplicit-function-declaration]
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:183:2: error: implicit declaration of function 'atomic64_fetch_sub_relaxed' [-Werror,-Wimplicit-function-declaration]
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
>> lib/atomic64_test.c:185:2: error: implicit declaration of function 'atomic64_fetch_or_acquire' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_or, |=, v1);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:185:2: note: did you mean 'atomic_fetch_or_acquire'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:893:1: note: 'atomic_fetch_or_acquire' declared here
atomic_fetch_or_acquire(int i, atomic_t *v)
^
>> lib/atomic64_test.c:185:2: error: implicit declaration of function 'atomic64_fetch_or_release' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_or, |=, v1);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:185:2: note: did you mean 'atomic_fetch_or_release'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:904:1: note: 'atomic_fetch_or_release' declared here
atomic_fetch_or_release(int i, atomic_t *v)
^
>> lib/atomic64_test.c:185:2: error: implicit declaration of function 'atomic64_fetch_or_relaxed' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_or, |=, v1);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:185:2: note: did you mean 'atomic_fetch_or_relaxed'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
arch/powerpc/include/asm/atomic.h:109:1: note: 'atomic_fetch_or_relaxed' declared here
ATOMIC_OPS(or, or)
^
arch/powerpc/include/asm/atomic.h:106:2: note: expanded from macro 'ATOMIC_OPS'
ATOMIC_FETCH_OP_RELAXED(op, asm_op)
^
arch/powerpc/include/asm/atomic.h:73:19: note: expanded from macro 'ATOMIC_FETCH_OP_RELAXED'
static inline int atomic_fetch_##op##_relaxed(int a, atomic_t *v) \
^
<scratch space>:106:1: note: expanded from here
atomic_fetch_or_relaxed
^
>> lib/atomic64_test.c:186:2: error: implicit declaration of function 'atomic64_fetch_and_acquire' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_and, &=, v1);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:186:2: note: did you mean 'atomic_fetch_and_acquire'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:747:1: note: 'atomic_fetch_and_acquire' declared here
atomic_fetch_and_acquire(int i, atomic_t *v)
^
>> lib/atomic64_test.c:186:2: error: implicit declaration of function 'atomic64_fetch_and_release' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_and, &=, v1);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:186:2: note: did you mean 'atomic_fetch_and_release'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:758:1: note: 'atomic_fetch_and_release' declared here
atomic_fetch_and_release(int i, atomic_t *v)
^
>> lib/atomic64_test.c:186:2: error: implicit declaration of function 'atomic64_fetch_and_relaxed' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_and, &=, v1);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:186:2: note: did you mean 'atomic_fetch_and_relaxed'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
arch/powerpc/include/asm/atomic.h:108:1: note: 'atomic_fetch_and_relaxed' declared here
ATOMIC_OPS(and, and)
^
arch/powerpc/include/asm/atomic.h:106:2: note: expanded from macro 'ATOMIC_OPS'
ATOMIC_FETCH_OP_RELAXED(op, asm_op)
^
arch/powerpc/include/asm/atomic.h:73:19: note: expanded from macro 'ATOMIC_FETCH_OP_RELAXED'
static inline int atomic_fetch_##op##_relaxed(int a, atomic_t *v) \
^
<scratch space>:99:1: note: expanded from here
atomic_fetch_and_relaxed
^
>> lib/atomic64_test.c:187:2: error: implicit declaration of function 'atomic64_fetch_andnot_acquire' [-Werror,-Wimplicit-function-declaration]
FETCH_FAMILY_TEST(64, fetch_andnot, &= ~, v1);
^
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
lib/atomic64_test.c:187:2: note: did you mean 'atomic_fetch_andnot_acquire'?
lib/atomic64_test.c:69:14: note: expanded from macro 'FETCH_FAMILY_TEST'
FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
^
include/linux/atomic-fallback.h:815:1: note: 'atomic_fetch_andnot_acquire' declared here
atomic_fetch_andnot_acquire(int i, atomic_t *v)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
vim +/atomic64_sub_return_acquire +177 lib/atomic64_test.c
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 145
86a8938078a8bb Luca Barbieri 2010-02-24 146 #define INIT(c) do { atomic64_set(&v, c); r = c; } while (0)
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 147 static __init void test_atomic64(void)
86a8938078a8bb Luca Barbieri 2010-02-24 148 {
86a8938078a8bb Luca Barbieri 2010-02-24 149 long long v0 = 0xaaa31337c001d00dLL;
86a8938078a8bb Luca Barbieri 2010-02-24 150 long long v1 = 0xdeadbeefdeafcafeLL;
86a8938078a8bb Luca Barbieri 2010-02-24 151 long long v2 = 0xfaceabadf00df001LL;
ffba19ccae8d98 Michael Ellerman 2017-07-14 152 long long v3 = 0x8000000000000000LL;
86a8938078a8bb Luca Barbieri 2010-02-24 153 long long onestwos = 0x1111111122222222LL;
86a8938078a8bb Luca Barbieri 2010-02-24 154 long long one = 1LL;
ffba19ccae8d98 Michael Ellerman 2017-07-14 155 int r_int;
86a8938078a8bb Luca Barbieri 2010-02-24 156
86a8938078a8bb Luca Barbieri 2010-02-24 157 atomic64_t v = ATOMIC64_INIT(v0);
86a8938078a8bb Luca Barbieri 2010-02-24 158 long long r = v0;
86a8938078a8bb Luca Barbieri 2010-02-24 159 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 160
86a8938078a8bb Luca Barbieri 2010-02-24 161 atomic64_set(&v, v1);
86a8938078a8bb Luca Barbieri 2010-02-24 162 r = v1;
86a8938078a8bb Luca Barbieri 2010-02-24 163 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 164 BUG_ON(atomic64_read(&v) != r);
86a8938078a8bb Luca Barbieri 2010-02-24 165
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 166 TEST(64, add, +=, onestwos);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 167 TEST(64, add, +=, -one);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 168 TEST(64, sub, -=, onestwos);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 169 TEST(64, sub, -=, -one);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 170 TEST(64, or, |=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 171 TEST(64, and, &=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 172 TEST(64, xor, ^=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 173 TEST(64, andnot, &= ~, v1);
86a8938078a8bb Luca Barbieri 2010-02-24 174
978e5a3692c3b6 Boqun Feng 2015-11-04 175 RETURN_FAMILY_TEST(64, add_return, +=, onestwos);
978e5a3692c3b6 Boqun Feng 2015-11-04 176 RETURN_FAMILY_TEST(64, add_return, +=, -one);
978e5a3692c3b6 Boqun Feng 2015-11-04 @177 RETURN_FAMILY_TEST(64, sub_return, -=, onestwos);
978e5a3692c3b6 Boqun Feng 2015-11-04 178 RETURN_FAMILY_TEST(64, sub_return, -=, -one);
86a8938078a8bb Luca Barbieri 2010-02-24 179
28aa2bda2211f4 Peter Zijlstra 2016-04-18 180 FETCH_FAMILY_TEST(64, fetch_add, +=, onestwos);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 181 FETCH_FAMILY_TEST(64, fetch_add, +=, -one);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 @182 FETCH_FAMILY_TEST(64, fetch_sub, -=, onestwos);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 183 FETCH_FAMILY_TEST(64, fetch_sub, -=, -one);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 184
28aa2bda2211f4 Peter Zijlstra 2016-04-18 @185 FETCH_FAMILY_TEST(64, fetch_or, |=, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 @186 FETCH_FAMILY_TEST(64, fetch_and, &=, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 @187 FETCH_FAMILY_TEST(64, fetch_andnot, &= ~, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 188 FETCH_FAMILY_TEST(64, fetch_xor, ^=, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 189
86a8938078a8bb Luca Barbieri 2010-02-24 190 INIT(v0);
86a8938078a8bb Luca Barbieri 2010-02-24 191 atomic64_inc(&v);
86a8938078a8bb Luca Barbieri 2010-02-24 192 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 193 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 194
86a8938078a8bb Luca Barbieri 2010-02-24 195 INIT(v0);
86a8938078a8bb Luca Barbieri 2010-02-24 196 atomic64_dec(&v);
86a8938078a8bb Luca Barbieri 2010-02-24 197 r -= one;
86a8938078a8bb Luca Barbieri 2010-02-24 198 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 199
978e5a3692c3b6 Boqun Feng 2015-11-04 200 INC_RETURN_FAMILY_TEST(64, v0);
978e5a3692c3b6 Boqun Feng 2015-11-04 201 DEC_RETURN_FAMILY_TEST(64, v0);
86a8938078a8bb Luca Barbieri 2010-02-24 202
978e5a3692c3b6 Boqun Feng 2015-11-04 203 XCHG_FAMILY_TEST(64, v0, v1);
978e5a3692c3b6 Boqun Feng 2015-11-04 204 CMPXCHG_FAMILY_TEST(64, v0, v1, v2);
86a8938078a8bb Luca Barbieri 2010-02-24 205
86a8938078a8bb Luca Barbieri 2010-02-24 206 INIT(v0);
9efbcd59024304 Luca Barbieri 2010-03-01 207 BUG_ON(atomic64_add_unless(&v, one, v0));
86a8938078a8bb Luca Barbieri 2010-02-24 208 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 209
86a8938078a8bb Luca Barbieri 2010-02-24 210 INIT(v0);
9efbcd59024304 Luca Barbieri 2010-03-01 211 BUG_ON(!atomic64_add_unless(&v, one, v1));
86a8938078a8bb Luca Barbieri 2010-02-24 212 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 213 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 214
86a8938078a8bb Luca Barbieri 2010-02-24 215 INIT(onestwos);
86a8938078a8bb Luca Barbieri 2010-02-24 216 BUG_ON(atomic64_dec_if_positive(&v) != (onestwos - 1));
86a8938078a8bb Luca Barbieri 2010-02-24 217 r -= one;
86a8938078a8bb Luca Barbieri 2010-02-24 218 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 219
86a8938078a8bb Luca Barbieri 2010-02-24 220 INIT(0);
86a8938078a8bb Luca Barbieri 2010-02-24 221 BUG_ON(atomic64_dec_if_positive(&v) != -one);
86a8938078a8bb Luca Barbieri 2010-02-24 222 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 223
86a8938078a8bb Luca Barbieri 2010-02-24 224 INIT(-one);
86a8938078a8bb Luca Barbieri 2010-02-24 225 BUG_ON(atomic64_dec_if_positive(&v) != (-one - one));
86a8938078a8bb Luca Barbieri 2010-02-24 226 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 227
86a8938078a8bb Luca Barbieri 2010-02-24 228 INIT(onestwos);
25a304f277ad70 Luca Barbieri 2010-03-01 229 BUG_ON(!atomic64_inc_not_zero(&v));
86a8938078a8bb Luca Barbieri 2010-02-24 230 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 231 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 232
86a8938078a8bb Luca Barbieri 2010-02-24 233 INIT(0);
25a304f277ad70 Luca Barbieri 2010-03-01 234 BUG_ON(atomic64_inc_not_zero(&v));
86a8938078a8bb Luca Barbieri 2010-02-24 235 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 236
86a8938078a8bb Luca Barbieri 2010-02-24 237 INIT(-one);
25a304f277ad70 Luca Barbieri 2010-03-01 238 BUG_ON(!atomic64_inc_not_zero(&v));
86a8938078a8bb Luca Barbieri 2010-02-24 239 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 240 BUG_ON(v.counter != r);
ffba19ccae8d98 Michael Ellerman 2017-07-14 241
ffba19ccae8d98 Michael Ellerman 2017-07-14 242 /* Confirm the return value fits in an int, even if the value doesn't */
ffba19ccae8d98 Michael Ellerman 2017-07-14 243 INIT(v3);
ffba19ccae8d98 Michael Ellerman 2017-07-14 244 r_int = atomic64_inc_not_zero(&v);
ffba19ccae8d98 Michael Ellerman 2017-07-14 245 BUG_ON(!r_int);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 246 }
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 247
:::::: The code at line 177 was first introduced by commit
:::::: 978e5a3692c3b674b4c7c412e96835fd996c2ff4 atomics: Add test for atomic operations with _relaxed variants
:::::: TO: Boqun Feng <boqun.feng(a)gmail.com>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[mel:mm-percpu-local_lock-v4r4 22/29] mm/vmstat.c:1793:5: error: section attribute cannot be specified for local variables
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git mm-percpu-local_lock-v4r4
head: 85d43239ceaed47c1a4e646aba1ebc09ad46734e
commit: c1617f38ab5c8401a4d5c6288c59aaf02e2a6788 [22/29] mm/vmstat: Convert NUMA statistics to basic NUMA counters
config: parisc-randconfig-r015-20210419 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git/commit/?id=...
git remote add mel https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git
git fetch --no-tags mel mm-percpu-local_lock-v4r4
git checkout c1617f38ab5c8401a4d5c6288c59aaf02e2a6788
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
mm/vmstat.c: In function 'refresh_cpu_vm_stats':
mm/vmstat.c:781:34: warning: unused variable 'pcp' [-Wunused-variable]
781 | struct per_cpu_pages __percpu *pcp = zone->per_cpu_pageset;
| ^~~
mm/vmstat.c: In function 'cpu_vm_stats_fold':
>> mm/vmstat.c:913:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
913 | void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *pzstats)
| ^~~~
>> mm/vmstat.c:1793:5: error: section attribute cannot be specified for local variables
1793 | int sysctl_stat_interval __read_mostly = HZ;
| ^~~~~~~~~~~~~~~~~~~~
>> mm/vmstat.c:1841:13: error: invalid storage class for function 'vmstat_update'
1841 | static void vmstat_update(struct work_struct *w)
| ^~~~~~~~~~~~~
>> mm/vmstat.c:1864:13: error: invalid storage class for function 'need_update'
1864 | static bool need_update(int cpu)
| ^~~~~~~~~~~
>> mm/vmstat.c:1922:13: error: invalid storage class for function 'vmstat_shepherd'
1922 | static void vmstat_shepherd(struct work_struct *w);
| ^~~~~~~~~~~~~~~
In file included from include/linux/mm_types.h:16,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/xarray.h:14,
from include/linux/radix-tree.h:19,
from include/linux/fs.h:15,
from mm/vmstat.c:13:
>> mm/vmstat.c:1924:42: error: 'vmstat_shepherd' undeclared (first use in this function)
1924 | static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd);
| ^~~~~~~~~~~~~~~
include/linux/workqueue.h:187:11: note: in definition of macro '__WORK_INITIALIZER'
187 | .func = (f), \
| ^
include/linux/workqueue.h:204:26: note: in expansion of macro '__DELAYED_WORK_INITIALIZER'
204 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
mm/vmstat.c:1924:8: note: in expansion of macro 'DECLARE_DEFERRABLE_WORK'
1924 | static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd);
| ^~~~~~~~~~~~~~~~~~~~~~~
mm/vmstat.c:1924:42: note: each undeclared identifier is reported only once for each function it appears in
1924 | static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd);
| ^~~~~~~~~~~~~~~
include/linux/workqueue.h:187:11: note: in definition of macro '__WORK_INITIALIZER'
187 | .func = (f), \
| ^
include/linux/workqueue.h:204:26: note: in expansion of macro '__DELAYED_WORK_INITIALIZER'
204 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
mm/vmstat.c:1924:8: note: in expansion of macro 'DECLARE_DEFERRABLE_WORK'
1924 | static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd);
| ^~~~~~~~~~~~~~~~~~~~~~~
mm/vmstat.c:1926:13: error: invalid storage class for function 'vmstat_shepherd'
1926 | static void vmstat_shepherd(struct work_struct *w)
| ^~~~~~~~~~~~~~~
>> mm/vmstat.c:1946:20: error: invalid storage class for function 'start_shepherd_timer'
1946 | static void __init start_shepherd_timer(void)
| ^~~~~~~~~~~~~~~~~~~~
>> mm/vmstat.c:1958:20: error: invalid storage class for function 'init_cpu_node_state'
1958 | static void __init init_cpu_node_state(void)
| ^~~~~~~~~~~~~~~~~~~
>> mm/vmstat.c:1968:12: error: invalid storage class for function 'vmstat_cpu_online'
1968 | static int vmstat_cpu_online(unsigned int cpu)
| ^~~~~~~~~~~~~~~~~
>> mm/vmstat.c:1975:12: error: invalid storage class for function 'vmstat_cpu_down_prep'
1975 | static int vmstat_cpu_down_prep(unsigned int cpu)
| ^~~~~~~~~~~~~~~~~~~~
>> mm/vmstat.c:1981:12: error: invalid storage class for function 'vmstat_cpu_dead'
1981 | static int vmstat_cpu_dead(unsigned int cpu)
| ^~~~~~~~~~~~~~~
>> mm/vmstat.c:2031:1: error: expected declaration or statement at end of input
2031 | }
| ^
>> mm/vmstat.c:1999:26: warning: variable 'mm_percpu_wq' set but not used [-Wunused-but-set-variable]
1999 | struct workqueue_struct *mm_percpu_wq;
| ^~~~~~~~~~~~
mm/vmstat.c:1126:20: warning: unused variable 'vmstat_text' [-Wunused-variable]
1126 | const char * const vmstat_text[] = {
| ^~~~~~~~~~~
At top level:
mm/vmstat.c:1126:20: warning: 'vmstat_text' defined but not used [-Wunused-const-variable=]
mm/vmstat.c:2001:13: warning: 'init_mm_internals' defined but not used [-Wunused-function]
2001 | void __init init_mm_internals(void)
| ^~~~~~~~~~~~~~~~~
mm/vmstat.c:1926:13: warning: 'vmstat_shepherd' defined but not used [-Wunused-function]
1926 | static void vmstat_shepherd(struct work_struct *w)
| ^~~~~~~~~~~~~~~
mm/vmstat.c:1896:6: warning: 'quiet_vmstat' defined but not used [-Wunused-function]
1896 | void quiet_vmstat(void)
| ^~~~~~~~~~~~
mm/vmstat.c:913:6: warning: 'drain_zonestat' defined but not used [-Wunused-function]
913 | void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *pzstats)
| ^~~~~~~~~~~~~~
vim +1793 mm/vmstat.c
f6ac2354d79119 Christoph Lameter 2006-06-30 1790
df9ecaba3f152d Christoph Lameter 2006-08-31 1791 #ifdef CONFIG_SMP
d1187ed21026fd Christoph Lameter 2007-05-09 1792 static DEFINE_PER_CPU(struct delayed_work, vmstat_work);
77461ab33229d4 Christoph Lameter 2007-05-09 @1793 int sysctl_stat_interval __read_mostly = HZ;
d1187ed21026fd Christoph Lameter 2007-05-09 1794
52b6f46bc163ee Hugh Dickins 2016-05-19 1795 #ifdef CONFIG_PROC_FS
52b6f46bc163ee Hugh Dickins 2016-05-19 1796 static void refresh_vm_stats(struct work_struct *work)
52b6f46bc163ee Hugh Dickins 2016-05-19 1797 {
52b6f46bc163ee Hugh Dickins 2016-05-19 1798 refresh_cpu_vm_stats(true);
52b6f46bc163ee Hugh Dickins 2016-05-19 1799 }
52b6f46bc163ee Hugh Dickins 2016-05-19 1800
52b6f46bc163ee Hugh Dickins 2016-05-19 1801 int vmstat_refresh(struct ctl_table *table, int write,
32927393dc1ccd Christoph Hellwig 2020-04-24 1802 void *buffer, size_t *lenp, loff_t *ppos)
52b6f46bc163ee Hugh Dickins 2016-05-19 1803 {
52b6f46bc163ee Hugh Dickins 2016-05-19 1804 long val;
52b6f46bc163ee Hugh Dickins 2016-05-19 1805 int err;
52b6f46bc163ee Hugh Dickins 2016-05-19 1806 int i;
52b6f46bc163ee Hugh Dickins 2016-05-19 1807
52b6f46bc163ee Hugh Dickins 2016-05-19 1808 /*
52b6f46bc163ee Hugh Dickins 2016-05-19 1809 * The regular update, every sysctl_stat_interval, may come later
52b6f46bc163ee Hugh Dickins 2016-05-19 1810 * than expected: leaving a significant amount in per_cpu buckets.
52b6f46bc163ee Hugh Dickins 2016-05-19 1811 * This is particularly misleading when checking a quantity of HUGE
52b6f46bc163ee Hugh Dickins 2016-05-19 1812 * pages, immediately after running a test. /proc/sys/vm/stat_refresh,
52b6f46bc163ee Hugh Dickins 2016-05-19 1813 * which can equally be echo'ed to or cat'ted from (by root),
52b6f46bc163ee Hugh Dickins 2016-05-19 1814 * can be used to update the stats just before reading them.
52b6f46bc163ee Hugh Dickins 2016-05-19 1815 *
c41f012ade0b95 Michal Hocko 2017-09-06 1816 * Oh, and since global_zone_page_state() etc. are so careful to hide
52b6f46bc163ee Hugh Dickins 2016-05-19 1817 * transiently negative values, report an error here if any of
52b6f46bc163ee Hugh Dickins 2016-05-19 1818 * the stats is negative, so we know to go looking for imbalance.
52b6f46bc163ee Hugh Dickins 2016-05-19 1819 */
52b6f46bc163ee Hugh Dickins 2016-05-19 1820 err = schedule_on_each_cpu(refresh_vm_stats);
52b6f46bc163ee Hugh Dickins 2016-05-19 1821 if (err)
52b6f46bc163ee Hugh Dickins 2016-05-19 1822 return err;
52b6f46bc163ee Hugh Dickins 2016-05-19 1823 for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) {
75ef7184053989 Mel Gorman 2016-07-28 1824 val = atomic_long_read(&vm_zone_stat[i]);
52b6f46bc163ee Hugh Dickins 2016-05-19 1825 if (val < 0) {
52b6f46bc163ee Hugh Dickins 2016-05-19 1826 pr_warn("%s: %s %ld\n",
9d7ea9a297e644 Konstantin Khlebnikov 2019-12-04 1827 __func__, zone_stat_name(i), val);
52b6f46bc163ee Hugh Dickins 2016-05-19 1828 err = -EINVAL;
52b6f46bc163ee Hugh Dickins 2016-05-19 1829 }
52b6f46bc163ee Hugh Dickins 2016-05-19 1830 }
52b6f46bc163ee Hugh Dickins 2016-05-19 1831 if (err)
52b6f46bc163ee Hugh Dickins 2016-05-19 1832 return err;
52b6f46bc163ee Hugh Dickins 2016-05-19 1833 if (write)
52b6f46bc163ee Hugh Dickins 2016-05-19 1834 *ppos += *lenp;
52b6f46bc163ee Hugh Dickins 2016-05-19 1835 else
52b6f46bc163ee Hugh Dickins 2016-05-19 1836 *lenp = 0;
52b6f46bc163ee Hugh Dickins 2016-05-19 1837 return 0;
52b6f46bc163ee Hugh Dickins 2016-05-19 1838 }
52b6f46bc163ee Hugh Dickins 2016-05-19 1839 #endif /* CONFIG_PROC_FS */
52b6f46bc163ee Hugh Dickins 2016-05-19 1840
d1187ed21026fd Christoph Lameter 2007-05-09 @1841 static void vmstat_update(struct work_struct *w)
d1187ed21026fd Christoph Lameter 2007-05-09 1842 {
0eb77e98803219 Christoph Lameter 2016-01-14 1843 if (refresh_cpu_vm_stats(true)) {
7cc36bbddde5cd Christoph Lameter 2014-10-09 1844 /*
7cc36bbddde5cd Christoph Lameter 2014-10-09 1845 * Counters were updated so we expect more updates
7cc36bbddde5cd Christoph Lameter 2014-10-09 1846 * to occur in the future. Keep on running the
7cc36bbddde5cd Christoph Lameter 2014-10-09 1847 * update worker thread.
7cc36bbddde5cd Christoph Lameter 2014-10-09 1848 */
ce612879ddc78e Michal Hocko 2017-04-07 1849 queue_delayed_work_on(smp_processor_id(), mm_percpu_wq,
176bed1de5bf97 Linus Torvalds 2015-10-15 1850 this_cpu_ptr(&vmstat_work),
98f4ebb290a7dc Anton Blanchard 2009-04-02 1851 round_jiffies_relative(sysctl_stat_interval));
f01f17d3705bb6 Michal Hocko 2016-02-05 1852 }
7cc36bbddde5cd Christoph Lameter 2014-10-09 1853 }
7cc36bbddde5cd Christoph Lameter 2014-10-09 1854
0eb77e98803219 Christoph Lameter 2016-01-14 1855 /*
0eb77e98803219 Christoph Lameter 2016-01-14 1856 * Switch off vmstat processing and then fold all the remaining differentials
0eb77e98803219 Christoph Lameter 2016-01-14 1857 * until the diffs stay at zero. The function is used by NOHZ and can only be
0eb77e98803219 Christoph Lameter 2016-01-14 1858 * invoked when tick processing is not active.
0eb77e98803219 Christoph Lameter 2016-01-14 1859 */
7cc36bbddde5cd Christoph Lameter 2014-10-09 1860 /*
7cc36bbddde5cd Christoph Lameter 2014-10-09 1861 * Check if the diffs for a certain cpu indicate that
7cc36bbddde5cd Christoph Lameter 2014-10-09 1862 * an update is needed.
7cc36bbddde5cd Christoph Lameter 2014-10-09 1863 */
7cc36bbddde5cd Christoph Lameter 2014-10-09 @1864 static bool need_update(int cpu)
7cc36bbddde5cd Christoph Lameter 2014-10-09 1865 {
2bbd00aef0671b Johannes Weiner 2021-02-25 1866 pg_data_t *last_pgdat = NULL;
7cc36bbddde5cd Christoph Lameter 2014-10-09 1867 struct zone *zone;
7cc36bbddde5cd Christoph Lameter 2014-10-09 1868
7cc36bbddde5cd Christoph Lameter 2014-10-09 1869 for_each_populated_zone(zone) {
6d2c7ce5a47d4e Mel Gorman 2021-01-19 1870 struct per_cpu_zonestat *pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu);
2bbd00aef0671b Johannes Weiner 2021-02-25 1871 struct per_cpu_nodestat *n;
6d2c7ce5a47d4e Mel Gorman 2021-01-19 1872
7cc36bbddde5cd Christoph Lameter 2014-10-09 1873 /*
7cc36bbddde5cd Christoph Lameter 2014-10-09 1874 * The fast way of checking if there are any vmstat diffs.
7cc36bbddde5cd Christoph Lameter 2014-10-09 1875 */
6d2c7ce5a47d4e Mel Gorman 2021-01-19 1876 if (memchr_inv(pzstats->vm_stat_diff, 0, NR_VM_ZONE_STAT_ITEMS *
6d2c7ce5a47d4e Mel Gorman 2021-01-19 1877 sizeof(pzstats->vm_stat_diff[0])))
7cc36bbddde5cd Christoph Lameter 2014-10-09 1878 return true;
c1617f38ab5c84 Mel Gorman 2021-02-24 1879
2bbd00aef0671b Johannes Weiner 2021-02-25 1880 if (last_pgdat == zone->zone_pgdat)
2bbd00aef0671b Johannes Weiner 2021-02-25 1881 continue;
2bbd00aef0671b Johannes Weiner 2021-02-25 1882 last_pgdat = zone->zone_pgdat;
2bbd00aef0671b Johannes Weiner 2021-02-25 1883 n = per_cpu_ptr(zone->zone_pgdat->per_cpu_nodestats, cpu);
2bbd00aef0671b Johannes Weiner 2021-02-25 1884 if (memchr_inv(n->vm_node_stat_diff, 0, NR_VM_NODE_STAT_ITEMS *
2bbd00aef0671b Johannes Weiner 2021-02-25 1885 sizeof(n->vm_node_stat_diff[0])))
2bbd00aef0671b Johannes Weiner 2021-02-25 1886 return true;
7cc36bbddde5cd Christoph Lameter 2014-10-09 1887 }
7cc36bbddde5cd Christoph Lameter 2014-10-09 1888 return false;
7cc36bbddde5cd Christoph Lameter 2014-10-09 1889 }
7cc36bbddde5cd Christoph Lameter 2014-10-09 1890
7b8da4c7f07774 Christoph Lameter 2016-05-20 1891 /*
7b8da4c7f07774 Christoph Lameter 2016-05-20 1892 * Switch off vmstat processing and then fold all the remaining differentials
7b8da4c7f07774 Christoph Lameter 2016-05-20 1893 * until the diffs stay at zero. The function is used by NOHZ and can only be
7b8da4c7f07774 Christoph Lameter 2016-05-20 1894 * invoked when tick processing is not active.
7b8da4c7f07774 Christoph Lameter 2016-05-20 1895 */
f01f17d3705bb6 Michal Hocko 2016-02-05 1896 void quiet_vmstat(void)
f01f17d3705bb6 Michal Hocko 2016-02-05 1897 {
f01f17d3705bb6 Michal Hocko 2016-02-05 1898 if (system_state != SYSTEM_RUNNING)
f01f17d3705bb6 Michal Hocko 2016-02-05 1899 return;
f01f17d3705bb6 Michal Hocko 2016-02-05 1900
7b8da4c7f07774 Christoph Lameter 2016-05-20 1901 if (!delayed_work_pending(this_cpu_ptr(&vmstat_work)))
f01f17d3705bb6 Michal Hocko 2016-02-05 1902 return;
f01f17d3705bb6 Michal Hocko 2016-02-05 1903
f01f17d3705bb6 Michal Hocko 2016-02-05 1904 if (!need_update(smp_processor_id()))
f01f17d3705bb6 Michal Hocko 2016-02-05 1905 return;
f01f17d3705bb6 Michal Hocko 2016-02-05 1906
f01f17d3705bb6 Michal Hocko 2016-02-05 1907 /*
f01f17d3705bb6 Michal Hocko 2016-02-05 1908 * Just refresh counters and do not care about the pending delayed
f01f17d3705bb6 Michal Hocko 2016-02-05 1909 * vmstat_update. It doesn't fire that often to matter and canceling
f01f17d3705bb6 Michal Hocko 2016-02-05 1910 * it would be too expensive from this path.
f01f17d3705bb6 Michal Hocko 2016-02-05 1911 * vmstat_shepherd will take care about that for us.
f01f17d3705bb6 Michal Hocko 2016-02-05 1912 */
f01f17d3705bb6 Michal Hocko 2016-02-05 1913 refresh_cpu_vm_stats(false);
f01f17d3705bb6 Michal Hocko 2016-02-05 1914 }
f01f17d3705bb6 Michal Hocko 2016-02-05 1915
7cc36bbddde5cd Christoph Lameter 2014-10-09 1916 /*
7cc36bbddde5cd Christoph Lameter 2014-10-09 1917 * Shepherd worker thread that checks the
7cc36bbddde5cd Christoph Lameter 2014-10-09 1918 * differentials of processors that have their worker
7cc36bbddde5cd Christoph Lameter 2014-10-09 1919 * threads for vm statistics updates disabled because of
7cc36bbddde5cd Christoph Lameter 2014-10-09 1920 * inactivity.
7cc36bbddde5cd Christoph Lameter 2014-10-09 1921 */
7cc36bbddde5cd Christoph Lameter 2014-10-09 @1922 static void vmstat_shepherd(struct work_struct *w);
7cc36bbddde5cd Christoph Lameter 2014-10-09 1923
0eb77e98803219 Christoph Lameter 2016-01-14 @1924 static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd);
7cc36bbddde5cd Christoph Lameter 2014-10-09 1925
7cc36bbddde5cd Christoph Lameter 2014-10-09 1926 static void vmstat_shepherd(struct work_struct *w)
7cc36bbddde5cd Christoph Lameter 2014-10-09 1927 {
7cc36bbddde5cd Christoph Lameter 2014-10-09 1928 int cpu;
7cc36bbddde5cd Christoph Lameter 2014-10-09 1929
7cc36bbddde5cd Christoph Lameter 2014-10-09 1930 get_online_cpus();
7cc36bbddde5cd Christoph Lameter 2014-10-09 1931 /* Check processors whose vmstat worker threads have been disabled */
7b8da4c7f07774 Christoph Lameter 2016-05-20 1932 for_each_online_cpu(cpu) {
f01f17d3705bb6 Michal Hocko 2016-02-05 1933 struct delayed_work *dw = &per_cpu(vmstat_work, cpu);
7cc36bbddde5cd Christoph Lameter 2014-10-09 1934
7b8da4c7f07774 Christoph Lameter 2016-05-20 1935 if (!delayed_work_pending(dw) && need_update(cpu))
ce612879ddc78e Michal Hocko 2017-04-07 1936 queue_delayed_work_on(cpu, mm_percpu_wq, dw, 0);
fbcc8183a4f815 Jiang Biao 2021-02-25 1937
fbcc8183a4f815 Jiang Biao 2021-02-25 1938 cond_resched();
f01f17d3705bb6 Michal Hocko 2016-02-05 1939 }
7cc36bbddde5cd Christoph Lameter 2014-10-09 1940 put_online_cpus();
7cc36bbddde5cd Christoph Lameter 2014-10-09 1941
7cc36bbddde5cd Christoph Lameter 2014-10-09 1942 schedule_delayed_work(&shepherd,
7cc36bbddde5cd Christoph Lameter 2014-10-09 1943 round_jiffies_relative(sysctl_stat_interval));
d1187ed21026fd Christoph Lameter 2007-05-09 1944 }
d1187ed21026fd Christoph Lameter 2007-05-09 1945
7cc36bbddde5cd Christoph Lameter 2014-10-09 @1946 static void __init start_shepherd_timer(void)
d1187ed21026fd Christoph Lameter 2007-05-09 1947 {
7cc36bbddde5cd Christoph Lameter 2014-10-09 1948 int cpu;
7cc36bbddde5cd Christoph Lameter 2014-10-09 1949
7cc36bbddde5cd Christoph Lameter 2014-10-09 1950 for_each_possible_cpu(cpu)
ccde8bd4014eb2 Michal Hocko 2016-02-05 1951 INIT_DEFERRABLE_WORK(per_cpu_ptr(&vmstat_work, cpu),
7cc36bbddde5cd Christoph Lameter 2014-10-09 1952 vmstat_update);
7cc36bbddde5cd Christoph Lameter 2014-10-09 1953
7cc36bbddde5cd Christoph Lameter 2014-10-09 1954 schedule_delayed_work(&shepherd,
7cc36bbddde5cd Christoph Lameter 2014-10-09 1955 round_jiffies_relative(sysctl_stat_interval));
d1187ed21026fd Christoph Lameter 2007-05-09 1956 }
d1187ed21026fd Christoph Lameter 2007-05-09 1957
03e86dba5b628a Tim Chen 2016-10-07 @1958 static void __init init_cpu_node_state(void)
03e86dba5b628a Tim Chen 2016-10-07 1959 {
4c501327b4c67f Sebastian Andrzej Siewior 2016-11-29 1960 int node;
03e86dba5b628a Tim Chen 2016-10-07 1961
4c501327b4c67f Sebastian Andrzej Siewior 2016-11-29 1962 for_each_online_node(node) {
4c501327b4c67f Sebastian Andrzej Siewior 2016-11-29 1963 if (cpumask_weight(cpumask_of_node(node)) > 0)
4c501327b4c67f Sebastian Andrzej Siewior 2016-11-29 1964 node_set_state(node, N_CPU);
4c501327b4c67f Sebastian Andrzej Siewior 2016-11-29 1965 }
03e86dba5b628a Tim Chen 2016-10-07 1966 }
03e86dba5b628a Tim Chen 2016-10-07 1967
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 @1968 static int vmstat_cpu_online(unsigned int cpu)
807a1bd2b2a388 Toshi Kani 2013-11-12 1969 {
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1970 refresh_zone_stat_thresholds();
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1971 node_set_state(cpu_to_node(cpu), N_CPU);
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1972 return 0;
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1973 }
807a1bd2b2a388 Toshi Kani 2013-11-12 1974
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 @1975 static int vmstat_cpu_down_prep(unsigned int cpu)
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1976 {
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1977 cancel_delayed_work_sync(&per_cpu(vmstat_work, cpu));
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1978 return 0;
807a1bd2b2a388 Toshi Kani 2013-11-12 1979 }
807a1bd2b2a388 Toshi Kani 2013-11-12 1980
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 @1981 static int vmstat_cpu_dead(unsigned int cpu)
df9ecaba3f152d Christoph Lameter 2006-08-31 1982 {
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1983 const struct cpumask *node_cpus;
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1984 int node;
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1985
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1986 node = cpu_to_node(cpu);
d1187ed21026fd Christoph Lameter 2007-05-09 1987
df9ecaba3f152d Christoph Lameter 2006-08-31 1988 refresh_zone_stat_thresholds();
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1989 node_cpus = cpumask_of_node(node);
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1990 if (cpumask_weight(node_cpus) > 0)
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1991 return 0;
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1992
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1993 node_clear_state(node, N_CPU);
5438da977f83c9 Sebastian Andrzej Siewior 2016-11-29 1994 return 0;
df9ecaba3f152d Christoph Lameter 2006-08-31 1995 }
df9ecaba3f152d Christoph Lameter 2006-08-31 1996
:::::: The code at line 1793 was first introduced by commit
:::::: 77461ab33229d48614402decfb1b2eaa6d446861 Make vm statistics update interval configurable
:::::: TO: Christoph Lameter <clameter(a)sgi.com>
:::::: CC: Linus Torvalds <torvalds(a)woody.linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[kvm:queue 149/154] arch/x86/kvm/mmu/tdp_mmu.c:141:5: error: implicit declaration of function 'lockdep_is_help'; did you mean 'lockdep_is_held'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head: 3afb84581509b8d28979d15b5d727366efb3c8e5
commit: 078d47ee71d6a53657b5917ce1478f10bc173fa5 [149/154] KVM: x86/mmu: Protect the tdp_mmu_roots list with RCU
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=078d47ee71d6a5...
git remote add kvm https://git.kernel.org/pub/scm/virt/kvm/kvm.git
git fetch --no-tags kvm queue
git checkout 078d47ee71d6a53657b5917ce1478f10bc173fa5
# save the attached .config to linux build tree
make W=1 W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/kvm_host.h:12,
from arch/x86/kvm/mmu.h:5,
from arch/x86/kvm/mmu/tdp_mmu.c:3:
arch/x86/kvm/mmu/tdp_mmu.c: In function 'kvm_tdp_mmu_get_vcpu_root_hpa':
>> arch/x86/kvm/mmu/tdp_mmu.c:141:5: error: implicit declaration of function 'lockdep_is_help'; did you mean 'lockdep_is_held'? [-Werror=implicit-function-declaration]
141 | lockdep_is_help(&kvm->arch.tdp_mmu_pages_lock)) \
| ^~~~~~~~~~~~~~~
include/linux/rcupdate.h:318:52: note: in definition of macro 'RCU_LOCKDEP_WARN'
318 | if (debug_lockdep_rcu_enabled() && !__warned && (c)) { \
| ^
include/linux/rculist.h:391:7: note: in expansion of macro '__list_check_rcu'
391 | for (__list_check_rcu(dummy, ## cond, 0), \
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/mmu/tdp_mmu.c:139:2: note: in expansion of macro 'list_for_each_entry_rcu'
139 | list_for_each_entry_rcu(_root, &_kvm->arch.tdp_mmu_roots, link, \
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kvm/mmu/tdp_mmu.c:188:2: note: in expansion of macro 'for_each_tdp_mmu_root'
188 | for_each_tdp_mmu_root(kvm, root, kvm_mmu_role_as_id(role)) {
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +141 arch/x86/kvm/mmu/tdp_mmu.c
124
125 /*
126 * Note: this iterator gets and puts references to the roots it iterates over.
127 * This makes it safe to release the MMU lock and yield within the loop, but
128 * if exiting the loop early, the caller must drop the reference to the most
129 * recent root. (Unless keeping a live reference is desirable.)
130 */
131 #define for_each_tdp_mmu_root_yield_safe(_kvm, _root, _as_id) \
132 for (_root = tdp_mmu_next_root(_kvm, NULL); \
133 _root; \
134 _root = tdp_mmu_next_root(_kvm, _root)) \
135 if (kvm_mmu_page_as_id(_root) != _as_id) { \
136 } else
137
138 #define for_each_tdp_mmu_root(_kvm, _root, _as_id) \
139 list_for_each_entry_rcu(_root, &_kvm->arch.tdp_mmu_roots, link, \
140 lockdep_is_held_type(&kvm->mmu_lock, 0) || \
> 141 lockdep_is_help(&kvm->arch.tdp_mmu_pages_lock)) \
142 if (kvm_mmu_page_as_id(_root) != _as_id) { \
143 } else
144
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months