Re: [PATCH v5 24/27] mm/filemap: Convert wait_on_page_bit to wait_on_folio_bit
by kernel test robot
Hi "Matthew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20210319]
[cannot apply to linux/master linus/master hnaz-linux-mm/master v5.12-rc3 v5.12-rc2 v5.12-rc1 v5.12-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Matthew-Wilcox-Oracle/Memory-Fol...
base: f00397ee41c79b6155b9b44abd0055b2c0621349
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/39199d654ac6a6bbaba1620337574ec74...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/Memory-Folios/20210320-134732
git checkout 39199d654ac6a6bbaba1620337574ec74adee8fe
# save the attached .config to linux build tree
make 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 >>):
fs/afs/write.c: In function 'afs_page_mkwrite':
>> fs/afs/write.c:849:6: error: implicit declaration of function 'wait_on_page_bit_killable'; did you mean 'wait_on_folio_bit_killable'? [-Werror=implicit-function-declaration]
849 | wait_on_page_bit_killable(page, PG_fscache) < 0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| wait_on_folio_bit_killable
cc1: some warnings being treated as errors
vim +849 fs/afs/write.c
9b3f26c9110dce David Howells 2009-04-03 827
9b3f26c9110dce David Howells 2009-04-03 828 /*
9b3f26c9110dce David Howells 2009-04-03 829 * notification that a previously read-only page is about to become writable
9b3f26c9110dce David Howells 2009-04-03 830 * - if it returns an error, the caller will deliver a bus error signal
9b3f26c9110dce David Howells 2009-04-03 831 */
0722f186205976 Souptick Joarder 2018-08-23 832 vm_fault_t afs_page_mkwrite(struct vm_fault *vmf)
9b3f26c9110dce David Howells 2009-04-03 833 {
721597fd1aa668 David Howells 2020-10-20 834 struct page *page = thp_head(vmf->page);
1cf7a1518aefa6 David Howells 2017-11-02 835 struct file *file = vmf->vma->vm_file;
1cf7a1518aefa6 David Howells 2017-11-02 836 struct inode *inode = file_inode(file);
1cf7a1518aefa6 David Howells 2017-11-02 837 struct afs_vnode *vnode = AFS_FS_I(inode);
1cf7a1518aefa6 David Howells 2017-11-02 838 unsigned long priv;
9b3f26c9110dce David Howells 2009-04-03 839
721597fd1aa668 David Howells 2020-10-20 840 _enter("{{%llx:%llu}},{%lx}", vnode->fid.vid, vnode->fid.vnode, page->index);
9b3f26c9110dce David Howells 2009-04-03 841
1cf7a1518aefa6 David Howells 2017-11-02 842 sb_start_pagefault(inode->i_sb);
9b3f26c9110dce David Howells 2009-04-03 843
1cf7a1518aefa6 David Howells 2017-11-02 844 /* Wait for the page to be written to the cache before we allow it to
1cf7a1518aefa6 David Howells 2017-11-02 845 * be modified. We then assume the entire page will need writing back.
1cf7a1518aefa6 David Howells 2017-11-02 846 */
77837f50249aa4 David Howells 2020-02-06 847 #ifdef CONFIG_AFS_FSCACHE
721597fd1aa668 David Howells 2020-10-20 848 if (PageFsCache(page) &&
721597fd1aa668 David Howells 2020-10-20 @849 wait_on_page_bit_killable(page, PG_fscache) < 0)
77837f50249aa4 David Howells 2020-02-06 850 return VM_FAULT_RETRY;
77837f50249aa4 David Howells 2020-02-06 851 #endif
9b3f26c9110dce David Howells 2009-04-03 852
5dc1af598f0274 Matthew Wilcox (Oracle 2021-03-20 853) if (wait_on_folio_writeback_killable(page_folio(page)))
1cf7a1518aefa6 David Howells 2017-11-02 854 return VM_FAULT_RETRY;
1cf7a1518aefa6 David Howells 2017-11-02 855
721597fd1aa668 David Howells 2020-10-20 856 if (lock_page_killable(page) < 0)
1cf7a1518aefa6 David Howells 2017-11-02 857 return VM_FAULT_RETRY;
1cf7a1518aefa6 David Howells 2017-11-02 858
1cf7a1518aefa6 David Howells 2017-11-02 859 /* We mustn't change page->private until writeback is complete as that
1cf7a1518aefa6 David Howells 2017-11-02 860 * details the portion of the page we need to write back and we might
1cf7a1518aefa6 David Howells 2017-11-02 861 * need to redirty the page if there's a problem.
1cf7a1518aefa6 David Howells 2017-11-02 862 */
721597fd1aa668 David Howells 2020-10-20 863 wait_on_page_writeback(page);
1cf7a1518aefa6 David Howells 2017-11-02 864
721597fd1aa668 David Howells 2020-10-20 865 priv = afs_page_dirty(page, 0, thp_size(page));
f86726a69dec5d David Howells 2020-10-22 866 priv = afs_page_dirty_mmapped(priv);
721597fd1aa668 David Howells 2020-10-20 867 if (PagePrivate(page)) {
721597fd1aa668 David Howells 2020-10-20 868 set_page_private(page, priv);
721597fd1aa668 David Howells 2020-10-20 869 trace_afs_page_dirty(vnode, tracepoint_string("mkwrite+"), page);
721597fd1aa668 David Howells 2020-10-20 870 } else {
721597fd1aa668 David Howells 2020-10-20 871 attach_page_private(page, (void *)priv);
721597fd1aa668 David Howells 2020-10-20 872 trace_afs_page_dirty(vnode, tracepoint_string("mkwrite"), page);
721597fd1aa668 David Howells 2020-10-20 873 }
bb413489288e4e David Howells 2020-06-12 874 file_update_time(file);
1cf7a1518aefa6 David Howells 2017-11-02 875
1cf7a1518aefa6 David Howells 2017-11-02 876 sb_end_pagefault(inode->i_sb);
1cf7a1518aefa6 David Howells 2017-11-02 877 return VM_FAULT_LOCKED;
9b3f26c9110dce David Howells 2009-04-03 878 }
4343d00872e1de David Howells 2017-11-02 879
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 812da4d39463a060738008a46cfc9f775e4bfcf6
commit: 4f0e8eef772ee4438f304b2178bc28c958b6c13d riscv: Add numa support for riscv64 platform
date: 9 weeks ago
config: riscv-randconfig-r032-20210321 (attached as .config)
compiler: riscv64-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/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4f0e8eef772ee4438f304b2178bc28c958b6c13d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
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/kernel.h:10,
from include/linux/delay.h:22,
from drivers/gpu/drm/bridge/analogix/analogix-anx6345.c:9:
include/linux/scatterlist.h: In function 'sg_set_buf':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
arch/riscv/include/asm/page.h:133:62: note: each undeclared identifier is reported only once for each function it appears in
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:10,
from include/linux/delay.h:22,
from drivers/remoteproc/remoteproc_core.c:19:
include/linux/scatterlist.h: In function 'sg_set_buf':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
arch/riscv/include/asm/page.h:133:62: note: each undeclared identifier is reported only once for each function it appears in
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/riscv/include/asm/bug.h:83,
from include/linux/bug.h:5,
from arch/riscv/include/asm/cmpxchg.h:9,
from arch/riscv/include/asm/atomic.h:19,
from include/linux/atomic.h:7,
from include/linux/cpumask.h:13,
from include/linux/smp.h:13,
from arch/riscv/include/asm/mmiowb.h:12,
from arch/riscv/include/asm/mmio.h:15,
from arch/riscv/include/asm/clint.h:10,
from arch/riscv/include/asm/timex.h:15,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/remoteproc/remoteproc_core.c:21:
drivers/remoteproc/remoteproc_core.c: In function 'rproc_va_to_pa':
arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function)
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/asm-generic/bug.h:119:25: note: in definition of macro 'WARN_ON'
119 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
drivers/remoteproc/remoteproc_core.c:158:11: note: in expansion of macro 'virt_addr_valid'
158 | WARN_ON(!virt_addr_valid(cpu_addr));
| ^~~~~~~~~~~~~~~
--
In file included from include/linux/string.h:6,
from include/linux/dma-mapping.h:6,
from drivers/rpmsg/virtio_rpmsg_bus.c:14:
include/linux/scatterlist.h: In function 'sg_set_buf':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
arch/riscv/include/asm/page.h:133:62: note: each undeclared identifier is reported only once for each function it appears in
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/riscv/include/asm/bug.h:83,
from include/linux/bug.h:5,
from arch/riscv/include/asm/current.h:13,
from include/linux/sched.h:12,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/rpmsg/virtio_rpmsg_bus.c:14:
drivers/rpmsg/virtio_rpmsg_bus.c: In function 'rpmsg_sg_init':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/asm-generic/bug.h:119:25: note: in definition of macro 'WARN_ON'
119 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
drivers/rpmsg/virtio_rpmsg_bus.c:182:12: note: in expansion of macro 'virt_addr_valid'
182 | WARN_ON(!virt_addr_valid(cpu_addr));
| ^~~~~~~~~~~~~~~
--
In file included from include/linux/init.h:5,
from fs/efs/super.c:10:
include/linux/scatterlist.h: In function 'sg_set_buf':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
arch/riscv/include/asm/page.h:133:62: note: each undeclared identifier is reported only once for each function it appears in
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from fs/efs/super.c:18:
At top level:
fs/efs/efs.h:22:19: warning: 'cprt' defined but not used [-Wunused-const-variable=]
22 | static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith(a)aeschi.ch.eu.org>";
| ^~~~
--
In file included from include/linux/kernel.h:10,
from fs/orangefs/protocol.h:2,
from fs/orangefs/acl.c:8:
include/linux/scatterlist.h: In function 'sg_set_buf':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
arch/riscv/include/asm/page.h:133:62: note: each undeclared identifier is reported only once for each function it appears in
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from fs/orangefs/protocol.h:287,
from fs/orangefs/acl.c:8:
At top level:
fs/orangefs/orangefs-debug.h:86:18: warning: 'num_kmod_keyword_mask_map' defined but not used [-Wunused-const-variable=]
86 | static const int num_kmod_keyword_mask_map = (int)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:10,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/highmem.h:5,
from include/linux/bio.h:8,
from fs/btrfs/zstd.c:8:
include/linux/scatterlist.h: In function 'sg_set_buf':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
arch/riscv/include/asm/page.h:133:62: note: each undeclared identifier is reported only once for each function it appears in
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from fs/btrfs/zstd.c:19:
At top level:
include/linux/zstd.h:798:21: warning: 'ZSTD_skippableHeaderSize' defined but not used [-Wunused-const-variable=]
798 | static const size_t ZSTD_skippableHeaderSize = 8;
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/zstd.h:796:21: warning: 'ZSTD_frameHeaderSize_max' defined but not used [-Wunused-const-variable=]
796 | static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/zstd.h:795:21: warning: 'ZSTD_frameHeaderSize_min' defined but not used [-Wunused-const-variable=]
795 | static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/zstd.h:794:21: warning: 'ZSTD_frameHeaderSize_prefix' defined but not used [-Wunused-const-variable=]
794 | static const size_t ZSTD_frameHeaderSize_prefix = 5;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:10,
from include/linux/delay.h:22,
from drivers/gpu/drm/panel/panel-samsung-ld9040.c:11:
include/linux/scatterlist.h: In function 'sg_set_buf':
>> arch/riscv/include/asm/page.h:133:62: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
arch/riscv/include/asm/page.h:133:62: note: each undeclared identifier is reported only once for each function it appears in
133 | (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
| ^~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/riscv/include/asm/page.h:138:33: note: in expansion of macro 'pfn_valid'
138 | #define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
| ^~~~~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
At top level:
drivers/gpu/drm/panel/panel-samsung-ld9040.c:377:35: warning: 'ld9040_ids' defined but not used [-Wunused-const-variable=]
377 | static const struct spi_device_id ld9040_ids[] = {
| ^~~~~~~~~~
..
vim +133 arch/riscv/include/asm/page.h
07037db5d479f9 Palmer Dabbelt 2017-07-10 130
d95f1a542c3df3 Logan Gunthorpe 2019-08-28 131 #ifdef CONFIG_FLATMEM
07037db5d479f9 Palmer Dabbelt 2017-07-10 132 #define pfn_valid(pfn) \
6bd33e1ece528f Christoph Hellwig 2019-10-28 @133 (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
d95f1a542c3df3 Logan Gunthorpe 2019-08-28 134 #endif
07037db5d479f9 Palmer Dabbelt 2017-07-10 135
:::::: The code at line 133 was first introduced by commit
:::::: 6bd33e1ece528f67646db33bf97406b747dafda0 riscv: add nommu support
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Paul Walmsley <paul.walmsley(a)sifive.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
ld.lld: error: arch/riscv/built-in.a(kernel/probes/kprobes_trampoline.o):(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
by kernel test robot
CC: linux-kernel(a)vger.kernel.org
TO: Guo Ren <guoren(a)linux.alibaba.com>
CC: Palmer Dabbelt <palmerdabbelt(a)google.com>
CC: "Patrick Stählin" <me(a)packi.ch>
CC: Pekka Enberg <penberg(a)kernel.org>
Hi Guo,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 812da4d39463a060738008a46cfc9f775e4bfcf6
commit: c22b0bcb1dd024cb9caad9230e3a387d8b061df5 riscv: Add kprobes supported
date: 9 weeks ago
config: riscv-randconfig-r016-20210321 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 879760c245c898e759edab1d3318253080d79f6e)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c22b0bcb1dd024cb9caad9230e3a387d8b061df5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
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 >>):
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x8): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x3E): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x48): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x86): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x108): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/kernel/head.o:(.head.text+0x122): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x23E): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x250): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: arch/riscv/built-in.a(kernel/entry.o):(.text+0x266): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: signal.c:(.fixup+0xC): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
>> ld.lld: error: arch/riscv/built-in.a(kernel/probes/kprobes_trampoline.o):(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: fork.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: fork.c:(.fixup+0xC): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: fork.c:(.fixup+0x18): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: exit.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: exit.c:(.fixup+0xC): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: exit.c:(.fixup+0x18): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[luto:x86/kentry 1/10] kernel/sched/core.c:5394:49: error: use of undeclared identifier 'irqentry_exit_cond_resched'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/kentry
head: b0d7a5e5a9b11a6ddb50b90e31877e3cb1f93362
commit: 5dcab84f1c3db061936e3d79f78222f9e89a33e2 [1/10] kentry: Rename irqentry to kentry
config: x86_64-randconfig-a015-20210321 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 14696baaf4c43fe53f738bc292bbe169eed93d5d)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?id...
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/kentry
git checkout 5dcab84f1c3db061936e3d79f78222f9e89a33e2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 >>):
kernel/sched/core.c:2831:6: warning: no previous prototype for function 'sched_set_stop_task' [-Wmissing-prototypes]
void sched_set_stop_task(int cpu, struct task_struct *stop)
^
kernel/sched/core.c:2831:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void sched_set_stop_task(int cpu, struct task_struct *stop)
^
static
>> kernel/sched/core.c:5394:49: error: use of undeclared identifier 'irqentry_exit_cond_resched'; did you mean 'kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched);
^~~~~~~~~~~~~~~~~~~~~~~~~~
kentry_exit_cond_resched
include/linux/static_call.h:116:30: note: expanded from macro 'static_call_update'
BUILD_BUG_ON(!__same_type(*(func), STATIC_CALL_TRAMP(name))); \
^
include/linux/compiler_types.h:256:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
include/linux/build_bug.h:50:19: note: expanded from macro 'BUILD_BUG_ON'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:320:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:300:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
include/linux/entry-common.h:457:6: note: 'kentry_exit_cond_resched' declared here
void kentry_exit_cond_resched(void);
^
>> kernel/sched/core.c:5394:2: error: use of undeclared identifier '__SCT__irqentry_exit_cond_resched'; did you mean '__SCT__kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched);
^
include/linux/static_call.h:116:37: note: expanded from macro 'static_call_update'
BUILD_BUG_ON(!__same_type(*(func), STATIC_CALL_TRAMP(name))); \
^
include/linux/static_call_types.h:18:34: note: expanded from macro 'STATIC_CALL_TRAMP'
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:153:1: note: expanded from here
__SCT__irqentry_exit_cond_resched
^
include/linux/entry-common.h:459:1: note: '__SCT__kentry_exit_cond_resched' declared here
DECLARE_STATIC_CALL(kentry_exit_cond_resched, kentry_exit_cond_resched);
^
include/linux/static_call_types.h:39:22: note: expanded from macro 'DECLARE_STATIC_CALL'
extern typeof(func) STATIC_CALL_TRAMP(name);
^
include/linux/static_call_types.h:18:34: note: expanded from macro 'STATIC_CALL_TRAMP'
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:124:1: note: expanded from here
__SCT__kentry_exit_cond_resched
^
>> kernel/sched/core.c:5394:2: error: use of undeclared identifier '__SCK__irqentry_exit_cond_resched'; did you mean '__SCK__kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched);
^
include/linux/static_call.h:117:24: note: expanded from macro 'static_call_update'
__static_call_update(&STATIC_CALL_KEY(name), \
^
include/linux/static_call_types.h:12:32: note: expanded from macro 'STATIC_CALL_KEY'
#define STATIC_CALL_KEY(name) __PASTE(STATIC_CALL_KEY_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:158:1: note: expanded from here
__SCK__irqentry_exit_cond_resched
^
include/linux/entry-common.h:459:1: note: '__SCK__kentry_exit_cond_resched' declared here
DECLARE_STATIC_CALL(kentry_exit_cond_resched, kentry_exit_cond_resched);
^
include/linux/static_call_types.h:38:32: note: expanded from macro 'DECLARE_STATIC_CALL'
extern struct static_call_key STATIC_CALL_KEY(name); \
^
include/linux/static_call_types.h:12:32: note: expanded from macro 'STATIC_CALL_KEY'
#define STATIC_CALL_KEY(name) __PASTE(STATIC_CALL_KEY_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:123:1: note: expanded from here
__SCK__kentry_exit_cond_resched
^
>> kernel/sched/core.c:5394:2: error: use of undeclared identifier '__SCT__irqentry_exit_cond_resched'; did you mean '__SCT__kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched);
^
include/linux/static_call.h:118:9: note: expanded from macro 'static_call_update'
STATIC_CALL_TRAMP_ADDR(name), func); \
^
include/linux/static_call.h:108:39: note: expanded from macro 'STATIC_CALL_TRAMP_ADDR'
#define STATIC_CALL_TRAMP_ADDR(name) &STATIC_CALL_TRAMP(name)
^
include/linux/static_call_types.h:18:34: note: expanded from macro 'STATIC_CALL_TRAMP'
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:159:1: note: expanded from here
__SCT__irqentry_exit_cond_resched
^
include/linux/entry-common.h:459:1: note: '__SCT__kentry_exit_cond_resched' declared here
DECLARE_STATIC_CALL(kentry_exit_cond_resched, kentry_exit_cond_resched);
^
include/linux/static_call_types.h:39:22: note: expanded from macro 'DECLARE_STATIC_CALL'
extern typeof(func) STATIC_CALL_TRAMP(name);
^
include/linux/static_call_types.h:18:34: note: expanded from macro 'STATIC_CALL_TRAMP'
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:124:1: note: expanded from here
__SCT__kentry_exit_cond_resched
^
>> kernel/sched/core.c:5394:49: error: use of undeclared identifier 'irqentry_exit_cond_resched'; did you mean 'kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched);
^~~~~~~~~~~~~~~~~~~~~~~~~~
kentry_exit_cond_resched
include/linux/static_call.h:118:39: note: expanded from macro 'static_call_update'
STATIC_CALL_TRAMP_ADDR(name), func); \
^
include/linux/entry-common.h:457:6: note: 'kentry_exit_cond_resched' declared here
void kentry_exit_cond_resched(void);
^
kernel/sched/core.c:5402:59: error: use of undeclared identifier 'irqentry_exit_cond_resched'; did you mean 'kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, (typeof(&irqentry_exit_cond_resched)) NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~
kentry_exit_cond_resched
include/linux/static_call.h:116:30: note: expanded from macro 'static_call_update'
BUILD_BUG_ON(!__same_type(*(func), STATIC_CALL_TRAMP(name))); \
^
include/linux/compiler_types.h:256:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
include/linux/build_bug.h:50:19: note: expanded from macro 'BUILD_BUG_ON'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:320:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:300:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
include/linux/entry-common.h:457:6: note: 'kentry_exit_cond_resched' declared here
void kentry_exit_cond_resched(void);
^
kernel/sched/core.c:5402:3: error: use of undeclared identifier '__SCT__irqentry_exit_cond_resched'; did you mean '__SCT__kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, (typeof(&irqentry_exit_cond_resched)) NULL);
^
include/linux/static_call.h:116:37: note: expanded from macro 'static_call_update'
BUILD_BUG_ON(!__same_type(*(func), STATIC_CALL_TRAMP(name))); \
^
include/linux/static_call_types.h:18:34: note: expanded from macro 'STATIC_CALL_TRAMP'
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:30:1: note: expanded from here
__SCT__irqentry_exit_cond_resched
^
include/linux/entry-common.h:459:1: note: '__SCT__kentry_exit_cond_resched' declared here
DECLARE_STATIC_CALL(kentry_exit_cond_resched, kentry_exit_cond_resched);
^
include/linux/static_call_types.h:39:22: note: expanded from macro 'DECLARE_STATIC_CALL'
extern typeof(func) STATIC_CALL_TRAMP(name);
^
include/linux/static_call_types.h:18:34: note: expanded from macro 'STATIC_CALL_TRAMP'
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:124:1: note: expanded from here
__SCT__kentry_exit_cond_resched
^
kernel/sched/core.c:5402:59: error: use of undeclared identifier 'irqentry_exit_cond_resched'; did you mean 'kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, (typeof(&irqentry_exit_cond_resched)) NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~
kentry_exit_cond_resched
include/linux/static_call.h:118:39: note: expanded from macro 'static_call_update'
STATIC_CALL_TRAMP_ADDR(name), func); \
^
include/linux/entry-common.h:457:6: note: 'kentry_exit_cond_resched' declared here
void kentry_exit_cond_resched(void);
^
kernel/sched/core.c:5402:3: error: use of undeclared identifier '__SCK__irqentry_exit_cond_resched'; did you mean '__SCK__kentry_exit_cond_resched'?
static_call_update(irqentry_exit_cond_resched, (typeof(&irqentry_exit_cond_resched)) NULL);
^
include/linux/static_call.h:117:24: note: expanded from macro 'static_call_update'
__static_call_update(&STATIC_CALL_KEY(name), \
^
include/linux/static_call_types.h:12:32: note: expanded from macro 'STATIC_CALL_KEY'
#define STATIC_CALL_KEY(name) __PASTE(STATIC_CALL_KEY_PREFIX, name)
^
include/linux/compiler_types.h:60:22: note: expanded from macro '__PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^
include/linux/compiler_types.h:59:23: note: expanded from macro '___PASTE'
#define ___PASTE(a,b) a##b
^
<scratch space>:35:1: note: expanded from here
__SCK__irqentry_exit_cond_resched
^
include/linux/entry-common.h:459:1: note: '__SCK__kentry_exit_cond_resched' declared here
vim +5394 kernel/sched/core.c
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5383
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5384 static void sched_dynamic_update(int mode)
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5385) {
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5386 /*
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5387 * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5388 * the ZERO state, which is invalid.
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5389 */
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5390 static_call_update(cond_resched, __cond_resched);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5391 static_call_update(might_resched, __cond_resched);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5392 static_call_update(preempt_schedule, __preempt_schedule_func);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5393 static_call_update(preempt_schedule_notrace, __preempt_schedule_notrace_func);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 @5394 static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5395
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5396 switch (mode) {
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5397 case preempt_dynamic_none:
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5398) static_call_update(cond_resched, __cond_resched);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5399) static_call_update(might_resched, (typeof(&__cond_resched)) __static_call_return0);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5400) static_call_update(preempt_schedule, (typeof(&preempt_schedule)) NULL);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5401) static_call_update(preempt_schedule_notrace, (typeof(&preempt_schedule_notrace)) NULL);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5402) static_call_update(irqentry_exit_cond_resched, (typeof(&irqentry_exit_cond_resched)) NULL);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5403 pr_info("Dynamic Preempt: none\n");
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5404 break;
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5405
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5406 case preempt_dynamic_voluntary:
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5407) static_call_update(cond_resched, __cond_resched);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5408) static_call_update(might_resched, __cond_resched);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5409) static_call_update(preempt_schedule, (typeof(&preempt_schedule)) NULL);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5410) static_call_update(preempt_schedule_notrace, (typeof(&preempt_schedule_notrace)) NULL);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5411) static_call_update(irqentry_exit_cond_resched, (typeof(&irqentry_exit_cond_resched)) NULL);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5412 pr_info("Dynamic Preempt: voluntary\n");
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5413 break;
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5414
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5415 case preempt_dynamic_full:
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5416) static_call_update(cond_resched, (typeof(&__cond_resched)) __static_call_return0);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5417) static_call_update(might_resched, (typeof(&__cond_resched)) __static_call_return0);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5418) static_call_update(preempt_schedule, __preempt_schedule_func);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5419) static_call_update(preempt_schedule_notrace, __preempt_schedule_notrace_func);
826bfeb37bb430 Peter Zijlstra (Intel 2021-01-18 5420) static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched);
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5421 pr_info("Dynamic Preempt: full\n");
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5422 break;
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5423 }
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5424
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5425 preempt_dynamic_mode = mode;
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5426 }
e59e10f8ef63d4 Peter Zijlstra 2021-01-22 5427
:::::: The code at line 5394 was first introduced by commit
:::::: e59e10f8ef63d42fbb99776a5a112841e798b3b5 sched: Add /debug/sched_preempt
:::::: TO: Peter Zijlstra <peterz(a)infradead.org>
:::::: 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, 6 months
[luto:x86/fixes 6/13] arch/x86/mm/tlb.c:537:36: error: no member named 'membarrier_state' in 'struct mm_struct'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/fixes
head: 825cc79966034d2ab820a693fcb3b84565edd715
commit: 1efb7df703ce743e6d78c978ccabc0e0e787b4ea [6/13] x86/mm: Handle unlazying membarrier core sync in the arch code
config: x86_64-randconfig-a014-20210321 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 14696baaf4c43fe53f738bc292bbe169eed93d5d)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?id...
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/fixes
git checkout 1efb7df703ce743e6d78c978ccabc0e0e787b4ea
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 >>):
>> arch/x86/mm/tlb.c:537:36: error: no member named 'membarrier_state' in 'struct mm_struct'
if (unlikely(atomic_read(&next->membarrier_state) &
~~~~ ^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
>> arch/x86/mm/tlb.c:538:10: error: use of undeclared identifier 'MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE'
MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE))
^
2 errors generated.
vim +537 arch/x86/mm/tlb.c
422
423 void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
424 struct task_struct *tsk)
425 {
426 struct mm_struct *real_prev = this_cpu_read(cpu_tlbstate.loaded_mm);
427 u16 prev_asid = this_cpu_read(cpu_tlbstate.loaded_mm_asid);
428 bool was_lazy = this_cpu_read(cpu_tlbstate.is_lazy);
429 unsigned cpu = smp_processor_id();
430 u64 next_tlb_gen;
431 bool need_flush;
432 u16 new_asid;
433
434 /*
435 * NB: The scheduler will call us with prev == next when switching
436 * from lazy TLB mode to normal mode if active_mm isn't changing.
437 * When this happens, we don't assume that CR3 (and hence
438 * cpu_tlbstate.loaded_mm) matches next.
439 *
440 * NB: leave_mm() calls us with prev == NULL and tsk == NULL.
441 */
442
443 /* We don't want flush_tlb_func_* to run concurrently with us. */
444 if (IS_ENABLED(CONFIG_PROVE_LOCKING))
445 WARN_ON_ONCE(!irqs_disabled());
446
447 /*
448 * Verify that CR3 is what we think it is. This will catch
449 * hypothetical buggy code that directly switches to swapper_pg_dir
450 * without going through leave_mm() / switch_mm_irqs_off() or that
451 * does something like write_cr3(read_cr3_pa()).
452 *
453 * Only do this check if CONFIG_DEBUG_VM=y because __read_cr3()
454 * isn't free.
455 */
456 #ifdef CONFIG_DEBUG_VM
457 if (WARN_ON_ONCE(__read_cr3() != build_cr3(real_prev->pgd, prev_asid))) {
458 /*
459 * If we were to BUG here, we'd be very likely to kill
460 * the system so hard that we don't see the call trace.
461 * Try to recover instead by ignoring the error and doing
462 * a global flush to minimize the chance of corruption.
463 *
464 * (This is far from being a fully correct recovery.
465 * Architecturally, the CPU could prefetch something
466 * back into an incorrect ASID slot and leave it there
467 * to cause trouble down the road. It's better than
468 * nothing, though.)
469 */
470 __flush_tlb_all();
471 }
472 #endif
473 this_cpu_write(cpu_tlbstate.is_lazy, false);
474
475 /*
476 * membarrier() support requires that, when we change rq->curr->mm:
477 *
478 * - If next->mm has membarrier registered, a full memory barrier
479 * after writing rq->curr (or rq->curr->mm if we switched the mm
480 * without switching tasks) and before returning to user mode.
481 *
482 * - If next->mm has SYNC_CORE registered, then we sync core before
483 * returning to user mode.
484 *
485 * In the case where prev->mm == next->mm, membarrier() uses an IPI
486 * instead, and no particular barriers are needed while context
487 * switching.
488 *
489 * x86 gets all of this as a side-effect of writing to CR3 except
490 * in the case where we unlazy without flushing.
491 *
492 * All other architectures are civilized and do all of this implicitly
493 * when transitioning from kernel to user mode.
494 */
495 if (real_prev == next) {
496 VM_WARN_ON(this_cpu_read(cpu_tlbstate.ctxs[prev_asid].ctx_id) !=
497 next->context.ctx_id);
498
499 /*
500 * Even in lazy TLB mode, the CPU should stay set in the
501 * mm_cpumask. The TLB shootdown code can figure out from
502 * from cpu_tlbstate.is_lazy whether or not to send an IPI.
503 */
504 if (WARN_ON_ONCE(real_prev != &init_mm &&
505 !cpumask_test_cpu(cpu, mm_cpumask(next))))
506 cpumask_set_cpu(cpu, mm_cpumask(next));
507
508 /*
509 * If the CPU is not in lazy TLB mode, we are just switching
510 * from one thread in a process to another thread in the same
511 * process. No TLB flush or membarrier() synchronization
512 * is required.
513 */
514 if (!was_lazy)
515 return;
516
517 /*
518 * Read the tlb_gen to check whether a flush is needed.
519 * If the TLB is up to date, just use it.
520 * The barrier synchronizes with the tlb_gen increment in
521 * the TLB shootdown code.
522 *
523 * As a future optimization opportunity, it's plausible
524 * that the x86 memory model is strong enough that this
525 * smp_mb() isn't needed.
526 */
527 smp_mb();
528 next_tlb_gen = atomic64_read(&next->context.tlb_gen);
529 if (this_cpu_read(cpu_tlbstate.ctxs[prev_asid].tlb_gen) ==
530 next_tlb_gen) {
531 /*
532 * We switched logical mm but we're not going to
533 * write to CR3. We already did smp_mb() above,
534 * but membarrier() might require a sync_core()
535 * as well.
536 */
> 537 if (unlikely(atomic_read(&next->membarrier_state) &
> 538 MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE))
539 sync_core_before_usermode();
540
541 return;
542 }
543
544 /*
545 * TLB contents went out of date while we were in lazy
546 * mode. Fall through to the TLB switching code below.
547 * No need for an explicit membarrier invocation -- the CR3
548 * write will serialize.
549 */
550 new_asid = prev_asid;
551 need_flush = true;
552 } else {
553 /*
554 * Avoid user/user BTB poisoning by flushing the branch
555 * predictor when switching between processes. This stops
556 * one process from doing Spectre-v2 attacks on another.
557 */
558 cond_ibpb(tsk);
559
560 /*
561 * Stop remote flushes for the previous mm.
562 * Skip kernel threads; we never send init_mm TLB flushing IPIs,
563 * but the bitmap manipulation can cause cache line contention.
564 */
565 if (real_prev != &init_mm) {
566 VM_WARN_ON_ONCE(!cpumask_test_cpu(cpu,
567 mm_cpumask(real_prev)));
568 cpumask_clear_cpu(cpu, mm_cpumask(real_prev));
569 }
570
571 /*
572 * Start remote flushes and then read tlb_gen.
573 */
574 if (next != &init_mm)
575 cpumask_set_cpu(cpu, mm_cpumask(next));
576 next_tlb_gen = atomic64_read(&next->context.tlb_gen);
577
578 choose_new_asid(next, next_tlb_gen, &new_asid, &need_flush);
579
580 /* Let nmi_uaccess_okay() know that we're changing CR3. */
581 this_cpu_write(cpu_tlbstate.loaded_mm, LOADED_MM_SWITCHING);
582 barrier();
583 }
584
585 if (need_flush) {
586 this_cpu_write(cpu_tlbstate.ctxs[new_asid].ctx_id, next->context.ctx_id);
587 this_cpu_write(cpu_tlbstate.ctxs[new_asid].tlb_gen, next_tlb_gen);
588 load_new_mm_cr3(next->pgd, new_asid, true);
589
590 trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
591 } else {
592 /* The new ASID is already up to date. */
593 load_new_mm_cr3(next->pgd, new_asid, false);
594
595 trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, 0);
596 }
597
598 /* Make sure we write CR3 before loaded_mm. */
599 barrier();
600
601 this_cpu_write(cpu_tlbstate.loaded_mm, next);
602 this_cpu_write(cpu_tlbstate.loaded_mm_asid, new_asid);
603
604 if (next != real_prev) {
605 cr4_update_pce_mm(next);
606 switch_ldt(real_prev, next);
607 }
608 }
609
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[luto:x86/kentry 6/10] arch/s390/kernel/traps.c:349:3: error: implicit declaration of function 'enter_from_user_mode'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/kentry
head: b0d7a5e5a9b11a6ddb50b90e31877e3cb1f93362
commit: e2bd5fab359ea464f6268bfaca18c3c0344edf33 [6/10] kentry: Remove enter_from/exit_to_user_mode()
config: s390-randconfig-r011-20210321 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 14696baaf4c43fe53f738bc292bbe169eed93d5d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?id...
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/kentry
git checkout e2bd5fab359ea464f6268bfaca18c3c0344edf33
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/s390/kernel/traps.c:28:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from arch/s390/kernel/traps.c:28:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from arch/s390/kernel/traps.c:28:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
arch/s390/kernel/traps.c:300:2: error: unknown type name 'irqentry_state_t'; did you mean 'kentry_state_t'?
irqentry_state_t state;
^~~~~~~~~~~~~~~~
kentry_state_t
include/linux/entry-common.h:315:3: note: 'kentry_state_t' declared here
} kentry_state_t;
^
arch/s390/kernel/traps.c:305:10: error: implicit declaration of function 'irqentry_enter' [-Werror,-Wimplicit-function-declaration]
state = irqentry_enter(regs);
^
arch/s390/kernel/traps.c:305:10: note: did you mean 'kentry_enter'?
include/linux/entry-common.h:349:24: note: 'kentry_enter' declared here
kentry_state_t noinstr kentry_enter(struct pt_regs *regs);
^
arch/s390/kernel/traps.c:305:8: error: assigning to 'kentry_state_t' (aka 'struct kentry_state') from incompatible type 'int'
state = irqentry_enter(regs);
^ ~~~~~~~~~~~~~~~~~~~~
arch/s390/kernel/traps.c:346:2: error: implicit declaration of function 'irqentry_exit' [-Werror,-Wimplicit-function-declaration]
irqentry_exit(regs, state);
^
arch/s390/kernel/traps.c:346:2: note: did you mean 'kentry_exit'?
include/linux/entry-common.h:375:14: note: 'kentry_exit' declared here
void noinstr kentry_exit(struct pt_regs *regs, kentry_state_t state);
^
>> arch/s390/kernel/traps.c:349:3: error: implicit declaration of function 'enter_from_user_mode' [-Werror,-Wimplicit-function-declaration]
enter_from_user_mode(regs);
^
>> arch/s390/kernel/traps.c:353:3: error: implicit declaration of function 'exit_to_user_mode' [-Werror,-Wimplicit-function-declaration]
exit_to_user_mode();
^
arch/s390/kernel/traps.c:353:3: note: did you mean 'arch_exit_to_user_mode'?
include/linux/entry-common.h:211:29: note: 'arch_exit_to_user_mode' declared here
static __always_inline void arch_exit_to_user_mode(void);
^
arch/s390/include/asm/entry-common.h:53:32: note: expanded from macro 'arch_exit_to_user_mode'
#define arch_exit_to_user_mode arch_exit_to_user_mode
^
12 warnings and 6 errors generated.
--
In file included from arch/s390/kernel/syscall.c:34:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from arch/s390/kernel/syscall.c:34:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from arch/s390/kernel/syscall.c:34:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
arch/s390/kernel/syscall.c:124:7: error: implicit declaration of function 'syscall_enter_from_user_mode_work' [-Werror,-Wimplicit-function-declaration]
nr = syscall_enter_from_user_mode_work(regs, nr);
^
arch/s390/kernel/syscall.c:140:2: error: implicit declaration of function 'syscall_exit_to_user_mode_work' [-Werror,-Wimplicit-function-declaration]
syscall_exit_to_user_mode_work(regs);
^
arch/s390/kernel/syscall.c:140:2: note: did you mean 'arch_exit_to_user_mode_work'?
include/linux/entry-common.h:169:20: note: 'arch_exit_to_user_mode_work' declared here
static inline void arch_exit_to_user_mode_work(struct pt_regs *regs,
^
arch/s390/include/asm/entry-common.h:42:37: note: expanded from macro 'arch_exit_to_user_mode_work'
#define arch_exit_to_user_mode_work arch_exit_to_user_mode_work
^
>> arch/s390/kernel/syscall.c:145:2: error: implicit declaration of function 'enter_from_user_mode' [-Werror,-Wimplicit-function-declaration]
enter_from_user_mode(regs);
^
>> arch/s390/kernel/syscall.c:167:2: error: implicit declaration of function 'exit_to_user_mode' [-Werror,-Wimplicit-function-declaration]
exit_to_user_mode();
^
arch/s390/kernel/syscall.c:167:2: note: did you mean 'arch_exit_to_user_mode'?
include/linux/entry-common.h:211:29: note: 'arch_exit_to_user_mode' declared here
static __always_inline void arch_exit_to_user_mode(void);
^
arch/s390/include/asm/entry-common.h:53:32: note: expanded from macro 'arch_exit_to_user_mode'
#define arch_exit_to_user_mode arch_exit_to_user_mode
^
12 warnings and 4 errors generated.
vim +/enter_from_user_mode +349 arch/s390/kernel/traps.c
56e62a73702836 Sven Schnelle 2020-11-21 295
56e62a73702836 Sven Schnelle 2020-11-21 296 void noinstr __do_pgm_check(struct pt_regs *regs)
56e62a73702836 Sven Schnelle 2020-11-21 297 {
56e62a73702836 Sven Schnelle 2020-11-21 298 unsigned long last_break = S390_lowcore.breaking_event_addr;
56e62a73702836 Sven Schnelle 2020-11-21 299 unsigned int trapnr, syscall_redirect = 0;
56e62a73702836 Sven Schnelle 2020-11-21 300 irqentry_state_t state;
56e62a73702836 Sven Schnelle 2020-11-21 301
56e62a73702836 Sven Schnelle 2020-11-21 302 regs->int_code = *(u32 *)&S390_lowcore.pgm_ilc;
56e62a73702836 Sven Schnelle 2020-11-21 303 regs->int_parm_long = S390_lowcore.trans_exc_code;
56e62a73702836 Sven Schnelle 2020-11-21 304
56e62a73702836 Sven Schnelle 2020-11-21 305 state = irqentry_enter(regs);
56e62a73702836 Sven Schnelle 2020-11-21 306
56e62a73702836 Sven Schnelle 2020-11-21 307 if (user_mode(regs)) {
56e62a73702836 Sven Schnelle 2020-11-21 308 update_timer_sys();
56e62a73702836 Sven Schnelle 2020-11-21 309 if (last_break < 4096)
56e62a73702836 Sven Schnelle 2020-11-21 310 last_break = 1;
56e62a73702836 Sven Schnelle 2020-11-21 311 current->thread.last_break = last_break;
56e62a73702836 Sven Schnelle 2020-11-21 312 regs->args[0] = last_break;
56e62a73702836 Sven Schnelle 2020-11-21 313 }
56e62a73702836 Sven Schnelle 2020-11-21 314
56e62a73702836 Sven Schnelle 2020-11-21 315 if (S390_lowcore.pgm_code & 0x0200) {
56e62a73702836 Sven Schnelle 2020-11-21 316 /* transaction abort */
56e62a73702836 Sven Schnelle 2020-11-21 317 memcpy(¤t->thread.trap_tdb, &S390_lowcore.pgm_tdb, 256);
56e62a73702836 Sven Schnelle 2020-11-21 318 }
56e62a73702836 Sven Schnelle 2020-11-21 319
56e62a73702836 Sven Schnelle 2020-11-21 320 if (S390_lowcore.pgm_code & PGM_INT_CODE_PER) {
56e62a73702836 Sven Schnelle 2020-11-21 321 if (user_mode(regs)) {
56e62a73702836 Sven Schnelle 2020-11-21 322 struct per_event *ev = ¤t->thread.per_event;
56e62a73702836 Sven Schnelle 2020-11-21 323
56e62a73702836 Sven Schnelle 2020-11-21 324 set_thread_flag(TIF_PER_TRAP);
56e62a73702836 Sven Schnelle 2020-11-21 325 ev->address = S390_lowcore.per_address;
56e62a73702836 Sven Schnelle 2020-11-21 326 ev->cause = *(u16 *)&S390_lowcore.per_code;
56e62a73702836 Sven Schnelle 2020-11-21 327 ev->paid = S390_lowcore.per_access_id;
56e62a73702836 Sven Schnelle 2020-11-21 328 } else {
56e62a73702836 Sven Schnelle 2020-11-21 329 /* PER event in kernel is kprobes */
56e62a73702836 Sven Schnelle 2020-11-21 330 __arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);
56e62a73702836 Sven Schnelle 2020-11-21 331 do_per_trap(regs);
56e62a73702836 Sven Schnelle 2020-11-21 332 goto out;
56e62a73702836 Sven Schnelle 2020-11-21 333 }
56e62a73702836 Sven Schnelle 2020-11-21 334 }
56e62a73702836 Sven Schnelle 2020-11-21 335
56e62a73702836 Sven Schnelle 2020-11-21 336 if (!irqs_disabled_flags(regs->psw.mask))
56e62a73702836 Sven Schnelle 2020-11-21 337 trace_hardirqs_on();
56e62a73702836 Sven Schnelle 2020-11-21 338 __arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);
56e62a73702836 Sven Schnelle 2020-11-21 339
56e62a73702836 Sven Schnelle 2020-11-21 340 trapnr = regs->int_code & PGM_INT_CODE_MASK;
56e62a73702836 Sven Schnelle 2020-11-21 341 if (trapnr)
56e62a73702836 Sven Schnelle 2020-11-21 342 pgm_check_table[trapnr](regs);
56e62a73702836 Sven Schnelle 2020-11-21 343 syscall_redirect = user_mode(regs) && test_pt_regs_flag(regs, PIF_SYSCALL);
56e62a73702836 Sven Schnelle 2020-11-21 344 out:
56e62a73702836 Sven Schnelle 2020-11-21 345 local_irq_disable();
56e62a73702836 Sven Schnelle 2020-11-21 346 irqentry_exit(regs, state);
56e62a73702836 Sven Schnelle 2020-11-21 347
56e62a73702836 Sven Schnelle 2020-11-21 348 if (syscall_redirect) {
56e62a73702836 Sven Schnelle 2020-11-21 @349 enter_from_user_mode(regs);
56e62a73702836 Sven Schnelle 2020-11-21 350 local_irq_enable();
56e62a73702836 Sven Schnelle 2020-11-21 351 regs->orig_gpr2 = regs->gprs[2];
56e62a73702836 Sven Schnelle 2020-11-21 352 do_syscall(regs);
56e62a73702836 Sven Schnelle 2020-11-21 @353 exit_to_user_mode();
:::::: The code at line 349 was first introduced by commit
:::::: 56e62a73702836017564eaacd5212e4d0fa1c01d s390: convert to generic entry
:::::: TO: Sven Schnelle <svens(a)linux.ibm.com>
:::::: CC: Vasily Gorbik <gor(a)linux.ibm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[luto:x86/fixes 8/13] kernel/kthread.c:1306:2: error: implicit declaration of function 'membarrier_finish_switch_mm'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/fixes
head: 825cc79966034d2ab820a693fcb3b84565edd715
commit: 2fa01daa924b6f5b2ed073acb27574b11e7c3e74 [8/13] membarrier: Make the post-switch-mm barrier explicit
config: h8300-randconfig-m031-20210321 (attached as .config)
compiler: h8300-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/luto/linux.git/commit/?id...
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/fixes
git checkout 2fa01daa924b6f5b2ed073acb27574b11e7c3e74
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
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 >>):
kernel/kthread.c: In function 'kthread_use_mm':
>> kernel/kthread.c:1306:2: error: implicit declaration of function 'membarrier_finish_switch_mm' [-Werror=implicit-function-declaration]
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
>> kernel/kthread.c:1306:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
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/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/h8300/include/asm/atomic.h:15:25: note: in expansion of macro 'READ_ONCE'
15 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1306:30: note: in expansion of macro 'atomic_read'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1306:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
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/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/h8300/include/asm/atomic.h:15:25: note: in expansion of macro 'READ_ONCE'
15 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1306:30: note: in expansion of macro 'atomic_read'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1306:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
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/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/h8300/include/asm/atomic.h:15:25: note: in expansion of macro 'READ_ONCE'
15 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1306:30: note: in expansion of macro 'atomic_read'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1306:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
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/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/h8300/include/asm/atomic.h:15:25: note: in expansion of macro 'READ_ONCE'
15 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1306:30: note: in expansion of macro 'atomic_read'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1306:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
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/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/h8300/include/asm/atomic.h:15:25: note: in expansion of macro 'READ_ONCE'
15 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1306:30: note: in expansion of macro 'atomic_read'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
>> kernel/kthread.c:1306:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:271:13: note: in definition of macro '__unqual_scalar_typeof'
271 | _Generic((x), \
| ^
include/asm-generic/rwonce.h:50:2: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
arch/h8300/include/asm/atomic.h:15:25: note: in expansion of macro 'READ_ONCE'
15 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1306:30: note: in expansion of macro 'atomic_read'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
In file included from ./arch/h8300/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:248,
from include/asm-generic/bug.h:5,
from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from kernel/kthread.c:11:
>> kernel/kthread.c:1306:45: error: 'struct mm_struct' has no member named 'membarrier_state'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/asm-generic/rwonce.h:44:72: note: in definition of macro '__READ_ONCE'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
arch/h8300/include/asm/atomic.h:15:25: note: in expansion of macro 'READ_ONCE'
15 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1306:30: note: in expansion of macro 'atomic_read'
1306 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from include/linux/err.h:5,
from include/linux/kthread.h:5,
from include/trace/events/sched.h:8,
from kernel/sched/core.c:10:
include/linux/scatterlist.h: In function 'sg_set_buf':
include/asm-generic/page.h:89:50: warning: ordered comparison of pointer with null pointer [-Wextra]
89 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
kernel/sched/core.c: In function 'schedule_tail':
kernel/sched/core.c:4235:13: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
4235 | struct rq *rq;
| ^~
kernel/sched/core.c: In function 'context_switch':
>> kernel/sched/core.c:4295:3: error: implicit declaration of function 'membarrier_finish_switch_mm'; did you mean 'membarrier_switch_mm'? [-Werror=implicit-function-declaration]
4295 | membarrier_finish_switch_mm(rq->membarrier_state);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| membarrier_switch_mm
>> kernel/sched/core.c:4295:33: error: 'struct rq' has no member named 'membarrier_state'
4295 | membarrier_finish_switch_mm(rq->membarrier_state);
| ^~
cc1: some warnings being treated as errors
vim +/membarrier_finish_switch_mm +1306 kernel/kthread.c
1282
1283 /**
1284 * kthread_use_mm - make the calling kthread operate on an address space
1285 * @mm: address space to operate on
1286 */
1287 void kthread_use_mm(struct mm_struct *mm)
1288 {
1289 struct mm_struct *active_mm;
1290 struct task_struct *tsk = current;
1291
1292 WARN_ON_ONCE(!(tsk->flags & PF_KTHREAD));
1293 WARN_ON_ONCE(tsk->mm);
1294
1295 task_lock(tsk);
1296 /* Hold off tlb flush IPIs while switching mm's */
1297 local_irq_disable();
1298 active_mm = tsk->active_mm;
1299 if (active_mm != mm) {
1300 mmgrab(mm);
1301 tsk->active_mm = mm;
1302 }
1303 tsk->mm = mm;
1304 membarrier_update_current_mm(mm);
1305 switch_mm_irqs_off(active_mm, mm, tsk);
> 1306 membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
1307 local_irq_enable();
1308 task_unlock(tsk);
1309 #ifdef finish_arch_post_lock_switch
1310 finish_arch_post_lock_switch();
1311 #endif
1312
1313 if (active_mm != mm)
1314 mmdrop(active_mm);
1315
1316 to_kthread(tsk)->oldfs = force_uaccess_begin();
1317 }
1318 EXPORT_SYMBOL_GPL(kthread_use_mm);
1319
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[luto:x86/kentry 5/10] arch/s390/kernel/process.c:61:2: error: implicit declaration of function 'syscall_exit_to_user_mode'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/kentry
head: b0d7a5e5a9b11a6ddb50b90e31877e3cb1f93362
commit: d37c90c782b1cca1fc4f936480dd01dda7f72a88 [5/10] kentry: Simplify the common syscall API
config: s390-randconfig-r011-20210321 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 14696baaf4c43fe53f738bc292bbe169eed93d5d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?id...
git remote add luto https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/kentry
git checkout d37c90c782b1cca1fc4f936480dd01dda7f72a88
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/s390/kernel/process.c:24:
In file included from include/linux/tick.h:8:
In file included from include/linux/clockchips.h:14:
In file included from include/linux/clocksource.h:21:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from arch/s390/kernel/process.c:24:
In file included from include/linux/tick.h:8:
In file included from include/linux/clockchips.h:14:
In file included from include/linux/clocksource.h:21:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from arch/s390/kernel/process.c:24:
In file included from include/linux/tick.h:8:
In file included from include/linux/clockchips.h:14:
In file included from include/linux/clocksource.h:21:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> arch/s390/kernel/process.c:61:2: error: implicit declaration of function 'syscall_exit_to_user_mode' [-Werror,-Wimplicit-function-declaration]
syscall_exit_to_user_mode(regs);
^
arch/s390/kernel/process.c:61:2: note: did you mean 'arch_exit_to_user_mode'?
include/linux/entry-common.h:232:29: note: 'arch_exit_to_user_mode' declared here
static __always_inline void arch_exit_to_user_mode(void);
^
arch/s390/include/asm/entry-common.h:53:32: note: expanded from macro 'arch_exit_to_user_mode'
#define arch_exit_to_user_mode arch_exit_to_user_mode
^
12 warnings and 1 error generated.
--
In file included from arch/s390/kernel/syscall.c:34:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from arch/s390/kernel/syscall.c:34:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from arch/s390/kernel/syscall.c:34:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> arch/s390/kernel/syscall.c:124:7: error: implicit declaration of function 'syscall_enter_from_user_mode_work' [-Werror,-Wimplicit-function-declaration]
nr = syscall_enter_from_user_mode_work(regs, nr);
^
>> arch/s390/kernel/syscall.c:140:2: error: implicit declaration of function 'syscall_exit_to_user_mode_work' [-Werror,-Wimplicit-function-declaration]
syscall_exit_to_user_mode_work(regs);
^
arch/s390/kernel/syscall.c:140:2: note: did you mean 'arch_exit_to_user_mode_work'?
include/linux/entry-common.h:190:20: note: 'arch_exit_to_user_mode_work' declared here
static inline void arch_exit_to_user_mode_work(struct pt_regs *regs,
^
arch/s390/include/asm/entry-common.h:42:37: note: expanded from macro 'arch_exit_to_user_mode_work'
#define arch_exit_to_user_mode_work arch_exit_to_user_mode_work
^
12 warnings and 2 errors generated.
vim +/syscall_exit_to_user_mode +61 arch/s390/kernel/process.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 48
56e62a73702836 Sven Schnelle 2020-11-21 49 void __ret_from_fork(struct task_struct *prev, struct pt_regs *regs)
56e62a73702836 Sven Schnelle 2020-11-21 50 {
56e62a73702836 Sven Schnelle 2020-11-21 51 void (*func)(void *arg);
56e62a73702836 Sven Schnelle 2020-11-21 52
56e62a73702836 Sven Schnelle 2020-11-21 53 schedule_tail(prev);
56e62a73702836 Sven Schnelle 2020-11-21 54
56e62a73702836 Sven Schnelle 2020-11-21 55 if (!user_mode(regs)) {
56e62a73702836 Sven Schnelle 2020-11-21 56 /* Kernel thread */
56e62a73702836 Sven Schnelle 2020-11-21 57 func = (void *)regs->gprs[9];
56e62a73702836 Sven Schnelle 2020-11-21 58 func((void *)regs->gprs[10]);
56e62a73702836 Sven Schnelle 2020-11-21 59 }
56e62a73702836 Sven Schnelle 2020-11-21 60 clear_pt_regs_flag(regs, PIF_SYSCALL);
56e62a73702836 Sven Schnelle 2020-11-21 @61 syscall_exit_to_user_mode(regs);
56e62a73702836 Sven Schnelle 2020-11-21 62 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 63
:::::: The code at line 61 was first introduced by commit
:::::: 56e62a73702836017564eaacd5212e4d0fa1c01d s390: convert to generic entry
:::::: TO: Sven Schnelle <svens(a)linux.ibm.com>
:::::: CC: Vasily Gorbik <gor(a)linux.ibm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months