All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [zen-kernel-zen-kernel:5.12/futex2 3/16] kernel/futex2.c:714:28: error: variable has incomplete type 'struct compat_futex_waitv'
Date: Wed, 16 Jun 2021 09:58:16 +0800	[thread overview]
Message-ID: <202106160913.I58TyDQC-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 9217 bytes --]

tree:   https://github.com/zen-kernel/zen-kernel 5.12/futex2
head:   81255c11c48cc2302883425c87318f9cad37e7e6
commit: 04a97ad2406166e12a13f09c9981f18e6487f530 [3/16] futex2: Implement vectorized wait
config: powerpc-randconfig-r013-20210615 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/zen-kernel/zen-kernel/commit/04a97ad2406166e12a13f09c9981f18e6487f530
        git remote add zen-kernel-zen-kernel https://github.com/zen-kernel/zen-kernel
        git fetch --no-tags zen-kernel-zen-kernel 5.12/futex2
        git checkout 04a97ad2406166e12a13f09c9981f18e6487f530
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

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

   In file included from kernel/futex2.c:16:
   In file included from include/linux/freezer.h:7:
   In file included from include/linux/debug_locks.h:5:
   In file included from include/linux/atomic.h:7:
   In file included from arch/powerpc/include/asm/atomic.h:11:
   In file included from arch/powerpc/include/asm/cmpxchg.h:8:
   In file included from include/linux/bug.h:5:
   In file included from arch/powerpc/include/asm/bug.h:109:
   In file included from include/asm-generic/bug.h:20:
   In file included from include/linux/kernel.h:11:
   In file included from include/linux/bitops.h:32:
   In file included from arch/powerpc/include/asm/bitops.h:62:
   arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
   #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
           ^
   <built-in>:309:9: note: previous definition is here
   #define __lwsync __builtin_ppc_lwsync
           ^
>> kernel/futex2.c:711:16: warning: declaration of 'struct compat_futex_waitv' will not be visible outside of this function [-Wvisibility]
                                       struct compat_futex_waitv __user *uwaitv,
                                              ^
>> kernel/futex2.c:714:28: error: variable has incomplete type 'struct compat_futex_waitv'
           struct compat_futex_waitv waitv;
                                     ^
   kernel/futex2.c:711:16: note: forward declaration of 'struct compat_futex_waitv'
                                       struct compat_futex_waitv __user *uwaitv,
                                              ^
>> kernel/futex2.c:719:37: error: subscript of pointer to incomplete type 'struct compat_futex_waitv'
                   if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
                                               ~~~~~~^
   kernel/futex2.c:711:16: note: forward declaration of 'struct compat_futex_waitv'
                                       struct compat_futex_waitv __user *uwaitv,
                                              ^
>> kernel/futex2.c:728:31: error: implicit declaration of function 'compat_ptr' [-Werror,-Wimplicit-function-declaration]
                   futexv->objects[i].uaddr  = compat_ptr(waitv.uaddr);
                                               ^
>> kernel/futex2.c:747:37: error: expected identifier
   COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv __user *, waiters,
                                       ^
>> kernel/futex2.c:754:6: error: use of undeclared identifier 'flags'
           if (flags & ~FUTEXV_MASK)
               ^
>> kernel/futex2.c:757:7: error: use of undeclared identifier 'nr_futexes'
           if (!nr_futexes || nr_futexes > FUTEX_WAITV_MAX || !waiters)
                ^
   kernel/futex2.c:757:21: error: use of undeclared identifier 'nr_futexes'
           if (!nr_futexes || nr_futexes > FUTEX_WAITV_MAX || !waiters)
                              ^
