Re: [PATCH 6/8] vhost_task: Allow vhost layer to use copy_process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mike,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mst-vhost/linux-next]
[also build test WARNING on tip/x86/core linus/master v5.17-rc2]
[cannot apply to davem-sparc/master]
[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/Mike-Christie/Use-copy_process-in-vhost-layer/20220203-050454
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-randconfig-s021 (https://download.01.org/0day-ci/archive/20220203/202202032136.uq6pXzYT-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/2c7380ae8136c224f4c7074027303b97b0a0f84c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mike-Christie/Use-copy_process-in-vhost-layer/20220203-050454
        git checkout 2c7380ae8136c224f4c7074027303b97b0a0f84c
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> kernel/vhost_task.c:85:24: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned long [usertype] size @@     got restricted gfp_t @@
   kernel/vhost_task.c:85:24: sparse:     expected unsigned long [usertype] size
   kernel/vhost_task.c:85:24: sparse:     got restricted gfp_t
>> kernel/vhost_task.c:85:36: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted gfp_t [usertype] flags @@     got unsigned long @@
   kernel/vhost_task.c:85:36: sparse:     expected restricted gfp_t [usertype] flags
   kernel/vhost_task.c:85:36: sparse:     got unsigned long

vim +85 kernel/vhost_task.c

    62	
    63	/**
    64	 * vhost_task_create - create a copy of a process to be used by the kernel
    65	 * @fn: thread stack
    66	 * @arg: data to be passed to fn
    67	 * @node: numa node to allocate task from
    68	 *
    69	 * This returns a specialized task for use by the vhost layer or NULL on
    70	 * failure. The returned task is inactive, and the caller must fire it up
    71	 * through vhost_task_start().
    72	 */
    73	struct vhost_task *vhost_task_create(int (*fn)(void *), void *arg, int node)
    74	{
    75		struct kernel_clone_args args = {
    76			.flags		= CLONE_FS | CLONE_UNTRACED | CLONE_VM,
    77			.exit_signal	= 0,
    78			.stack		= (unsigned long)vhost_task_fn,
    79			.worker_flags	= USER_WORKER | USER_WORKER_NO_FILES |
    80					  USER_WORKER_SIG_IGN,
    81		};
    82		struct vhost_task *vtsk;
    83		struct task_struct *tsk;
    84	
  > 85		vtsk = kzalloc(GFP_KERNEL, sizeof(*vtsk));
    86		if (!vtsk)
    87			return ERR_PTR(-ENOMEM);
    88	
    89		init_completion(&vtsk->exited);
    90		vtsk->data = arg;
    91		vtsk->fn = fn;
    92		args.stack_size =  (unsigned long)vtsk;
    93	
    94		tsk = copy_process(NULL, 0, node, &args);
    95		if (IS_ERR(tsk)) {
    96			kfree(vtsk);
    97			return NULL;
    98		}
    99	
   100		vtsk->task = tsk;
   101	
   102		return vtsk;
   103	}
   104	EXPORT_SYMBOL_GPL(vhost_task_create);
   105	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux