tree:
https://github.com/zen-kernel/zen-kernel 5.13/futex2
head: db649ce1f5de12432be5bfedd8388eacc2f85efc
commit: 28d2f243eaf76b0e9d84947a899fc742bd49d70c [3/19] futex2: Implement vectorized wait
config: sparc64-randconfig-r034-20210718 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/zen-kernel/zen-kernel/commit/28d2f243eaf76b0e9d84947a8...
git remote add zen-kernel-zen-kernel
https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen-kernel-zen-kernel 5.13/futex2
git checkout 28d2f243eaf76b0e9d84947a899fc742bd49d70c
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir
ARCH=sparc64 SHELL=/bin/bash
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/futex2.c: In function 'futex_get_shared_key':
kernel/futex2.c:307:31: error: implicit declaration of function
'basepage_index'; did you mean 'page_index'?
[-Werror=implicit-function-declaration]
307 | key->index = (unsigned long)basepage_index(tail);
| ^~~~~~~~~~~~~~
| page_index
kernel/futex2.c: At top level:
kernel/futex2.c:683:42: error: expected ')' before 'void'
683 | COMPAT_SYSCALL_DEFINE4(compat_futex_wait, void __user *, uaddr, compat_u64,
val,
| ^~~~~
| )
kernel/futex2.c:720:16: warning: 'struct compat_futex_waitv' declared inside
parameter list will not be visible outside of this definition or declaration
720 | struct compat_futex_waitv __user *uwaitv,
| ^~~~~~~~~~~~~~~~~~
kernel/futex2.c: In function 'compat_futex_parse_waitv':
kernel/futex2.c:723:28: error: storage size of 'waitv' isn't known
723 | struct compat_futex_waitv waitv;
| ^~~~~
In file included from arch/sparc/include/asm/percpu_64.h:5,
from arch/sparc/include/asm/percpu.h:5,
from include/linux/irqflags.h:17,
from include/asm-generic/cmpxchg-local.h:6,
from arch/sparc/include/asm/cmpxchg_64.h:111,
from arch/sparc/include/asm/cmpxchg.h:5,
from arch/sparc/include/asm/atomic_64.h:12,
from arch/sparc/include/asm/atomic.h:5,
from include/linux/atomic.h:7,
from include/linux/debug_locks.h:5,
from include/linux/freezer.h:7,
from kernel/futex2.c:16:
> kernel/futex2.c:728:37: error: invalid use of undefined type
'struct compat_futex_waitv'
728 | if (copy_from_user(&waitv,
&uwaitv[i], sizeof(waitv)))
| ^
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) :
__trace_if_value(cond))
| ^~~~
kernel/futex2.c:728:3: note: in expansion of macro 'if'
728 | if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
| ^~
> kernel/futex2.c:728:37: error: invalid use of undefined type
'struct compat_futex_waitv'
728 | if (copy_from_user(&waitv,
&uwaitv[i], sizeof(waitv)))
| ^
include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) :
__trace_if_value(cond))
| ^~~~
kernel/futex2.c:728:3: note: in expansion of macro 'if'
728 | if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
| ^~
> kernel/futex2.c:728:37: error: invalid use of undefined type
'struct compat_futex_waitv'
728 | if (copy_from_user(&waitv,
&uwaitv[i], sizeof(waitv)))
| ^
include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
69 | (cond) ? \
| ^~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
kernel/futex2.c:728:3: note: in expansion of macro 'if'
728 | if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
| ^~
> kernel/futex2.c:737:31: error: implicit declaration of function
'compat_ptr' [-Werror=implicit-function-declaration]
737 |
futexv->objects[i].uaddr = compat_ptr(waitv.uaddr);
| ^~~~~~~~~~
kernel/futex2.c:723:28: warning: unused variable 'waitv' [-Wunused-variable]
723 | struct compat_futex_waitv waitv;
| ^~~~~
kernel/futex2.c: At top level:
> kernel/futex2.c:756:36: error: expected ')' before
'struct'
756 | COMPAT_SYSCALL_DEFINE4(futex_waitv, struct
compat_futex_waitv __user *, waiters,
| ^~~~~~~
| )
kernel/futex2.c:719:12: warning: 'compat_futex_parse_waitv' defined but not
used [-Wunused-function]
719 | static int compat_futex_parse_waitv(struct futex_waiter_head *futexv,
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +728 kernel/futex2.c
709
710 #ifdef CONFIG_COMPAT
711 /**
712 * compat_futex_parse_waitv - Parse a waitv array from userspace
713 * @futexv: Kernel side list of waiters to be filled
714 * @uwaitv: Userspace list to be parsed
715 * @nr_futexes: Length of futexv
716 *
717 * Return: Error code on failure, pointer to a prepared futexv otherwise
718 */
719 static int compat_futex_parse_waitv(struct futex_waiter_head *futexv,
720 struct compat_futex_waitv __user *uwaitv,
721 unsigned int nr_futexes)
722 {
723 struct compat_futex_waitv waitv;
724 struct futex_bucket *bucket;
725 unsigned int i;
726
727 for (i = 0; i < nr_futexes; i++) {
728 if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
729 return -EFAULT;
730
731 if ((waitv.flags & ~FUTEXV_WAITER_MASK) ||
732 (waitv.flags & FUTEX_SIZE_MASK) != FUTEX_32)
733 return -EINVAL;
734
735 futexv->objects[i].key.pointer = 0;
736 futexv->objects[i].flags = waitv.flags;
737 futexv->objects[i].uaddr = compat_ptr(waitv.uaddr);
738 futexv->objects[i].val = waitv.val;
739 futexv->objects[i].index = i;
740
741 bucket = futex_get_bucket(compat_ptr(waitv.uaddr),
742 &futexv->objects[i].key,
743 is_object_shared);
744
745 if (IS_ERR(bucket))
746 return PTR_ERR(bucket);
747
748 futexv->objects[i].bucket = bucket;
749
750 INIT_LIST_HEAD(&futexv->objects[i].list);
751 }
752
753 return 0;
754 }
755
756 COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv
__user *, waiters,
757 unsigned int, nr_futexes, unsigned int, flags,
758 struct __kernel_timespec __user *, timo)
759 {
760 struct futex_waiter_head *futexv;
761 int ret;
762
763 if (flags & ~FUTEXV_MASK)
764 return -EINVAL;
765
766 if (!nr_futexes || nr_futexes > FUTEX_WAITV_MAX || !waiters)
767 return -EINVAL;
768
769 futexv = kmalloc((sizeof(struct futex_waiter) * nr_futexes) +
770 sizeof(*futexv), GFP_KERNEL);
771 if (!futexv)
772 return -ENOMEM;
773
774 futexv->hint = false;
775 futexv->task = current;
776
777 ret = compat_futex_parse_waitv(futexv, waiters, nr_futexes);
778
779 if (!ret)
780 ret = __futex_waitv(futexv, nr_futexes, timo, flags);
781
782 kfree(futexv);
783
784 return ret;
785 }
786 #endif
787
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org