>> kernel/futex2.c:757:54: error: use of undeclared identifier 'waiters'
           if (!nr_futexes || nr_futexes > FUTEX_WAITV_MAX || !waiters)
                                                               ^
   kernel/futex2.c:760:50: error: use of undeclared identifier 'nr_futexes'
           futexv = kmalloc((sizeof(struct futex_waiter) * nr_futexes) +
                                                           ^
   kernel/futex2.c:768:41: error: use of undeclared identifier 'waiters'
           ret = compat_futex_parse_waitv(futexv, waiters, nr_futexes);
                                                  ^
   kernel/futex2.c:768:50: error: use of undeclared identifier 'nr_futexes'
           ret = compat_futex_parse_waitv(futexv, waiters, nr_futexes);
                                                           ^
   kernel/futex2.c:771:31: error: use of undeclared identifier 'nr_futexes'
                   ret = __futex_waitv(futexv, nr_futexes, timo, flags);
                                               ^
>> kernel/futex2.c:771:43: error: use of undeclared identifier 'timo'
                   ret = __futex_waitv(futexv, nr_futexes, timo, flags);
                                                           ^
   kernel/futex2.c:771:49: error: use of undeclared identifier 'flags'
                   ret = __futex_waitv(futexv, nr_futexes, timo, flags);
                                                                 ^
>> kernel/futex2.c:747:1: warning: no previous prototype for function 'COMPAT_SYSCALL_DEFINE4' [-Wmissing-prototypes]
   COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv __user *, waiters,
   ^
   kernel/futex2.c:747:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv __user *, waiters,
   ^
   static 
>> kernel/futex2.c:747:23: error: this old-style function definition is not preceded by a prototype [-Werror,-Wstrict-prototypes]
   COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv __user *, waiters,
                         ^
   3 warnings and 15 errors generated.


vim +714 kernel/futex2.c

   700	
   701	#ifdef CONFIG_COMPAT
   702	/**
   703	 * compat_futex_parse_waitv - Parse a waitv array from userspace
   704	 * @futexv:	Kernel side list of waiters to be filled
   705	 * @uwaitv:     Userspace list to be parsed
   706	 * @nr_futexes: Length of futexv
   707	 *
   708	 * Return: Error code on failure, pointer to a prepared futexv otherwise
   709	 */
   710	static int compat_futex_parse_waitv(struct futex_waiter_head *futexv,
 > 711					    struct compat_futex_waitv __user *uwaitv,
   712					    unsigned int nr_futexes)
   713	{
 > 714		struct compat_futex_waitv waitv;
   715		struct futex_bucket *bucket;
   716		unsigned int i;
   717	
   718		for (i = 0; i < nr_futexes; i++) {
 > 719			if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
   720				return -EFAULT;
   721	
   722			if ((waitv.flags & ~FUTEXV_WAITER_MASK) ||
   723			    (waitv.flags & FUTEX_SIZE_MASK) != FUTEX_32)
   724				return -EINVAL;
   725	
   726			futexv->objects[i].key.pointer = 0;
   727			futexv->objects[i].flags  = waitv.flags;
 > 728			futexv->objects[i].uaddr  = compat_ptr(waitv.uaddr);
   729			futexv->objects[i].val    = waitv.val;
   730			futexv->objects[i].index  = i;
   731	
   732			bucket = futex_get_bucket(compat_ptr(waitv.uaddr),
   733						  &futexv->objects[i].key,
   734						  is_object_shared);
   735	
   736			if (IS_ERR(bucket))
   737				return PTR_ERR(bucket);
   738	
   739			futexv->objects[i].bucket = bucket;
   740	
   741			INIT_LIST_HEAD(&futexv->objects[i].list);
   742		}
   743	
   744		return 0;
   745	}
   746	
 > 747	COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv __user *, waiters,
   748			       unsigned int, nr_futexes, unsigned int, flags,
   749			       struct __kernel_timespec __user *, timo)
   750	{
   751		struct futex_waiter_head *futexv;
   752		int ret;
   753	
 > 754		if (flags & ~FUTEXV_MASK)
   755			return -EINVAL;
   756	
 > 757		if (!nr_futexes || nr_futexes > FUTEX_WAITV_MAX || !waiters)
   758			return -EINVAL;
   759	
   760		futexv = kmalloc((sizeof(struct futex_waiter) * nr_futexes) +
   761				 sizeof(*futexv), GFP_KERNEL);
   762		if (!futexv)
   763			return -ENOMEM;
   764	
   765		futexv->hint = false;
   766		futexv->task = current;
   767	
   768		ret = compat_futex_parse_waitv(futexv, waiters, nr_futexes);
   769	
   770		if (!ret)
 > 771			ret = __futex_waitv(futexv, nr_futexes, timo, flags);
   772	
   773		kfree(futexv);
   774	
   775		return ret;
   776	}
   777	#endif
   778	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27474 bytes --]

                 reply	other threads:[~2021-06-16  1:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202106160913.I58TyDQC-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.