From: kernel test robot <lkp@intel.com>
To: peili.dev@gmail.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH] Reduce vdpa initialization / startup overhead for ioctl()
Date: Thu, 20 Apr 2023 16:43:37 +0800 [thread overview]
Message-ID: <202304201654.2ewx6SeJ-lkp@intel.com> (raw)
In-Reply-To: <20230420052026.1883230-1-peili.dev@gmail.com>
Hi,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:
[auto build test ERROR on mst-vhost/linux-next]
[also build test ERROR on linus/master v6.3-rc7 next-20230419]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/peili-dev-gmail-com/Reduce-vdpa-initialization-startup-overhead-for-ioctl/20230420-132556
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
patch link: https://lore.kernel.org/r/20230420052026.1883230-1-peili.dev%40gmail.com
patch subject: [RFC PATCH] Reduce vdpa initialization / startup overhead for ioctl()
config: i386-randconfig-a012-20230417 (https://download.01.org/0day-ci/archive/20230420/202304201654.2ewx6SeJ-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/intel-lab-lkp/linux/commit/ab8e2356cbe7e460fb8d5e16d57db96737f000b7
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review peili-dev-gmail-com/Reduce-vdpa-initialization-startup-overhead-for-ioctl/20230420-132556
git checkout ab8e2356cbe7e460fb8d5e16d57db96737f000b7
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/vhost/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304201654.2ewx6SeJ-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
>> drivers/vhost/vdpa.c:558:6: error: indirection requires pointer operand ('unsigned int' invalid)
r = get_user(num, ((struct vhost_vring_state __user *)argp)->num);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:130:43: note: expanded from macro 'get_user'
#define get_user(x,ptr) ({ might_fault(); do_get_user_call(get_user,x,ptr); })
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:101:21: note: expanded from macro 'do_get_user_call'
register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX); \
~~~~~~~~~~^~~~~~~
arch/x86/include/asm/uaccess.h:72:13: note: expanded from macro '__inttype'
__typefits(x,char, \
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:78:31: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^
>> drivers/vhost/vdpa.c:558:6: error: indirection requires pointer operand ('unsigned int' invalid)
r = get_user(num, ((struct vhost_vring_state __user *)argp)->num);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:130:43: note: expanded from macro 'get_user'
#define get_user(x,ptr) ({ might_fault(); do_get_user_call(get_user,x,ptr); })
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:101:21: note: expanded from macro 'do_get_user_call'
register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX); \
~~~~~~~~~~^~~~~~~
arch/x86/include/asm/uaccess.h:73:15: note: expanded from macro '__inttype'
__typefits(x,short, \
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:78:31: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^
arch/x86/include/asm/uaccess.h:78:65: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^~~
>> drivers/vhost/vdpa.c:558:6: error: indirection requires pointer operand ('unsigned int' invalid)
r = get_user(num, ((struct vhost_vring_state __user *)argp)->num);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:130:43: note: expanded from macro 'get_user'
#define get_user(x,ptr) ({ might_fault(); do_get_user_call(get_user,x,ptr); })
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:101:21: note: expanded from macro 'do_get_user_call'
register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX); \
~~~~~~~~~~^~~~~~~
arch/x86/include/asm/uaccess.h:74:17: note: expanded from macro '__inttype'
__typefits(x,int, \
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:78:31: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^
arch/x86/include/asm/uaccess.h:78:65: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^
arch/x86/include/asm/uaccess.h:78:65: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^~~
>> drivers/vhost/vdpa.c:558:6: error: indirection requires pointer operand ('unsigned int' invalid)
r = get_user(num, ((struct vhost_vring_state __user *)argp)->num);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:130:43: note: expanded from macro 'get_user'
#define get_user(x,ptr) ({ might_fault(); do_get_user_call(get_user,x,ptr); })
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:101:21: note: expanded from macro 'do_get_user_call'
register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX); \
~~~~~~~~~~^~~~~~~
arch/x86/include/asm/uaccess.h:75:19: note: expanded from macro '__inttype'
__typefits(x,long,0ULL)))))
~~~~~~~~~~~^~~~~~~~~~~~~~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
arch/x86/include/asm/uaccess.h:78:65: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^
arch/x86/include/asm/uaccess.h:78:65: note: expanded from macro '__typefits'
arch/x86/include/asm/uaccess.h:78:65: note: expanded from macro '__typefits'
__builtin_choose_expr(sizeof(x)<=sizeof(type),(unsigned type)0,not)
^~~
>> drivers/vhost/vdpa.c:558:6: error: indirection requires pointer operand ('unsigned int' invalid)
r = get_user(num, ((struct vhost_vring_state __user *)argp)->num);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:130:43: note: expanded from macro 'get_user'
#define get_user(x,ptr) ({ might_fault(); do_get_user_call(get_user,x,ptr); })
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/uaccess.h:108:28: note: expanded from macro 'do_get_user_call'
(x) = (__force __typeof__(*(ptr))) __val_gu; \
^~~~~~
>> drivers/vhost/vdpa.c:565:34: warning: variable length array used [-Wvla]
struct vhost_vring_state states[num + 1];
^~~~~~~
>> drivers/vhost/vdpa.c:565:27: warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement]
struct vhost_vring_state states[num + 1];
^
2 warnings and 5 errors generated.
vim +558 drivers/vhost/vdpa.c
546
547 static long vhost_vdpa_vring_ioctl_batch(struct vhost_vdpa *v, unsigned int cmd,
548 void __user *argp)
549 {
550 struct vdpa_device *vdpa = v->vdpa;
551 const struct vdpa_config_ops *ops = vdpa->config;
552 struct vhost_virtqueue *vq;
553 struct vhost_vring_state s;
554
555 u32 idx, num, i;
556 long r;
557
> 558 r = get_user(num, ((struct vhost_vring_state __user *)argp)->num);
559 if (r < 0) {
560 return r;
561 }
562
563 num = array_index_nospec(num, v->nvqs);
564
> 565 struct vhost_vring_state states[num + 1];
566
567 if (copy_from_user(&states, argp, sizeof(states)))
568 return -EFAULT;
569
570 switch (cmd) {
571 case VHOST_VDPA_SET_VRING_ENABLE_BATCH:
572 for (i = 1; i <= num; i++) {
573 i = array_index_nospec(i, num + 1);
574 idx = states[i].index;
575 if (idx >= v->nvqs)
576 return -ENOBUFS;
577
578 idx = array_index_nospec(idx, v->nvqs);
579
580 ops->set_vq_ready(vdpa, idx, 1);
581 }
582 return 0;
583 case VHOST_VDPA_GET_VRING_GROUP_BATCH:
584 if (!ops->get_vq_group)
585 return -EOPNOTSUPP;
586
587 for (i = 1; i <= num; i++) {
588 i = array_index_nospec(i, num + 1);
589 idx = states[i].index;
590 if (idx >= v->nvqs)
591 return -ENOBUFS;
592 idx = array_index_nospec(idx, v->nvqs);
593 states[i].num = ops->get_vq_group(vdpa, idx);
594 if (states[i].num >= vdpa->ngroups)
595 return -EIO;
596 }
597
598 if (copy_to_user(argp, &states, sizeof(states)))
599 return -EFAULT;
600
601 return 0;
602 default:
603 r = ENOIOCTLCMD;
604 }
605
606 return r;
607 }
608
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-04-20 8:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 5:20 [RFC PATCH] Reduce vdpa initialization / startup overhead for ioctl() peili.dev
2023-04-20 7:51 ` kernel test robot
2023-04-20 8:16 ` Jason Wang
2023-04-20 8:33 ` kernel test robot
2023-04-20 8:43 ` kernel test robot [this message]
2023-04-20 11:28 ` kernel test robot
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=202304201654.2ewx6SeJ-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peili.dev@gmail.com \
/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.